NASM 2.10.02
[nasm.git] / Mkfiles / msvc.mak
blob65efd6c956b7ef3e36cf3f48ca1d133945eb7443
1 # -*- makefile -*-
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.
9 top_srcdir = .
10 srcdir = .
11 VPATH = .
12 prefix = C:\Program Files\NASM
13 exec_prefix = $(prefix)
14 bindir = $(prefix)/bin
15 mandir = $(prefix)/man
17 CC = cl
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)
22 LDFLAGS =
23 LIBS =
24 PERL = perl -I$(srcdir)/perllib
26 # Binary suffixes
27 O = obj
28 X = .exe
30 .SUFFIXES: .c .i .s .$(O) .1 .man
32 .c.obj:
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) \
40 directiv.$(O) \
41 assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
42 output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \
43 output/nullout.$(O) \
44 output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
45 output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
46 output/outelfx32.$(O) \
47 output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
48 output/outdbg.$(O) output/outieee.$(O) output/outmac32.$(O) \
49 output/outmac64.$(O) preproc.$(O) quote.$(O) pptok.$(O) \
50 macros.$(O) listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) \
51 strfunc.$(O) tokhash.$(O) regvals.$(O) regflags.$(O) \
52 ilog2.$(O) \
53 lib/strlcpy.$(O) \
54 preproc-nop.$(O)
56 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \
57 insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
58 #-- End File Lists --#
60 all: nasm$(X) ndisasm$(X)
61 rem cd rdoff && $(MAKE) all
63 nasm$(X): $(NASM)
64 $(CC) $(LDFLAGS) /Fenasm$(X) $(NASM) $(LIBS)
66 ndisasm$(X): $(NDISASM)
67 $(CC) $(LDFLAGS) /Fendisasm$(X) $(NDISASM) $(LIBS)
69 # These source files are automagically generated from a single
70 # instruction-table file by a Perl script. They're distributed,
71 # though, so it isn't necessary to have Perl just to recompile NASM
72 # from the distribution.
74 insnsb.c: insns.dat insns.pl
75 $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
76 insnsa.c: insns.dat insns.pl
77 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
78 insnsd.c: insns.dat insns.pl
79 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
80 insnsi.h: insns.dat insns.pl
81 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
82 insnsn.c: insns.dat insns.pl
83 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
85 # These files contains all the standard macros that are derived from
86 # the version number.
87 version.h: version version.pl
88 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
90 version.mac: version version.pl
91 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
93 # This source file is generated from the standard macros file
94 # `standard.mac' by another Perl script. Again, it's part of the
95 # standard distribution.
97 macros.c: macros.pl standard.mac version.mac
98 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
100 # These source files are generated from regs.dat by yet another
101 # perl script.
102 regs.c: regs.dat regs.pl
103 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
104 regflags.c: regs.dat regs.pl
105 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
106 regdis.c: regs.dat regs.pl
107 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
108 regvals.c: regs.dat regs.pl
109 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
110 regs.h: regs.dat regs.pl
111 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
113 # Assembler token hash
114 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
115 $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \
116 $(srcdir)/tokens.dat > tokhash.c
118 # Assembler token metadata
119 tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
120 $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \
121 $(srcdir)/tokens.dat > tokens.h
123 # Preprocessor token hash
124 pptok.h: pptok.dat pptok.pl perllib/phash.ph
125 $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
126 pptok.c: pptok.dat pptok.pl perllib/phash.ph
127 $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
129 # This target generates all files that require perl.
130 # This allows easier generation of distribution (see dist target).
131 PERLREQ = macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
132 regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h \
133 version.h version.mac pptok.h pptok.c
134 perlreq: $(PERLREQ)
136 clean:
137 -del /f *.$(O)
138 -del /f *.s
139 -del /f *.i
140 -del /f lib\*.$(O)
141 -del /f lib\*.s
142 -del /f lib\*.i
143 -del /f output\*.$(O)
144 -del /f output\*.s
145 -del /f output\*.i
146 -del /f nasm$(X)
147 -del /f ndisasm$(X)
148 rem cd rdoff && $(MAKE) clean
150 distclean: clean
151 -del /f config.h
152 -del /f config.log
153 -del /f config.status
154 -del /f Makefile
155 -del /f *~
156 -del /f *.bak
157 -del /f *.lst
158 -del /f *.bin
159 -del /f output\*~
160 -del /f output\*.bak
161 -del /f test\*.lst
162 -del /f test\*.bin
163 -del /f test\*.$(O)
164 -del /f test\*.bin
165 -del /f/s autom4te*.cache
166 rem cd rdoff && $(MAKE) distclean
168 cleaner: clean
169 -del /f $(PERLREQ)
170 -del /f *.man
171 -del /f nasm.spec
172 rem cd doc && $(MAKE) clean
174 spotless: distclean cleaner
175 -del /f doc\Makefile
176 -del doc\*~
177 -del doc\*.bak
179 strip:
181 rdf:
182 # cd rdoff && $(MAKE)
184 doc:
185 # cd doc && $(MAKE) all
187 everything: all doc rdf
189 #-- Magic hints to mkdep.pl --#
190 # @object-ending: ".$(O)"
191 # @path-separator: "/"
192 # @exclude: "config.h"
193 #-- Everything below is generated by mkdep.pl - do not edit --#
194 assemble.$(O): assemble.c assemble.h compiler.h directiv.h insns.h insnsi.h \
195 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h tokens.h
196 crc64.$(O): crc64.c compiler.h nasmlib.h
197 directiv.$(O): directiv.c compiler.h directiv.h hashtbl.h insnsi.h nasm.h \
198 nasmlib.h opflags.h pptok.h preproc.h regs.h
199 disasm.$(O): disasm.c compiler.h directiv.h disasm.h insns.h insnsi.h nasm.h \
200 nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h sync.h tables.h \
201 tokens.h
202 eval.$(O): eval.c compiler.h directiv.h eval.h float.h insnsi.h labels.h \
203 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
204 exprlib.$(O): exprlib.c compiler.h directiv.h insnsi.h nasm.h nasmlib.h \
205 opflags.h pptok.h preproc.h regs.h
206 float.$(O): float.c compiler.h directiv.h float.h insnsi.h nasm.h nasmlib.h \
207 opflags.h pptok.h preproc.h regs.h
208 hashtbl.$(O): hashtbl.c compiler.h directiv.h hashtbl.h insnsi.h nasm.h \
209 nasmlib.h opflags.h pptok.h preproc.h regs.h
210 ilog2.$(O): ilog2.c compiler.h nasmlib.h
211 insnsa.$(O): insnsa.c compiler.h directiv.h insns.h insnsi.h nasm.h \
212 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
213 insnsb.$(O): insnsb.c compiler.h directiv.h insns.h insnsi.h nasm.h \
214 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
215 insnsd.$(O): insnsd.c compiler.h directiv.h insns.h insnsi.h nasm.h \
216 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
217 insnsn.$(O): insnsn.c compiler.h insnsi.h opflags.h tables.h
218 labels.$(O): labels.c compiler.h directiv.h hashtbl.h insnsi.h nasm.h \
219 nasmlib.h opflags.h pptok.h preproc.h regs.h
220 lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h
221 lib/strlcpy.$(O): lib/strlcpy.c compiler.h
222 lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
223 listing.$(O): listing.c compiler.h directiv.h insnsi.h listing.h nasm.h \
224 nasmlib.h opflags.h pptok.h preproc.h regs.h
225 macros.$(O): macros.c compiler.h directiv.h hashtbl.h insnsi.h nasm.h \
226 nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h tables.h
227 nasm.$(O): nasm.c assemble.h compiler.h directiv.h eval.h float.h insns.h \
228 insnsi.h labels.h listing.h nasm.h nasmlib.h opflags.h output/outform.h \
229 parser.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
230 nasmlib.$(O): nasmlib.c compiler.h directiv.h insns.h insnsi.h nasm.h \
231 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
232 ndisasm.$(O): ndisasm.c compiler.h directiv.h disasm.h insns.h insnsi.h \
233 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h tokens.h
234 output/nulldbg.$(O): output/nulldbg.c compiler.h directiv.h insnsi.h nasm.h \
235 nasmlib.h opflags.h pptok.h preproc.h regs.h
236 output/nullout.$(O): output/nullout.c compiler.h directiv.h insnsi.h nasm.h \
237 nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h
238 output/outaout.$(O): output/outaout.c compiler.h directiv.h eval.h insnsi.h \
239 nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
240 preproc.h raa.h regs.h saa.h stdscan.h
241 output/outas86.$(O): output/outas86.c compiler.h directiv.h insnsi.h nasm.h \
242 nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h preproc.h \
243 raa.h regs.h saa.h
244 output/outbin.$(O): output/outbin.c compiler.h directiv.h eval.h insnsi.h \
245 labels.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
246 pptok.h preproc.h regs.h saa.h stdscan.h
247 output/outcoff.$(O): output/outcoff.c compiler.h directiv.h eval.h insnsi.h \
248 nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h output/pecoff.h \
249 pptok.h preproc.h raa.h regs.h saa.h
250 output/outdbg.$(O): output/outdbg.c compiler.h directiv.h insnsi.h nasm.h \
251 nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
252 output/outelf.$(O): output/outelf.c compiler.h directiv.h insnsi.h nasm.h \
253 nasmlib.h opflags.h output/dwarf.h output/elf.h output/outelf.h \
254 output/outform.h pptok.h preproc.h regs.h
255 output/outelf32.$(O): output/outelf32.c compiler.h directiv.h eval.h \
256 insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
257 output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
258 preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
259 output/outelf64.$(O): output/outelf64.c compiler.h directiv.h eval.h \
260 insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
261 output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
262 preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
263 output/outelfx32.$(O): output/outelfx32.c compiler.h directiv.h eval.h \
264 insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
265 output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
266 preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
267 output/outform.$(O): output/outform.c compiler.h directiv.h insnsi.h nasm.h \
268 nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
269 output/outieee.$(O): output/outieee.c compiler.h directiv.h insnsi.h nasm.h \
270 nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h preproc.h \
271 regs.h
272 output/outlib.$(O): output/outlib.c compiler.h directiv.h insnsi.h nasm.h \
273 nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h
274 output/outmac32.$(O): output/outmac32.c compiler.h directiv.h eval.h \
275 insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
276 pptok.h preproc.h raa.h regs.h saa.h
277 output/outmac64.$(O): output/outmac64.c compiler.h directiv.h insnsi.h \
278 nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
279 preproc.h raa.h regs.h saa.h
280 output/outobj.$(O): output/outobj.c compiler.h directiv.h eval.h insnsi.h \
281 nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
282 preproc.h regs.h stdscan.h
283 output/outrdf2.$(O): output/outrdf2.c compiler.h directiv.h insnsi.h nasm.h \
284 nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h preproc.h \
285 rdoff/rdoff.h regs.h saa.h
286 parser.$(O): parser.c compiler.h directiv.h eval.h float.h insns.h insnsi.h \
287 nasm.h nasmlib.h opflags.h parser.h pptok.h preproc.h regs.h stdscan.h \
288 tables.h tokens.h
289 pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
290 preproc-nop.$(O): preproc-nop.c compiler.h directiv.h insnsi.h nasm.h \
291 nasmlib.h opflags.h pptok.h preproc.h regs.h
292 preproc.$(O): preproc.c compiler.h directiv.h eval.h hashtbl.h insnsi.h \
293 nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \
294 tables.h tokens.h
295 quote.$(O): quote.c compiler.h nasmlib.h quote.h
296 raa.$(O): raa.c compiler.h nasmlib.h raa.h
297 rbtree.$(O): rbtree.c compiler.h rbtree.h
298 regdis.$(O): regdis.c regdis.h regs.h
299 regflags.$(O): regflags.c compiler.h directiv.h insnsi.h nasm.h nasmlib.h \
300 opflags.h pptok.h preproc.h regs.h tables.h
301 regs.$(O): regs.c compiler.h insnsi.h opflags.h tables.h
302 regvals.$(O): regvals.c compiler.h insnsi.h opflags.h tables.h
303 saa.$(O): saa.c compiler.h nasmlib.h saa.h
304 stdscan.$(O): stdscan.c compiler.h directiv.h insns.h insnsi.h nasm.h \
305 nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h
306 strfunc.$(O): strfunc.c compiler.h directiv.h insnsi.h nasm.h nasmlib.h \
307 opflags.h pptok.h preproc.h regs.h
308 sync.$(O): sync.c compiler.h nasmlib.h sync.h
309 tokhash.$(O): tokhash.c compiler.h directiv.h hashtbl.h insns.h insnsi.h \
310 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
311 ver.$(O): ver.c compiler.h directiv.h insnsi.h nasm.h nasmlib.h opflags.h \
312 pptok.h preproc.h regs.h version.h