insns: Fix MOVNTDQA instruction
[nasm.git] / Mkfiles / msvc.mak
blob583cc2c11c96a47f9468a3b5fff5304c805aaa73
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 pptok.ph standard.mac version.mac \
98 $(srcdir)/macros/*.mac $(srcdir)/output/*.mac
99 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac \
100 $(srcdir)/macros/*.mac $(srcdir)/output/*.mac
102 # These source files are generated from regs.dat by yet another
103 # perl script.
104 regs.c: regs.dat regs.pl
105 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
106 regflags.c: regs.dat regs.pl
107 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
108 regdis.c: regs.dat regs.pl
109 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
110 regdis.h: regs.dat regs.pl
111 $(PERL) $(srcdir)/regs.pl dh $(srcdir)/regs.dat > regdis.h
112 regvals.c: regs.dat regs.pl
113 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
114 regs.h: regs.dat regs.pl
115 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
117 # Assembler token hash
118 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
119 $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \
120 $(srcdir)/tokens.dat > tokhash.c
122 # Assembler token metadata
123 tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
124 $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \
125 $(srcdir)/tokens.dat > tokens.h
127 # Preprocessor token hash
128 pptok.h: pptok.dat pptok.pl perllib/phash.ph
129 $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
130 pptok.c: pptok.dat pptok.pl perllib/phash.ph
131 $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
132 pptok.ph: pptok.dat pptok.pl perllib/phash.ph
133 $(PERL) $(srcdir)/pptok.pl ph $(srcdir)/pptok.dat pptok.ph
135 # Directives hash
136 directiv.h: directiv.dat directiv.pl perllib/phash.ph
137 $(PERL) $(srcdir)/directiv.pl h $(srcdir)/directiv.dat directiv.h
138 directiv.c: directiv.dat directiv.pl perllib/phash.ph
139 $(PERL) $(srcdir)/directiv.pl c $(srcdir)/directiv.dat directiv.c
141 # This target generates all files that require perl.
142 # This allows easier generation of distribution (see dist target).
143 PERLREQ = macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
144 regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h \
145 version.h version.mac pptok.h pptok.c
146 perlreq: $(PERLREQ)
148 clean:
149 -del /f *.$(O)
150 -del /f *.s
151 -del /f *.i
152 -del /f lib\*.$(O)
153 -del /f lib\*.s
154 -del /f lib\*.i
155 -del /f output\*.$(O)
156 -del /f output\*.s
157 -del /f output\*.i
158 -del /f nasm$(X)
159 -del /f ndisasm$(X)
160 rem cd rdoff && $(MAKE) clean
162 distclean: clean
163 -del /f config.h
164 -del /f config.log
165 -del /f config.status
166 -del /f Makefile
167 -del /f *~
168 -del /f *.bak
169 -del /f *.lst
170 -del /f *.bin
171 -del /f output\*~
172 -del /f output\*.bak
173 -del /f test\*.lst
174 -del /f test\*.bin
175 -del /f test\*.$(O)
176 -del /f test\*.bin
177 -del /f/s autom4te*.cache
178 rem cd rdoff && $(MAKE) distclean
180 cleaner: clean
181 -del /f $(PERLREQ)
182 -del /f *.man
183 -del /f nasm.spec
184 rem cd doc && $(MAKE) clean
186 spotless: distclean cleaner
187 -del /f doc\Makefile
188 -del doc\*~
189 -del doc\*.bak
191 strip:
193 rdf:
194 # cd rdoff && $(MAKE)
196 doc:
197 # cd doc && $(MAKE) all
199 everything: all doc rdf
201 #-- Magic hints to mkdep.pl --#
202 # @object-ending: ".$(O)"
203 # @path-separator: "/"
204 # @exclude: "config.h"
205 #-- Everything below is generated by mkdep.pl - do not edit --#
206 assemble.$(O): assemble.c assemble.h compiler.h directiv.h insns.h insnsi.h \
207 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h tokens.h
208 crc64.$(O): crc64.c compiler.h nasmlib.h
209 directiv.$(O): directiv.c compiler.h directiv.h hashtbl.h insnsi.h nasm.h \
210 nasmlib.h opflags.h pptok.h preproc.h regs.h
211 disasm.$(O): disasm.c compiler.h directiv.h disasm.h insns.h insnsi.h nasm.h \
212 nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h sync.h tables.h \
213 tokens.h
214 eval.$(O): eval.c compiler.h directiv.h eval.h float.h insnsi.h labels.h \
215 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
216 exprlib.$(O): exprlib.c compiler.h directiv.h insnsi.h nasm.h nasmlib.h \
217 opflags.h pptok.h preproc.h regs.h
218 float.$(O): float.c compiler.h directiv.h float.h insnsi.h nasm.h nasmlib.h \
219 opflags.h pptok.h preproc.h regs.h
220 hashtbl.$(O): hashtbl.c compiler.h directiv.h hashtbl.h insnsi.h nasm.h \
221 nasmlib.h opflags.h pptok.h preproc.h regs.h
222 ilog2.$(O): ilog2.c compiler.h nasmlib.h
223 insnsa.$(O): insnsa.c compiler.h directiv.h insns.h insnsi.h nasm.h \
224 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
225 insnsb.$(O): insnsb.c compiler.h directiv.h insns.h insnsi.h nasm.h \
226 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
227 insnsd.$(O): insnsd.c compiler.h directiv.h insns.h insnsi.h nasm.h \
228 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
229 insnsn.$(O): insnsn.c compiler.h insnsi.h opflags.h tables.h
230 labels.$(O): labels.c compiler.h directiv.h hashtbl.h insnsi.h nasm.h \
231 nasmlib.h opflags.h pptok.h preproc.h regs.h
232 lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h
233 lib/strlcpy.$(O): lib/strlcpy.c compiler.h
234 lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
235 listing.$(O): listing.c compiler.h directiv.h insnsi.h listing.h nasm.h \
236 nasmlib.h opflags.h pptok.h preproc.h regs.h
237 macros.$(O): macros.c compiler.h directiv.h hashtbl.h insnsi.h nasm.h \
238 nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h tables.h
239 nasm.$(O): nasm.c assemble.h compiler.h directiv.h eval.h float.h insns.h \
240 insnsi.h labels.h listing.h nasm.h nasmlib.h opflags.h output/outform.h \
241 parser.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
242 nasmlib.$(O): nasmlib.c compiler.h directiv.h insns.h insnsi.h nasm.h \
243 nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
244 ndisasm.$(O): ndisasm.c compiler.h directiv.h disasm.h insns.h insnsi.h \
245 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h tokens.h
246 output/nulldbg.$(O): output/nulldbg.c compiler.h directiv.h insnsi.h nasm.h \
247 nasmlib.h opflags.h pptok.h preproc.h regs.h
248 output/nullout.$(O): output/nullout.c compiler.h directiv.h insnsi.h nasm.h \
249 nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h
250 output/outaout.$(O): output/outaout.c compiler.h directiv.h eval.h insnsi.h \
251 nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
252 preproc.h raa.h regs.h saa.h stdscan.h
253 output/outas86.$(O): output/outas86.c compiler.h directiv.h insnsi.h nasm.h \
254 nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h preproc.h \
255 raa.h regs.h saa.h
256 output/outbin.$(O): output/outbin.c compiler.h directiv.h eval.h insnsi.h \
257 labels.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
258 pptok.h preproc.h regs.h saa.h stdscan.h
259 output/outcoff.$(O): output/outcoff.c compiler.h directiv.h eval.h insnsi.h \
260 nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h output/pecoff.h \
261 pptok.h preproc.h raa.h regs.h saa.h
262 output/outdbg.$(O): output/outdbg.c compiler.h directiv.h insnsi.h nasm.h \
263 nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
264 output/outelf.$(O): output/outelf.c compiler.h directiv.h insnsi.h nasm.h \
265 nasmlib.h opflags.h output/dwarf.h output/elf.h output/outelf.h \
266 output/outform.h pptok.h preproc.h regs.h
267 output/outelf32.$(O): output/outelf32.c compiler.h directiv.h eval.h \
268 insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
269 output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
270 preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
271 output/outelf64.$(O): output/outelf64.c compiler.h directiv.h eval.h \
272 insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
273 output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
274 preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
275 output/outelfx32.$(O): output/outelfx32.c compiler.h directiv.h eval.h \
276 insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
277 output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
278 preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
279 output/outform.$(O): output/outform.c compiler.h directiv.h insnsi.h nasm.h \
280 nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
281 output/outieee.$(O): output/outieee.c compiler.h directiv.h insnsi.h nasm.h \
282 nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h preproc.h \
283 regs.h
284 output/outlib.$(O): output/outlib.c compiler.h directiv.h insnsi.h nasm.h \
285 nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h
286 output/outmac32.$(O): output/outmac32.c compiler.h directiv.h eval.h \
287 insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
288 pptok.h preproc.h raa.h regs.h saa.h
289 output/outmac64.$(O): output/outmac64.c compiler.h directiv.h insnsi.h \
290 nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
291 preproc.h raa.h regs.h saa.h
292 output/outobj.$(O): output/outobj.c compiler.h directiv.h eval.h insnsi.h \
293 nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \
294 preproc.h regs.h stdscan.h
295 output/outrdf2.$(O): output/outrdf2.c compiler.h directiv.h insnsi.h nasm.h \
296 nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h preproc.h \
297 rdoff/rdoff.h regs.h saa.h
298 parser.$(O): parser.c compiler.h directiv.h eval.h float.h insns.h insnsi.h \
299 nasm.h nasmlib.h opflags.h parser.h pptok.h preproc.h regs.h stdscan.h \
300 tables.h tokens.h
301 pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
302 preproc-nop.$(O): preproc-nop.c compiler.h directiv.h insnsi.h nasm.h \
303 nasmlib.h opflags.h pptok.h preproc.h regs.h
304 preproc.$(O): preproc.c compiler.h directiv.h eval.h hashtbl.h insnsi.h \
305 nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \
306 tables.h tokens.h
307 quote.$(O): quote.c compiler.h nasmlib.h quote.h
308 raa.$(O): raa.c compiler.h nasmlib.h raa.h
309 rbtree.$(O): rbtree.c compiler.h rbtree.h
310 regdis.$(O): regdis.c regdis.h regs.h
311 regflags.$(O): regflags.c compiler.h directiv.h insnsi.h nasm.h nasmlib.h \
312 opflags.h pptok.h preproc.h regs.h tables.h
313 regs.$(O): regs.c compiler.h insnsi.h opflags.h tables.h
314 regvals.$(O): regvals.c compiler.h insnsi.h opflags.h tables.h
315 saa.$(O): saa.c compiler.h nasmlib.h saa.h
316 stdscan.$(O): stdscan.c compiler.h directiv.h insns.h insnsi.h nasm.h \
317 nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h
318 strfunc.$(O): strfunc.c compiler.h directiv.h insnsi.h nasm.h nasmlib.h \
319 opflags.h pptok.h preproc.h regs.h
320 sync.$(O): sync.c compiler.h nasmlib.h sync.h
321 tokhash.$(O): tokhash.c compiler.h directiv.h hashtbl.h insns.h insnsi.h \
322 nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
323 ver.$(O): ver.c compiler.h directiv.h insnsi.h nasm.h nasmlib.h opflags.h \
324 pptok.h preproc.h regs.h version.h