1 # Makefile for building NASM using Microsoft Visual C++ and NMAKE.
2 # Tested on Microsoft Visual C++ 2005 Express Edition.
4 # Make sure to put the appropriate directories in your PATH, in
5 # the case of MSVC++ 2005, they are ...\VC\bin and ...\Common7\IDE.
10 prefix = C
:\Program Files\NASM
11 exec_prefix = $(prefix)
12 bindir = $(prefix)/bin
13 mandir = $(prefix)/man
16 CFLAGS
= /O2
/Ox
/Oy
/W2
17 BUILD_CFLAGS
= $(CFLAGS
) /I
$(srcdir)/inttypes
18 INTERNAL_CFLAGS
= /I
$(srcdir) /I.
/DHAVE__SNPRINTF
/DHAVE__VSNPRINTF
19 ALL_CFLAGS
= $(BUILD_CFLAGS
) $(INTERNAL_CFLAGS
)
22 PERL
= perl
-I
$(srcdir)/perllib
28 .SUFFIXES
: .c .i .s .
$(O
) .1 .man
31 $(CC
) /c
$(ALL_CFLAGS
) /Fo
$@
$<
33 NASM
= nasm.
$(O
) nasmlib.
$(O
) float.
$(O
) insnsa.
$(O
) assemble.
$(O
) \
34 labels.
$(O
) hashtbl.
$(O
) crc64.
$(O
) parser.
$(O
) \
35 outform.
$(O
) output
/outbin.
$(O
) \
36 output
/outaout.
$(O
) output
/outcoff.
$(O
) \
37 output
/outelf32.
$(O
) output
/outelf64.
$(O
) \
38 output
/outobj.
$(O
) output
/outas86.
$(O
) output
/outrdf2.
$(O
) \
39 output
/outdbg.
$(O
) output
/outieee.
$(O
) output
/outmacho.
$(O
) \
40 preproc.
$(O
) pptok.
$(O
) \
41 listing.
$(O
) eval.
$(O
) stdscan.
$(O
) tokhash.
$(O
)
43 NDISASM
= ndisasm.
$(O
) disasm.
$(O
) sync.
$(O
) nasmlib.
$(O
) insnsd.
$(O
)
45 all: nasm
$(X
) ndisasm
$(X
)
46 rem cd rdoff
&& $(MAKE
) all
49 $(CC
) $(LDFLAGS
) /Fenasm
$(X
) $(NASM
) $(LIBS
)
51 ndisasm
$(X
): $(NDISASM
)
52 $(CC
) $(LDFLAGS
) /Fendisasm
$(X
) $(NDISASM
) $(LIBS
)
54 # These source files are automagically generated from a single
55 # instruction-table file by a Perl script. They're distributed,
56 # though, so it isn't necessary to have Perl just to recompile NASM
57 # from the distribution.
59 insnsa.c
: insns.dat insns.pl
60 $(PERL
) $(srcdir)/insns.pl
-a
$(srcdir)/insns.dat
61 insnsd.c
: insns.dat insns.pl
62 $(PERL
) $(srcdir)/insns.pl
-d
$(srcdir)/insns.dat
63 insnsi.h
: insns.dat insns.pl
64 $(PERL
) $(srcdir)/insns.pl
-i
$(srcdir)/insns.dat
65 insnsn.c
: insns.dat insns.pl
66 $(PERL
) $(srcdir)/insns.pl
-n
$(srcdir)/insns.dat
68 # These files contains all the standard macros that are derived from
70 version.h
: version version.pl
71 $(PERL
) $(srcdir)/version.pl h
< $(srcdir)/version
> version.h
73 version.mac
: version version.pl
74 $(PERL
) $(srcdir)/version.pl mac
< $(srcdir)/version
> version.mac
76 # This source file is generated from the standard macros file
77 # `standard.mac' by another Perl script. Again, it's part of the
78 # standard distribution.
80 macros.c
: macros.pl standard.mac version.mac
81 $(PERL
) $(srcdir)/macros.pl
$(srcdir)/standard.mac version.mac
83 # These source files are generated from regs.dat by yet another
85 regs.c
: regs.dat regs.pl
86 $(PERL
) $(srcdir)/regs.pl c
$(srcdir)/regs.dat
> regs.c
87 regflags.c
: regs.dat regs.pl
88 $(PERL
) $(srcdir)/regs.pl
fc $(srcdir)/regs.dat
> regflags.c
89 regdis.c
: regs.dat regs.pl
90 $(PERL
) $(srcdir)/regs.pl dc
$(srcdir)/regs.dat
> regdis.c
91 regvals.c
: regs.dat regs.pl
92 $(PERL
) $(srcdir)/regs.pl vc
$(srcdir)/regs.dat
> regvals.c
93 regs.h
: regs.dat regs.pl
94 $(PERL
) $(srcdir)/regs.pl h
$(srcdir)/regs.dat
> regs.h
96 # Assembler token hash
97 tokhash.c
: insns.dat regs.dat tokens.dat tokhash.pl perllib
/phash.ph
98 $(PERL
) $(srcdir)/tokhash.pl
$(srcdir)/insns.dat
$(srcdir)/regs.dat \
99 $(srcdir)/tokens.dat
> tokhash.c
101 # Preprocessor token hash
102 pptok.h
: pptok.dat pptok.pl perllib
/phash.ph
103 $(PERL
) $(srcdir)/pptok.pl h
$(srcdir)/pptok.dat pptok.h
104 pptok.c
: pptok.dat pptok.pl perllib
/phash.ph
105 $(PERL
) $(srcdir)/pptok.pl c
$(srcdir)/pptok.dat pptok.c
107 # This target generates all files that require perl.
108 # This allows easier generation of distribution (see dist target).
109 PERLREQ
= macros.c insnsa.c insnsd.c insnsi.h insnsn.c \
110 regs.c regs.h regflags.c regdis.c regvals.c tokhash.c \
111 version.h version.mac pptok.h pptok.c
118 -del
/f output\
*.
$(O
)
123 rem cd rdoff
&& $(MAKE
) clean
128 -del
/f config.status
140 -del
/f
/s autom4te
*.cache
141 rem cd rdoff
&& $(MAKE
) distclean
147 rem cd doc
&& $(MAKE
) clean
149 spotless
: distclean cleaner
157 # cd rdoff && $(MAKE)
160 # cd doc && $(MAKE) all
162 everything
: all doc rdf
164 #-- Magic hints to mkdep.pl --#
165 # @object-ending: ".$(O)"
166 # @path-separator: "/"
167 #-- Everything below is generated by mkdep.pl - do not edit --#
168 assemble.
$(O
): assemble.c assemble.h compiler.h config.h insns.h insnsi.h \
169 nasm.h nasmlib.h pptok.h preproc.h regflags.c regs.h regvals.c version.h
171 disasm.
$(O
): disasm.c compiler.h config.h disasm.h insns.h insnsi.h insnsn.c \
172 names.c nasm.h regdis.c regs.c regs.h sync.h version.h
173 eval.
$(O
): eval.c compiler.h config.h eval.h insnsi.h labels.h nasm.h \
174 nasmlib.h regs.h version.h
175 float.
$(O
): float.c compiler.h config.h insnsi.h nasm.h regs.h version.h
176 hashtbl.
$(O
): hashtbl.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
177 nasmlib.h regs.h version.h
178 insnsa.
$(O
): insnsa.c compiler.h config.h insns.h insnsi.h nasm.h regs.h \
180 insnsd.
$(O
): insnsd.c compiler.h config.h insns.h insnsi.h nasm.h regs.h \
182 insnsn.
$(O
): insnsn.c
183 labels.
$(O
): labels.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
184 nasmlib.h regs.h version.h
185 listing.
$(O
): listing.c compiler.h config.h insnsi.h listing.h nasm.h \
186 nasmlib.h regs.h version.h
187 macros.
$(O
): macros.c
188 names.
$(O
): names.c insnsn.c regs.c
189 nasm.
$(O
): nasm.c assemble.h compiler.h config.h eval.h insns.h insnsi.h \
190 labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \
191 regs.h stdscan.h version.h
192 nasmlib.
$(O
): nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h \
193 nasmlib.h regs.h version.h
194 ndisasm.
$(O
): ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
195 nasmlib.h regs.h sync.h version.h
196 outform.
$(O
): outform.c compiler.h config.h insnsi.h nasm.h outform.h regs.h \
198 output
/outaout.
$(O
): output
/outaout.c compiler.h config.h insnsi.h nasm.h \
199 nasmlib.h outform.h regs.h stdscan.h version.h
200 output
/outas86.
$(O
): output
/outas86.c compiler.h config.h insnsi.h nasm.h \
201 nasmlib.h outform.h regs.h version.h
202 output
/outbin.
$(O
): output
/outbin.c compiler.h config.h eval.h insnsi.h \
203 labels.h nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
204 output
/outcoff.
$(O
): output
/outcoff.c compiler.h config.h insnsi.h nasm.h \
205 nasmlib.h outform.h regs.h version.h
206 output
/outdbg.
$(O
): output
/outdbg.c compiler.h config.h insnsi.h nasm.h \
207 nasmlib.h outform.h regs.h version.h
208 output
/outelf32.
$(O
): output
/outelf32.c compiler.h config.h insnsi.h nasm.h \
209 nasmlib.h outform.h regs.h stdscan.h version.h
210 output
/outelf64.
$(O
): output
/outelf64.c compiler.h config.h insnsi.h nasm.h \
211 nasmlib.h outform.h regs.h stdscan.h version.h
212 output
/outieee.
$(O
): output
/outieee.c compiler.h config.h insnsi.h nasm.h \
213 nasmlib.h outform.h regs.h version.h
214 output
/outmacho.
$(O
): output
/outmacho.c compiler.h config.h insnsi.h nasm.h \
215 nasmlib.h outform.h regs.h version.h
216 output
/outobj.
$(O
): output
/outobj.c compiler.h config.h insnsi.h nasm.h \
217 nasmlib.h outform.h regs.h stdscan.h version.h
218 output
/outrdf.
$(O
): output
/outrdf.c compiler.h config.h insnsi.h nasm.h \
219 nasmlib.h outform.h regs.h version.h
220 output
/outrdf2.
$(O
): output
/outrdf2.c compiler.h config.h insnsi.h nasm.h \
221 nasmlib.h outform.h rdoff
/rdoff.h regs.h version.h
222 parser.
$(O
): parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
223 nasmlib.h parser.h regflags.c regs.h stdscan.h version.h
224 pptok.
$(O
): pptok.c compiler.h config.h nasmlib.h pptok.h preproc.h
225 preproc.
$(O
): preproc.c compiler.h config.h hashtbl.h insnsi.h macros.c \
226 nasm.h nasmlib.h pptok.h preproc.h regs.h version.h
227 regdis.
$(O
): regdis.c
228 regflags.
$(O
): regflags.c
230 regvals.
$(O
): regvals.c
231 stdscan.
$(O
): stdscan.c compiler.h config.h insns.h insnsi.h nasm.h \
232 nasmlib.h regs.h stdscan.h version.h
233 sync.
$(O
): sync.c sync.h
234 tokhash.
$(O
): tokhash.c compiler.h config.h insns.h insnsi.h nasm.h regs.h \