Backport the syncfiles script to the nasm-2.03.x branch
[nasm/perl-rewrite.git] / Makefile.in
blob645c9478bfac4f1e5089a18e3dbd01554af8c779
2 # Auto-configuring Makefile for the Netwide Assembler.
4 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
5 # Julian Hall. All rights reserved. The software is
6 # redistributable under the license given in the file "LICENSE"
7 # distributed in the NASM archive.
9 top_srcdir = @top_srcdir@
10 srcdir = @srcdir@
11 VPATH = @srcdir@
12 prefix = @prefix@
13 exec_prefix = @exec_prefix@
14 bindir = @bindir@
15 mandir = @mandir@
16 datarootdir = @datarootdir@
18 CC = @CC@
19 CFLAGS = @CFLAGS@
20 BUILD_CFLAGS = $(CFLAGS) @DEFS@
21 INTERNAL_CFLAGS = -I$(srcdir) -I.
22 ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
23 LDFLAGS = @LDFLAGS@
24 LIBS = @LIBS@
25 PERL = perl -I$(srcdir)/perllib
27 XOBJS = @XOBJS@
29 INSTALL = @INSTALL@
30 INSTALL_PROGRAM = @INSTALL_PROGRAM@
31 INSTALL_DATA = @INSTALL_DATA@
33 NROFF = @NROFF@
35 MKDIR = mkdir
36 RM = rm
38 STRIP = strip
40 # Binary suffixes
41 O = @OBJEXT@
42 X = @EXEEXT@
44 .SUFFIXES: .c .i .s .$(O) .1 .man
46 .PHONY: all doc rdf install clean distclean cleaner spotless install_rdf
47 .PHONY: install_doc everything install_everything strip perlreq dist
49 .c.$(O):
50 $(CC) -c $(ALL_CFLAGS) -o $@ $<
52 .c.s:
53 $(CC) -S $(ALL_CFLAGS) -o $@ $<
55 .c.i:
56 $(CC) -E $(ALL_CFLAGS) -o $@ $<
58 .1.man:
59 $(NROFF) -man $< > $@
61 #-- Begin File Lists --#
62 NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) insnsb.$(O) \
63 assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
64 outform.$(O) output/outbin.$(O) \
65 output/outaout.$(O) output/outcoff.$(O) \
66 output/outelf32.$(O) output/outelf64.$(O) \
67 output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
68 output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
69 preproc.$(O) quote.$(O) pptok.$(O) macros.$(O) \
70 listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O) \
71 regvals.$(O) regflags.$(O)
73 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) \
74 insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
75 #-- End File Lists --#
77 all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man
78 cd rdoff && $(MAKE) all
80 nasm$(X): $(NASM) $(XOBJS)
81 $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(XOBJS) $(LIBS)
83 ndisasm$(X): $(NDISASM) $(XOBJS)
84 $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(XOBJS) $(LIBS)
86 # These source files are automagically generated from a single
87 # instruction-table file by a Perl script. They're distributed,
88 # though, so it isn't necessary to have Perl just to recompile NASM
89 # from the distribution.
91 insnsb.c: insns.dat insns.pl
92 $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
93 insnsa.c: insns.dat insns.pl
94 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
95 insnsd.c: insns.dat insns.pl
96 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
97 insnsi.h: insns.dat insns.pl
98 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
99 insnsn.c: insns.dat insns.pl
100 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
102 # These files contains all the standard macros that are derived from
103 # the version number.
104 version.h: version version.pl
105 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
107 version.mac: version version.pl
108 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
110 version.sed: version version.pl
111 $(PERL) $(srcdir)/version.pl sed < $(srcdir)/version > version.sed
113 # This source file is generated from the standard macros file
114 # `standard.mac' by another Perl script. Again, it's part of the
115 # standard distribution.
117 macros.c: macros.pl standard.mac version.mac
118 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
120 # These source files are generated from regs.dat by yet another
121 # perl script.
122 regs.c: regs.dat regs.pl
123 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
124 regflags.c: regs.dat regs.pl
125 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
126 regdis.c: regs.dat regs.pl
127 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
128 regdis.h: regs.dat regs.pl
129 $(PERL) $(srcdir)/regs.pl dh $(srcdir)/regs.dat > regdis.h
130 regvals.c: regs.dat regs.pl
131 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
132 regs.h: regs.dat regs.pl
133 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
135 # Assembler token hash
136 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
137 $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \
138 $(srcdir)/tokens.dat > tokhash.c
140 # Assembler token metadata
141 tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
142 $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \
143 $(srcdir)/tokens.dat > tokens.h
145 # Preprocessor token hash
146 pptok.h: pptok.dat pptok.pl perllib/phash.ph
147 $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
148 pptok.c: pptok.dat pptok.pl perllib/phash.ph
149 $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
151 # This target generates all files that require perl.
152 # This allows easier generation of distribution (see dist target).
153 PERLREQ = macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
154 regs.c regs.h regflags.c regdis.c regdis.h regvals.c \
155 tokhash.c tokens.h pptok.h pptok.c \
156 version.h version.mac
157 perlreq: $(PERLREQ)
159 install: nasm$(X) ndisasm$(X)
160 $(MKDIR) -p $(INSTALLROOT)$(bindir)
161 $(INSTALL_PROGRAM) nasm$(X) $(INSTALLROOT)$(bindir)/nasm$(X)
162 $(INSTALL_PROGRAM) ndisasm$(X) $(INSTALLROOT)$(bindir)/ndisasm$(X)
163 $(MKDIR) -p $(INSTALLROOT)$(mandir)/man1
164 $(INSTALL_DATA) $(srcdir)/nasm.1 $(INSTALLROOT)$(mandir)/man1/nasm.1
165 $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(INSTALLROOT)$(mandir)/man1/ndisasm.1
167 clean:
168 $(RM) -f *.$(O) *.s *.i
169 $(RM) -f output/*.$(O) output/*.s output/*.i
170 $(RM) -f nasm$(X) ndisasm$(X)
171 cd rdoff && $(MAKE) clean
173 distclean: clean
174 $(RM) -f config.h config.log config.status
175 $(RM) -f Makefile *~ *.bak *.lst *.bin
176 $(RM) -f output/*~ output/*.bak
177 $(RM) -f test/*.lst test/*.bin test/*.$(O) test/*.bin
178 $(RM) -rf autom4te*.cache
179 cd rdoff && $(MAKE) distclean
181 cleaner: clean
182 $(RM) -f $(PERLREQ) *.man nasm.spec
183 cd doc && $(MAKE) clean
185 spotless: distclean cleaner
186 $(RM) -f doc/Makefile doc/*~ doc/*.bak
188 strip:
189 $(STRIP) --strip-unneeded nasm$(X) ndisasm$(X)
191 rdf:
192 cd rdoff && $(MAKE)
194 rdf_install install_rdf:
195 cd rdoff && $(MAKE) install
197 doc:
198 cd doc && $(MAKE) all
200 doc_install install_doc:
201 cd doc && $(MAKE) install
203 everything: all doc rdf
205 install_everything: everything install install_doc install_rdf
207 dist: spotless perlreq spec
208 autoheader
209 autoconf
210 $(RM) -rf ./autom4te*.cache
212 tar: dist
213 tar -cvj --exclude CVS -C .. -f ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 `basename \`pwd\``
215 spec: nasm.spec
217 nasm.spec: nasm.spec.in version.sed
218 sed -f version.sed < nasm.spec.in > nasm.spec
220 splint:
221 splint -weak *.c
224 # This build dependencies in *ALL* makefiles. Partially for that reason,
225 # it's expected to be invoked manually.
227 alldeps: perlreq
228 $(PERL) syncfiles.pl Makefile.in Mkfiles/*.mak
229 $(PERL) mkdep.pl -M Makefile.in Mkfiles/*.mak -- \
230 . output lib
231 ./config.status
233 #-- Magic hints to mkdep.pl --#
234 # @object-ending: ".$(O)"
235 # @path-separator: "/"
236 #-- Everything below is generated by mkdep.pl - do not edit --#
237 assemble.$(O): assemble.c assemble.h compiler.h config.h insns.h insnsi.h \
238 nasm.h nasmlib.h regs.h tables.h tokens.h version.h
239 crc64.$(O): crc64.c compiler.h config.h
240 disasm.$(O): disasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
241 nasmlib.h regdis.h regs.h sync.h tables.h tokens.h version.h
242 eval.$(O): eval.c compiler.h config.h eval.h float.h insnsi.h labels.h \
243 nasm.h nasmlib.h regs.h version.h
244 exprlib.$(O): exprlib.c compiler.h config.h insnsi.h nasm.h nasmlib.h regs.h \
245 version.h
246 float.$(O): float.c compiler.h config.h float.h insnsi.h nasm.h nasmlib.h \
247 regs.h version.h
248 hashtbl.$(O): hashtbl.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
249 nasmlib.h regs.h version.h
250 insnsa.$(O): insnsa.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
251 regs.h tokens.h version.h
252 insnsb.$(O): insnsb.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
253 regs.h tokens.h version.h
254 insnsd.$(O): insnsd.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
255 regs.h tokens.h version.h
256 insnsn.$(O): insnsn.c compiler.h config.h insnsi.h tables.h
257 labels.$(O): labels.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
258 nasmlib.h regs.h version.h
259 lib/snprintf.$(O): lib/snprintf.c compiler.h config.h nasmlib.h
260 lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h config.h nasmlib.h
261 listing.$(O): listing.c compiler.h config.h insnsi.h listing.h nasm.h \
262 nasmlib.h regs.h version.h
263 macros.$(O): macros.c compiler.h config.h insnsi.h tables.h
264 nasm.$(O): nasm.c assemble.h compiler.h config.h eval.h float.h insns.h \
265 insnsi.h labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h \
266 preproc.h regs.h stdscan.h tokens.h version.h
267 nasmlib.$(O): nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h \
268 nasmlib.h regs.h tokens.h version.h
269 ndisasm.$(O): ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
270 nasmlib.h regs.h sync.h tokens.h version.h
271 outform.$(O): outform.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
272 outform.h regs.h version.h
273 output/outaout.$(O): output/outaout.c compiler.h config.h insnsi.h nasm.h \
274 nasmlib.h outform.h regs.h stdscan.h version.h
275 output/outas86.$(O): output/outas86.c compiler.h config.h insnsi.h nasm.h \
276 nasmlib.h outform.h regs.h version.h
277 output/outbin.$(O): output/outbin.c compiler.h config.h eval.h insnsi.h \
278 labels.h nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
279 output/outcoff.$(O): output/outcoff.c compiler.h config.h insnsi.h nasm.h \
280 nasmlib.h outform.h regs.h version.h
281 output/outdbg.$(O): output/outdbg.c compiler.h config.h insnsi.h nasm.h \
282 nasmlib.h outform.h regs.h version.h
283 output/outelf32.$(O): output/outelf32.c compiler.h config.h insnsi.h nasm.h \
284 nasmlib.h outform.h regs.h stdscan.h version.h wsaa.h
285 output/outelf64.$(O): output/outelf64.c compiler.h config.h insnsi.h nasm.h \
286 nasmlib.h outform.h regs.h stdscan.h version.h wsaa.h
287 output/outieee.$(O): output/outieee.c compiler.h config.h insnsi.h nasm.h \
288 nasmlib.h outform.h regs.h version.h
289 output/outmacho.$(O): output/outmacho.c compiler.h config.h insnsi.h nasm.h \
290 nasmlib.h outform.h regs.h version.h
291 output/outobj.$(O): output/outobj.c compiler.h config.h insnsi.h nasm.h \
292 nasmlib.h outform.h regs.h stdscan.h version.h
293 output/outrdf.$(O): output/outrdf.c compiler.h config.h insnsi.h nasm.h \
294 nasmlib.h outform.h regs.h version.h
295 output/outrdf2.$(O): output/outrdf2.c compiler.h config.h insnsi.h nasm.h \
296 nasmlib.h outform.h rdoff/rdoff.h regs.h version.h
297 parser.$(O): parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
298 nasmlib.h parser.h regs.h stdscan.h tables.h tokens.h version.h
299 pptok.$(O): pptok.c compiler.h config.h hashtbl.h nasmlib.h pptok.h \
300 preproc.h
301 preproc.$(O): preproc.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
302 nasmlib.h pptok.h preproc.h quote.h regs.h stdscan.h tables.h tokens.h \
303 version.h
304 quote.$(O): quote.c compiler.h config.h nasmlib.h quote.h
305 regdis.$(O): regdis.c regdis.h regs.h
306 regflags.$(O): regflags.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
307 regs.h tables.h version.h
308 regs.$(O): regs.c compiler.h config.h insnsi.h tables.h
309 regvals.$(O): regvals.c compiler.h config.h insnsi.h tables.h
310 stdscan.$(O): stdscan.c compiler.h config.h insns.h insnsi.h nasm.h \
311 nasmlib.h quote.h regs.h stdscan.h tokens.h version.h
312 sync.$(O): sync.c compiler.h config.h nasmlib.h sync.h
313 tokhash.$(O): tokhash.c compiler.h config.h hashtbl.h insns.h insnsi.h \
314 nasm.h nasmlib.h regs.h tokens.h version.h