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