3 # Makefile for building NASM using Microsoft Visual C++ and NMAKE.
4 # Tested on Microsoft Visual C++ 2005 Express Edition.
6 # Make sure to put the appropriate directories in your PATH, in
7 # the case of MSVC++ 2005, they are ...\VC\bin and ...\Common7\IDE.
12 prefix = C
:\Program Files\NASM
13 exec_prefix = $(prefix)
14 bindir = $(prefix)/bin
15 mandir = $(prefix)/man
18 CFLAGS
= /O2
/Ox
/Oy
/W2
19 BUILD_CFLAGS
= $(CFLAGS
) /I
$(srcdir)/inttypes
20 INTERNAL_CFLAGS
= /I
$(srcdir) /I.
/DHAVE__SNPRINTF
/DHAVE__VSNPRINTF
21 ALL_CFLAGS
= $(BUILD_CFLAGS
) $(INTERNAL_CFLAGS
)
24 PERL
= perl
-I
$(srcdir)/perllib
30 .SUFFIXES
: .c .i .s .
$(O
) .1 .man
33 $(CC
) /c
$(ALL_CFLAGS
) /Fo
$@
$<
35 #-- Begin File Lists --#
36 # Edit in Makefile.in, not here!
37 NASM
= nasm.
$(O
) nasmlib.
$(O
) ver.
$(O
) \
38 raa.
$(O
) saa.
$(O
) rbtree.
$(O
) \
39 float.
$(O
) insnsa.
$(O
) insnsb.
$(O
) \
41 assemble.
$(O
) labels.
$(O
) hashtbl.
$(O
) crc64.
$(O
) parser.
$(O
) \
42 output
/outform.
$(O
) output
/outlib.
$(O
) output
/nulldbg.
$(O
) \
44 output
/outbin.
$(O
) output
/outaout.
$(O
) output
/outcoff.
$(O
) \
45 output
/outelf.
$(O
) output
/outelf32.
$(O
) output
/outelf64.
$(O
) \
46 output
/outobj.
$(O
) output
/outas86.
$(O
) output
/outrdf2.
$(O
) \
47 output
/outdbg.
$(O
) output
/outieee.
$(O
) output
/outmacho32.
$(O
) \
48 output
/outmacho64.
$(O
) preproc.
$(O
) quote.
$(O
) pptok.
$(O
) \
49 macros.
$(O
) listing.
$(O
) eval.
$(O
) exprlib.
$(O
) stdscan.
$(O
) \
50 strfunc.
$(O
) tokhash.
$(O
) regvals.
$(O
) regflags.
$(O
) \
54 NDISASM
= ndisasm.
$(O
) disasm.
$(O
) sync.
$(O
) nasmlib.
$(O
) ver.
$(O
) \
55 insnsd.
$(O
) insnsb.
$(O
) insnsn.
$(O
) regs.
$(O
) regdis.
$(O
)
56 #-- End File Lists --#
58 all: nasm
$(X
) ndisasm
$(X
)
59 rem cd rdoff
&& $(MAKE
) all
62 $(CC
) $(LDFLAGS
) /Fenasm
$(X
) $(NASM
) $(LIBS
)
64 ndisasm
$(X
): $(NDISASM
)
65 $(CC
) $(LDFLAGS
) /Fendisasm
$(X
) $(NDISASM
) $(LIBS
)
67 # These source files are automagically generated from a single
68 # instruction-table file by a Perl script. They're distributed,
69 # though, so it isn't necessary to have Perl just to recompile NASM
70 # from the distribution.
72 insnsb.c
: insns.dat insns.pl
73 $(PERL
) $(srcdir)/insns.pl
-b
$(srcdir)/insns.dat
74 insnsa.c
: insns.dat insns.pl
75 $(PERL
) $(srcdir)/insns.pl
-a
$(srcdir)/insns.dat
76 insnsd.c
: insns.dat insns.pl
77 $(PERL
) $(srcdir)/insns.pl
-d
$(srcdir)/insns.dat
78 insnsi.h
: insns.dat insns.pl
79 $(PERL
) $(srcdir)/insns.pl
-i
$(srcdir)/insns.dat
80 insnsn.c
: insns.dat insns.pl
81 $(PERL
) $(srcdir)/insns.pl
-n
$(srcdir)/insns.dat
83 # These files contains all the standard macros that are derived from
85 version.h
: version version.pl
86 $(PERL
) $(srcdir)/version.pl h
< $(srcdir)/version
> version.h
88 version.mac
: version version.pl
89 $(PERL
) $(srcdir)/version.pl mac
< $(srcdir)/version
> version.mac
91 # This source file is generated from the standard macros file
92 # `standard.mac' by another Perl script. Again, it's part of the
93 # standard distribution.
95 macros.c
: macros.pl standard.mac version.mac
96 $(PERL
) $(srcdir)/macros.pl
$(srcdir)/standard.mac version.mac
98 # These source files are generated from regs.dat by yet another
100 regs.c
: regs.dat regs.pl
101 $(PERL
) $(srcdir)/regs.pl c
$(srcdir)/regs.dat
> regs.c
102 regflags.c
: regs.dat regs.pl
103 $(PERL
) $(srcdir)/regs.pl
fc $(srcdir)/regs.dat
> regflags.c
104 regdis.c
: regs.dat regs.pl
105 $(PERL
) $(srcdir)/regs.pl dc
$(srcdir)/regs.dat
> regdis.c
106 regvals.c
: regs.dat regs.pl
107 $(PERL
) $(srcdir)/regs.pl vc
$(srcdir)/regs.dat
> regvals.c
108 regs.h
: regs.dat regs.pl
109 $(PERL
) $(srcdir)/regs.pl h
$(srcdir)/regs.dat
> regs.h
111 # Assembler token hash
112 tokhash.c
: insns.dat regs.dat tokens.dat tokhash.pl perllib
/phash.ph
113 $(PERL
) $(srcdir)/tokhash.pl c
$(srcdir)/insns.dat
$(srcdir)/regs.dat \
114 $(srcdir)/tokens.dat
> tokhash.c
116 # Assembler token metadata
117 tokens.h
: insns.dat regs.dat tokens.dat tokhash.pl perllib
/phash.ph
118 $(PERL
) $(srcdir)/tokhash.pl h
$(srcdir)/insns.dat
$(srcdir)/regs.dat \
119 $(srcdir)/tokens.dat
> tokens.h
121 # Preprocessor token hash
122 pptok.h
: pptok.dat pptok.pl perllib
/phash.ph
123 $(PERL
) $(srcdir)/pptok.pl h
$(srcdir)/pptok.dat pptok.h
124 pptok.c
: pptok.dat pptok.pl perllib
/phash.ph
125 $(PERL
) $(srcdir)/pptok.pl c
$(srcdir)/pptok.dat pptok.c
127 # This target generates all files that require perl.
128 # This allows easier generation of distribution (see dist target).
129 PERLREQ
= macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
130 regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h \
131 version.h version.mac pptok.h pptok.c
141 -del
/f output\
*.
$(O
)
146 rem cd rdoff
&& $(MAKE
) clean
151 -del
/f config.status
163 -del
/f
/s autom4te
*.cache
164 rem cd rdoff
&& $(MAKE
) distclean
170 rem cd doc
&& $(MAKE
) clean
172 spotless
: distclean cleaner
180 # cd rdoff && $(MAKE)
183 # cd doc && $(MAKE) all
185 everything
: all doc rdf
187 #-- Magic hints to mkdep.pl --#
188 # @object-ending: ".$(O)"
189 # @path-separator: "/"
190 # @exclude: "config.h"
191 #-- Everything below is generated by mkdep.pl - do not edit --#
192 assemble.
$(O
): assemble.c assemble.h compiler.h directives.h insns.h \
193 insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h \
195 crc64.
$(O
): crc64.c compiler.h nasmlib.h
196 directives.
$(O
): directives.c compiler.h directives.h hashtbl.h insnsi.h \
197 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
198 disasm.
$(O
): disasm.c compiler.h directives.h disasm.h insns.h insnsi.h \
199 nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h sync.h \
201 eval.
$(O
): eval.c compiler.h directives.h eval.h float.h insnsi.h labels.h \
202 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
203 exprlib.
$(O
): exprlib.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \
204 opflags.h pptok.h preproc.h regs.h
205 float.
$(O
): float.c compiler.h directives.h float.h insnsi.h nasm.h \
206 nasmlib.h opflags.h pptok.h preproc.h regs.h
207 hashtbl.
$(O
): hashtbl.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \
208 nasmlib.h opflags.h pptok.h preproc.h regs.h
209 ilog2.
$(O
): ilog2.c compiler.h nasmlib.h
210 insnsa.
$(O
): insnsa.c compiler.h directives.h insns.h insnsi.h nasm.h \
211 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
212 insnsb.
$(O
): insnsb.c compiler.h directives.h insns.h insnsi.h nasm.h \
213 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
214 insnsd.
$(O
): insnsd.c compiler.h directives.h insns.h insnsi.h nasm.h \
215 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
216 insnsn.
$(O
): insnsn.c compiler.h insnsi.h opflags.h tables.h
217 labels.
$(O
): labels.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \
218 nasmlib.h opflags.h pptok.h preproc.h regs.h
219 lib
/snprintf.
$(O
): lib
/snprintf.c compiler.h nasmlib.h
220 lib
/strlcpy.
$(O
): lib
/strlcpy.c compiler.h
221 lib
/vsnprintf.
$(O
): lib
/vsnprintf.c compiler.h nasmlib.h
222 listing.
$(O
): listing.c compiler.h directives.h insnsi.h listing.h nasm.h \
223 nasmlib.h opflags.h pptok.h preproc.h regs.h
224 macros.
$(O
): macros.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \
225 nasmlib.h opflags.h output
/outform.h pptok.h preproc.h regs.h tables.h
226 nasm.
$(O
): nasm.c assemble.h compiler.h directives.h eval.h float.h insns.h \
227 insnsi.h labels.h listing.h nasm.h nasmlib.h opflags.h output
/outform.h \
228 parser.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
229 nasmlib.
$(O
): nasmlib.c compiler.h directives.h insns.h insnsi.h nasm.h \
230 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
231 ndisasm.
$(O
): ndisasm.c compiler.h directives.h disasm.h insns.h insnsi.h \
232 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h tokens.h
233 output
/nulldbg.
$(O
): output
/nulldbg.c compiler.h directives.h insnsi.h \
234 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
235 output
/nullout.
$(O
): output
/nullout.c compiler.h directives.h insnsi.h \
236 nasm.h nasmlib.h opflags.h output
/outlib.h pptok.h preproc.h regs.h
237 output
/outaout.
$(O
): output
/outaout.c compiler.h directives.h eval.h \
238 insnsi.h nasm.h nasmlib.h opflags.h output
/outform.h output
/outlib.h \
239 pptok.h preproc.h raa.h regs.h saa.h stdscan.h
240 output
/outas86.
$(O
): output
/outas86.c compiler.h directives.h insnsi.h \
241 nasm.h nasmlib.h opflags.h output
/outform.h output
/outlib.h pptok.h \
242 preproc.h raa.h regs.h saa.h
243 output
/outbin.
$(O
): output
/outbin.c compiler.h directives.h eval.h insnsi.h \
244 labels.h nasm.h nasmlib.h opflags.h output
/outform.h output
/outlib.h \
245 pptok.h preproc.h regs.h saa.h stdscan.h
246 output
/outcoff.
$(O
): output
/outcoff.c compiler.h directives.h eval.h \
247 insnsi.h nasm.h nasmlib.h opflags.h output
/outform.h output
/outlib.h \
248 output
/pecoff.h pptok.h preproc.h raa.h regs.h saa.h
249 output
/outdbg.
$(O
): output
/outdbg.c compiler.h directives.h insnsi.h nasm.h \
250 nasmlib.h opflags.h output
/outform.h pptok.h preproc.h regs.h
251 output
/outelf.
$(O
): output
/outelf.c compiler.h directives.h insnsi.h nasm.h \
252 nasmlib.h opflags.h output
/dwarf.h output
/elf.h output
/outelf.h \
253 output
/outform.h pptok.h preproc.h regs.h
254 output
/outelf32.
$(O
): output
/outelf32.c compiler.h directives.h eval.h \
255 insnsi.h nasm.h nasmlib.h opflags.h output
/dwarf.h output
/elf.h \
256 output
/outelf.h output
/outform.h output
/outlib.h output
/stabs.h pptok.h \
257 preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
258 output
/outelf64.
$(O
): output
/outelf64.c compiler.h directives.h eval.h \
259 insnsi.h nasm.h nasmlib.h opflags.h output
/dwarf.h output
/elf.h \
260 output
/outelf.h output
/outform.h output
/outlib.h output
/stabs.h pptok.h \
261 preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
262 output
/outform.
$(O
): output
/outform.c compiler.h directives.h insnsi.h \
263 nasm.h nasmlib.h opflags.h output
/outform.h pptok.h preproc.h regs.h
264 output
/outieee.
$(O
): output
/outieee.c compiler.h directives.h insnsi.h \
265 nasm.h nasmlib.h opflags.h output
/outform.h output
/outlib.h pptok.h \
267 output
/outlib.
$(O
): output
/outlib.c compiler.h directives.h insnsi.h nasm.h \
268 nasmlib.h opflags.h output
/outlib.h pptok.h preproc.h regs.h
269 output
/outmacho32.
$(O
): output
/outmacho32.c compiler.h directives.h eval.h \
270 insnsi.h nasm.h nasmlib.h opflags.h output
/outform.h output
/outlib.h \
271 pptok.h preproc.h raa.h regs.h saa.h
272 output
/outmacho64.
$(O
): output
/outmacho64.c compiler.h directives.h insnsi.h \
273 nasm.h nasmlib.h opflags.h output
/outform.h output
/outlib.h pptok.h \
274 preproc.h raa.h regs.h saa.h
275 output
/outobj.
$(O
): output
/outobj.c compiler.h directives.h eval.h insnsi.h \
276 nasm.h nasmlib.h opflags.h output
/outform.h output
/outlib.h pptok.h \
277 preproc.h regs.h stdscan.h
278 output
/outrdf2.
$(O
): output
/outrdf2.c compiler.h directives.h insnsi.h \
279 nasm.h nasmlib.h opflags.h output
/outform.h output
/outlib.h pptok.h \
280 preproc.h rdoff
/rdoff.h regs.h saa.h
281 parser.
$(O
): parser.c compiler.h directives.h eval.h float.h insns.h \
282 insnsi.h nasm.h nasmlib.h opflags.h parser.h pptok.h preproc.h regs.h \
283 stdscan.h tables.h tokens.h
284 pptok.
$(O
): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
285 preproc.
$(O
): preproc.c compiler.h directives.h eval.h hashtbl.h insnsi.h \
286 nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \
288 quote.
$(O
): quote.c compiler.h nasmlib.h quote.h
289 raa.
$(O
): raa.c compiler.h nasmlib.h raa.h
290 rbtree.
$(O
): rbtree.c compiler.h rbtree.h
291 regdis.
$(O
): regdis.c regdis.h regs.h
292 regflags.
$(O
): regflags.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \
293 opflags.h pptok.h preproc.h regs.h tables.h
294 regs.
$(O
): regs.c compiler.h insnsi.h opflags.h tables.h
295 regvals.
$(O
): regvals.c compiler.h insnsi.h opflags.h tables.h
296 saa.
$(O
): saa.c compiler.h nasmlib.h saa.h
297 stdscan.
$(O
): stdscan.c compiler.h directives.h insns.h insnsi.h nasm.h \
298 nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h
299 strfunc.
$(O
): strfunc.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \
300 opflags.h pptok.h preproc.h regs.h
301 sync.
$(O
): sync.c compiler.h nasmlib.h sync.h
302 tokhash.
$(O
): tokhash.c compiler.h directives.h hashtbl.h insns.h insnsi.h \
303 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
304 ver.
$(O
): ver.c compiler.h directives.h insnsi.h nasm.h nasmlib.h opflags.h \
305 pptok.h preproc.h regs.h version.h