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 NASM
= nasm.
$(O
) nasmlib.
$(O
) float.
$(O
) insnsa.
$(O
) insnsb.
$(O
) \
36 assemble.
$(O
) labels.
$(O
) hashtbl.
$(O
) crc64.
$(O
) parser.
$(O
) \
37 outform.
$(O
) output
/outbin.
$(O
) \
38 output
/outaout.
$(O
) output
/outcoff.
$(O
) \
39 output
/outelf32.
$(O
) output
/outelf64.
$(O
) \
40 output
/outobj.
$(O
) output
/outas86.
$(O
) output
/outrdf2.
$(O
) \
41 output
/outdbg.
$(O
) output
/outieee.
$(O
) output
/outmacho.
$(O
) \
42 preproc.
$(O
) quote.
$(O
) pptok.
$(O
) macros.
$(O
) \
43 listing.
$(O
) eval.
$(O
) exprlib.
$(O
) stdscan.
$(O
) tokhash.
$(O
) \
44 regvals.
$(O
) regflags.
$(O
)
46 NDISASM
= ndisasm.
$(O
) disasm.
$(O
) sync.
$(O
) nasmlib.
$(O
) \
47 insnsd.
$(O
) insnsb.
$(O
) insnsn.
$(O
) regs.
$(O
) regdis.
$(O
)
49 all: nasm
$(X
) ndisasm
$(X
)
50 rem cd rdoff
&& $(MAKE
) all
53 $(CC
) $(LDFLAGS
) /Fenasm
$(X
) $(NASM
) $(LIBS
)
55 ndisasm
$(X
): $(NDISASM
)
56 $(CC
) $(LDFLAGS
) /Fendisasm
$(X
) $(NDISASM
) $(LIBS
)
58 # These source files are automagically generated from a single
59 # instruction-table file by a Perl script. They're distributed,
60 # though, so it isn't necessary to have Perl just to recompile NASM
61 # from the distribution.
63 insnsb.c
: insns.dat insns.pl
64 $(PERL
) $(srcdir)/insns.pl
-b
$(srcdir)/insns.dat
65 insnsa.c
: insns.dat insns.pl
66 $(PERL
) $(srcdir)/insns.pl
-a
$(srcdir)/insns.dat
67 insnsd.c
: insns.dat insns.pl
68 $(PERL
) $(srcdir)/insns.pl
-d
$(srcdir)/insns.dat
69 insnsi.h
: insns.dat insns.pl
70 $(PERL
) $(srcdir)/insns.pl
-i
$(srcdir)/insns.dat
71 insnsn.c
: insns.dat insns.pl
72 $(PERL
) $(srcdir)/insns.pl
-n
$(srcdir)/insns.dat
74 # These files contains all the standard macros that are derived from
76 version.h
: version version.pl
77 $(PERL
) $(srcdir)/version.pl h
< $(srcdir)/version
> version.h
79 version.mac
: version version.pl
80 $(PERL
) $(srcdir)/version.pl mac
< $(srcdir)/version
> version.mac
82 # This source file is generated from the standard macros file
83 # `standard.mac' by another Perl script. Again, it's part of the
84 # standard distribution.
86 macros.c
: macros.pl standard.mac version.mac
87 $(PERL
) $(srcdir)/macros.pl
$(srcdir)/standard.mac version.mac
89 # These source files are generated from regs.dat by yet another
91 regs.c
: regs.dat regs.pl
92 $(PERL
) $(srcdir)/regs.pl c
$(srcdir)/regs.dat
> regs.c
93 regflags.c
: regs.dat regs.pl
94 $(PERL
) $(srcdir)/regs.pl
fc $(srcdir)/regs.dat
> regflags.c
95 regdis.c
: regs.dat regs.pl
96 $(PERL
) $(srcdir)/regs.pl dc
$(srcdir)/regs.dat
> regdis.c
97 regvals.c
: regs.dat regs.pl
98 $(PERL
) $(srcdir)/regs.pl vc
$(srcdir)/regs.dat
> regvals.c
99 regs.h
: regs.dat regs.pl
100 $(PERL
) $(srcdir)/regs.pl h
$(srcdir)/regs.dat
> regs.h
102 # Assembler token hash
103 tokhash.c
: insns.dat regs.dat tokens.dat tokhash.pl perllib
/phash.ph
104 $(PERL
) $(srcdir)/tokhash.pl c
$(srcdir)/insns.dat
$(srcdir)/regs.dat \
105 $(srcdir)/tokens.dat
> tokhash.c
107 # Assembler token metadata
108 tokens.h
: insns.dat regs.dat tokens.dat tokhash.pl perllib
/phash.ph
109 $(PERL
) $(srcdir)/tokhash.pl h
$(srcdir)/insns.dat
$(srcdir)/regs.dat \
110 $(srcdir)/tokens.dat
> tokens.h
112 # Preprocessor token hash
113 pptok.h
: pptok.dat pptok.pl perllib
/phash.ph
114 $(PERL
) $(srcdir)/pptok.pl h
$(srcdir)/pptok.dat pptok.h
115 pptok.c
: pptok.dat pptok.pl perllib
/phash.ph
116 $(PERL
) $(srcdir)/pptok.pl c
$(srcdir)/pptok.dat pptok.c
118 # This target generates all files that require perl.
119 # This allows easier generation of distribution (see dist target).
120 PERLREQ
= macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
121 regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h \
122 version.h version.mac pptok.h pptok.c
129 -del
/f output\
*.
$(O
)
134 rem cd rdoff
&& $(MAKE
) clean
139 -del
/f config.status
151 -del
/f
/s autom4te
*.cache
152 rem cd rdoff
&& $(MAKE
) distclean
158 rem cd doc
&& $(MAKE
) clean
160 spotless
: distclean cleaner
168 # cd rdoff && $(MAKE)
171 # cd doc && $(MAKE) all
173 everything
: all doc rdf
175 #-- Magic hints to mkdep.pl --#
176 # @object-ending: ".$(O)"
177 # @path-separator: "/"
178 # @exclude: "config.h"
179 #-- Everything below is generated by mkdep.pl - do not edit --#
180 assemble.
$(O
): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h \
181 nasmlib.h regs.h tables.h tokens.h version.h
182 crc64.
$(O
): crc64.c compiler.h
183 disasm.
$(O
): disasm.c compiler.h disasm.h insns.h insnsi.h nasm.h nasmlib.h \
184 regdis.h regs.h sync.h tables.h tokens.h version.h
185 eval.
$(O
): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h \
186 nasmlib.h regs.h version.h
187 exprlib.
$(O
): exprlib.c compiler.h insnsi.h nasm.h nasmlib.h regs.h \
189 float.
$(O
): float.c compiler.h float.h insnsi.h nasm.h nasmlib.h regs.h \
191 hashtbl.
$(O
): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
193 insnsa.
$(O
): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
195 insnsb.
$(O
): insnsb.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
197 insnsd.
$(O
): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
199 insnsn.
$(O
): insnsn.c compiler.h insnsi.h tables.h
200 labels.
$(O
): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h regs.h \
202 lib
/snprintf.
$(O
): lib
/snprintf.c compiler.h nasmlib.h
203 lib
/vsnprintf.
$(O
): lib
/vsnprintf.c compiler.h nasmlib.h
204 listing.
$(O
): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
206 macros.
$(O
): macros.c compiler.h insnsi.h tables.h
207 nasm.
$(O
): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h \
208 labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \
209 regs.h stdscan.h tokens.h version.h
210 nasmlib.
$(O
): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
212 ndisasm.
$(O
): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
213 nasmlib.h regs.h sync.h tokens.h version.h
214 outform.
$(O
): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h \
216 output
/outaout.
$(O
): output
/outaout.c compiler.h insnsi.h nasm.h nasmlib.h \
217 outform.h regs.h stdscan.h version.h
218 output
/outas86.
$(O
): output
/outas86.c compiler.h insnsi.h nasm.h nasmlib.h \
219 outform.h regs.h version.h
220 output
/outbin.
$(O
): output
/outbin.c compiler.h eval.h insnsi.h labels.h \
221 nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
222 output
/outcoff.
$(O
): output
/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \
223 outform.h regs.h version.h
224 output
/outdbg.
$(O
): output
/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
225 outform.h regs.h version.h
226 output
/outelf32.
$(O
): output
/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
227 outform.h regs.h stdscan.h version.h wsaa.h
228 output
/outelf64.
$(O
): output
/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
229 outform.h regs.h stdscan.h version.h wsaa.h
230 output
/outieee.
$(O
): output
/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
231 outform.h regs.h version.h
232 output
/outmacho.
$(O
): output
/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
233 outform.h regs.h version.h
234 output
/outobj.
$(O
): output
/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
235 outform.h regs.h stdscan.h version.h
236 output
/outrdf.
$(O
): output
/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
237 outform.h regs.h version.h
238 output
/outrdf2.
$(O
): output
/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
239 outform.h rdoff
/rdoff.h regs.h version.h
240 parser.
$(O
): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
241 parser.h regs.h stdscan.h tables.h tokens.h version.h
242 pptok.
$(O
): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
243 preproc.
$(O
): preproc.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
244 pptok.h preproc.h quote.h regs.h stdscan.h tables.h tokens.h version.h
245 quote.
$(O
): quote.c compiler.h nasmlib.h quote.h
246 quotetest.
$(O
): quotetest.c compiler.h nasmlib.h
247 regdis.
$(O
): regdis.c regdis.h regs.h
248 regflags.
$(O
): regflags.c compiler.h insnsi.h nasm.h nasmlib.h regs.h \
250 regs.
$(O
): regs.c compiler.h insnsi.h tables.h
251 regvals.
$(O
): regvals.c compiler.h insnsi.h tables.h
252 stdscan.
$(O
): stdscan.c compiler.h insns.h insnsi.h nasm.h nasmlib.h quote.h \
253 regs.h stdscan.h tokens.h version.h
254 sync.
$(O
): sync.c compiler.h nasmlib.h sync.h
255 tokhash.
$(O
): tokhash.c compiler.h hashtbl.h insns.h insnsi.h nasm.h \
256 nasmlib.h regs.h tokens.h version.h