NASM 2.05rc8
[nasm/avx512.git] / Mkfiles / msvc.mak
blob594bce693bb97048661b9e2b771180da456bf528
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) raa.$(O) saa.$(O) \
38 float.$(O) insnsa.$(O) insnsb.$(O) \
39 assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
40 outform.$(O) output/outbin.$(O) \
41 output/outaout.$(O) output/outcoff.$(O) \
42 output/outelf32.$(O) output/outelf64.$(O) \
43 output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
44 output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
45 preproc.$(O) quote.$(O) pptok.$(O) macros.$(O) \
46 listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) strfunc.$(O) \
47 tokhash.$(O) regvals.$(O) regflags.$(O)
49 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) \
50 insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
51 #-- End File Lists --#
53 all: nasm$(X) ndisasm$(X)
54 rem cd rdoff && $(MAKE) all
56 nasm$(X): $(NASM)
57 $(CC) $(LDFLAGS) /Fenasm$(X) $(NASM) $(LIBS)
59 ndisasm$(X): $(NDISASM)
60 $(CC) $(LDFLAGS) /Fendisasm$(X) $(NDISASM) $(LIBS)
62 # These source files are automagically generated from a single
63 # instruction-table file by a Perl script. They're distributed,
64 # though, so it isn't necessary to have Perl just to recompile NASM
65 # from the distribution.
67 insnsb.c: insns.dat insns.pl
68 $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
69 insnsa.c: insns.dat insns.pl
70 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
71 insnsd.c: insns.dat insns.pl
72 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
73 insnsi.h: insns.dat insns.pl
74 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
75 insnsn.c: insns.dat insns.pl
76 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
78 # These files contains all the standard macros that are derived from
79 # the version number.
80 version.h: version version.pl
81 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
83 version.mac: version version.pl
84 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
86 # This source file is generated from the standard macros file
87 # `standard.mac' by another Perl script. Again, it's part of the
88 # standard distribution.
90 macros.c: macros.pl standard.mac version.mac
91 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
93 # These source files are generated from regs.dat by yet another
94 # perl script.
95 regs.c: regs.dat regs.pl
96 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
97 regflags.c: regs.dat regs.pl
98 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
99 regdis.c: regs.dat regs.pl
100 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
101 regvals.c: regs.dat regs.pl
102 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
103 regs.h: regs.dat regs.pl
104 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
106 # Assembler token hash
107 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
108 $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \
109 $(srcdir)/tokens.dat > tokhash.c
111 # Assembler token metadata
112 tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
113 $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \
114 $(srcdir)/tokens.dat > tokens.h
116 # Preprocessor token hash
117 pptok.h: pptok.dat pptok.pl perllib/phash.ph
118 $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
119 pptok.c: pptok.dat pptok.pl perllib/phash.ph
120 $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
122 # This target generates all files that require perl.
123 # This allows easier generation of distribution (see dist target).
124 PERLREQ = macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
125 regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h \
126 version.h version.mac pptok.h pptok.c
127 perlreq: $(PERLREQ)
129 clean:
130 -del /f *.$(O)
131 -del /f *.s
132 -del /f *.i
133 -del /f output\*.$(O)
134 -del /f output\*.s
135 -del /f output\*.i
136 -del /f nasm$(X)
137 -del /f ndisasm$(X)
138 rem cd rdoff && $(MAKE) clean
140 distclean: clean
141 -del /f config.h
142 -del /f config.log
143 -del /f config.status
144 -del /f Makefile
145 -del /f *~
146 -del /f *.bak
147 -del /f *.lst
148 -del /f *.bin
149 -del /f output\*~
150 -del /f output\*.bak
151 -del /f test\*.lst
152 -del /f test\*.bin
153 -del /f test\*.$(O)
154 -del /f test\*.bin
155 -del /f/s autom4te*.cache
156 rem cd rdoff && $(MAKE) distclean
158 cleaner: clean
159 -del /f $(PERLREQ)
160 -del /f *.man
161 -del /f nasm.spec
162 rem cd doc && $(MAKE) clean
164 spotless: distclean cleaner
165 -del /f doc\Makefile
166 -del doc\*~
167 -del doc\*.bak
169 strip:
171 rdf:
172 # cd rdoff && $(MAKE)
174 doc:
175 # cd doc && $(MAKE) all
177 everything: all doc rdf
179 #-- Magic hints to mkdep.pl --#
180 # @object-ending: ".$(O)"
181 # @path-separator: "/"
182 # @exclude: "config.h"
183 #-- Everything below is generated by mkdep.pl - do not edit --#
184 assemble.$(O): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h \
185 nasmlib.h pptok.h preproc.h regs.h tables.h tokens.h version.h
186 crc64.$(O): crc64.c compiler.h nasmlib.h
187 disasm.$(O): disasm.c compiler.h disasm.h insns.h insnsi.h nasm.h nasmlib.h \
188 pptok.h preproc.h regdis.h regs.h sync.h tables.h tokens.h version.h
189 eval.$(O): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h \
190 nasmlib.h pptok.h preproc.h regs.h version.h
191 exprlib.$(O): exprlib.c compiler.h insnsi.h nasm.h nasmlib.h pptok.h \
192 preproc.h regs.h version.h
193 float.$(O): float.c compiler.h float.h insnsi.h nasm.h nasmlib.h pptok.h \
194 preproc.h regs.h version.h
195 hashtbl.$(O): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
196 pptok.h preproc.h regs.h version.h
197 insnsa.$(O): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h \
198 preproc.h regs.h tokens.h version.h
199 insnsb.$(O): insnsb.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h \
200 preproc.h regs.h tokens.h version.h
201 insnsd.$(O): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h \
202 preproc.h regs.h tokens.h version.h
203 insnsn.$(O): insnsn.c compiler.h insnsi.h tables.h
204 labels.$(O): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h pptok.h \
205 preproc.h regs.h version.h
206 lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h
207 lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
208 listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
209 pptok.h preproc.h regs.h version.h
210 macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
211 outform.h pptok.h preproc.h regs.h tables.h version.h
212 nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h \
213 labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \
214 raa.h regs.h saa.h stdscan.h tokens.h version.h
215 nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h \
216 preproc.h regs.h tokens.h version.h
217 ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
218 nasmlib.h pptok.h preproc.h regs.h sync.h tokens.h version.h
219 outform.$(O): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h \
220 pptok.h preproc.h regs.h version.h
221 output/outaout.$(O): output/outaout.c compiler.h insnsi.h nasm.h nasmlib.h \
222 outform.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h version.h
223 output/outas86.$(O): output/outas86.c compiler.h insnsi.h nasm.h nasmlib.h \
224 outform.h pptok.h preproc.h raa.h regs.h saa.h version.h
225 output/outbin.$(O): output/outbin.c compiler.h eval.h insnsi.h labels.h \
226 nasm.h nasmlib.h outform.h pptok.h preproc.h regs.h saa.h stdscan.h \
227 version.h
228 output/outcoff.$(O): output/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \
229 outform.h pptok.h preproc.h raa.h regs.h saa.h version.h
230 output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
231 outform.h pptok.h preproc.h regs.h version.h
232 output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
233 outform.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h version.h
234 output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
235 outform.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h version.h
236 output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
237 outform.h pptok.h preproc.h regs.h version.h
238 output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
239 outform.h pptok.h preproc.h raa.h regs.h saa.h version.h
240 output/outobj.$(O): output/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
241 outform.h pptok.h preproc.h regs.h stdscan.h version.h
242 output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
243 outform.h pptok.h preproc.h regs.h version.h
244 output/outrdf2.$(O): output/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
245 outform.h pptok.h preproc.h rdoff/rdoff.h regs.h saa.h version.h
246 parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
247 parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h version.h
248 pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
249 preproc.$(O): preproc.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
250 pptok.h preproc.h quote.h regs.h stdscan.h tables.h tokens.h version.h
251 quote.$(O): quote.c compiler.h nasmlib.h quote.h
252 raa.$(O): raa.c compiler.h nasmlib.h raa.h
253 regdis.$(O): regdis.c regdis.h regs.h
254 regflags.$(O): regflags.c compiler.h insnsi.h nasm.h nasmlib.h pptok.h \
255 preproc.h regs.h tables.h version.h
256 regs.$(O): regs.c compiler.h insnsi.h tables.h
257 regvals.$(O): regvals.c compiler.h insnsi.h tables.h
258 saa.$(O): saa.c compiler.h nasmlib.h saa.h
259 stdscan.$(O): stdscan.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h \
260 preproc.h quote.h regs.h stdscan.h tokens.h version.h
261 strfunc.$(O): strfunc.c compiler.h insnsi.h nasm.h nasmlib.h pptok.h \
262 preproc.h regs.h version.h
263 sync.$(O): sync.c compiler.h nasmlib.h sync.h
264 tokhash.$(O): tokhash.c compiler.h hashtbl.h insns.h insnsi.h nasm.h \
265 nasmlib.h pptok.h preproc.h regs.h tokens.h version.h