Auto-generate 0x67 prefixes without the need for \30x codes
[nasm/autotest.git] / Makefile.in
blobab8973d420cf0c265772ffbe2eeb0b30267d44be
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 licence given in the file "Licence"
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@
17 CC = @CC@
18 CFLAGS = @CFLAGS@
19 BUILD_CFLAGS = $(CFLAGS) @DEFS@
20 INTERNAL_CFLAGS = -I$(srcdir) -I.
21 ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
22 LDFLAGS = @LDFLAGS@
23 LIBS = @LIBS@
24 PERL = perl -I$(srcdir)/perllib
26 INSTALL = @INSTALL@
27 INSTALL_PROGRAM = @INSTALL_PROGRAM@
28 INSTALL_DATA = @INSTALL_DATA@
30 NROFF = @NROFF@
32 # Binary suffixes
33 O = @OBJEXT@
34 X = @EXEEXT@
36 .SUFFIXES: .c .i .s .$(O) .1 .man
38 .PHONY: all doc rdf install clean distclean cleaner spotless install_rdf
39 .PHONY: install_doc everything install_everything strip perlreq dist
41 .c.$(O):
42 $(CC) -c $(ALL_CFLAGS) -o $@ $<
44 .c.s:
45 $(CC) -S $(ALL_CFLAGS) -o $@ $<
47 .c.i:
48 $(CC) -E $(ALL_CFLAGS) -o $@ $<
50 .1.man:
51 $(NROFF) -man $< > $@
53 NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
54 labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
55 outform.$(O) output/outbin.$(O) \
56 output/outaout.$(O) output/outcoff.$(O) \
57 output/outelf32.$(O) output/outelf64.$(O) \
58 output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
59 output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
60 preproc.$(O) pptok.$(O) \
61 listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O)
63 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
65 all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man
66 cd rdoff && $(MAKE) all
68 nasm$(X): $(NASM)
69 $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(LIBS)
71 ndisasm$(X): $(NDISASM)
72 $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(LIBS)
74 # These source files are automagically generated from a single
75 # instruction-table file by a Perl script. They're distributed,
76 # though, so it isn't necessary to have Perl just to recompile NASM
77 # from the distribution.
79 insnsa.c: insns.dat insns.pl
80 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
81 insnsd.c: insns.dat insns.pl
82 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
83 insnsi.h: insns.dat insns.pl
84 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
85 insnsn.c: insns.dat insns.pl
86 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
88 # These files contains all the standard macros that are derived from
89 # the version number.
90 version.h: version version.pl
91 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
93 version.mac: version version.pl
94 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
96 version.sed: version version.pl
97 $(PERL) $(srcdir)/version.pl sed < $(srcdir)/version > version.sed
99 # This source file is generated from the standard macros file
100 # `standard.mac' by another Perl script. Again, it's part of the
101 # standard distribution.
103 macros.c: macros.pl standard.mac version.mac
104 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
106 # These source files are generated from regs.dat by yet another
107 # perl script.
108 regs.c: regs.dat regs.pl
109 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
110 regflags.c: regs.dat regs.pl
111 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
112 regdis.c: regs.dat regs.pl
113 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
114 regvals.c: regs.dat regs.pl
115 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
116 regs.h: regs.dat regs.pl
117 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
119 # Assembler token hash
120 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
121 $(PERL) $(srcdir)/tokhash.pl $(srcdir)/insns.dat $(srcdir)/regs.dat \
122 $(srcdir)/tokens.dat > tokhash.c
124 # Preprocessor token hash
125 pptok.h: pptok.dat pptok.pl perllib/phash.ph
126 $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
127 pptok.c: pptok.dat pptok.pl perllib/phash.ph
128 $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
130 # This target generates all files that require perl.
131 # This allows easier generation of distribution (see dist target).
132 PERLREQ = macros.c insnsa.c insnsd.c insnsi.h insnsn.c \
133 regs.c regs.h regflags.c regdis.c regvals.c tokhash.c \
134 version.h version.mac pptok.h pptok.c
135 perlreq: $(PERLREQ)
137 install: nasm$(X) ndisasm$(X)
138 $(INSTALL_PROGRAM) nasm$(X) $(INSTALLROOT)$(bindir)/nasm$(X)
139 $(INSTALL_PROGRAM) ndisasm$(X) $(INSTALLROOT)$(bindir)/ndisasm$(X)
140 $(INSTALL_DATA) $(srcdir)/nasm.1 $(INSTALLROOT)$(mandir)/man1/nasm.1
141 $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(INSTALLROOT)$(mandir)/man1/ndisasm.1
143 clean:
144 rm -f *.$(O) *.s *.i
145 rm -f output/*.$(O) output/*.s output/*.i
146 rm -f nasm$(X) ndisasm$(X)
147 cd rdoff && $(MAKE) clean
149 distclean: clean
150 rm -f config.h config.log config.status
151 rm -f Makefile *~ *.bak *.lst *.bin
152 rm -f output/*~ output/*.bak
153 rm -f test/*.lst test/*.bin test/*.$(O) test/*.bin
154 rm -rf autom4te*.cache
155 cd rdoff && $(MAKE) distclean
157 cleaner: clean
158 rm -f $(PERLREQ) *.man nasm.spec
159 cd doc && $(MAKE) clean
161 spotless: distclean cleaner
162 rm -f doc/Makefile doc/*~ doc/*.bak
164 strip:
165 strip --strip-unneeded nasm$(X) ndisasm$(X)
167 rdf:
168 cd rdoff && $(MAKE)
170 rdf_install install_rdf:
171 cd rdoff && $(MAKE) install
173 doc:
174 cd doc && $(MAKE) all
176 doc_install install_doc:
177 cd doc && $(MAKE) install
179 everything: all doc rdf
181 install_everything: everything install install_doc install_rdf
183 dist: spotless perlreq spec
184 autoheader
185 autoconf
186 rm -rf ./autom4te*.cache
188 tar: dist
189 tar -cvj --exclude CVS -C .. -f ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 `basename \`pwd\``
191 spec: nasm.spec
193 nasm.spec: nasm.spec.in version.sed
194 sed -f version.sed < nasm.spec.in > nasm.spec
196 splint:
197 splint -weak *.c
200 # This build dependencies in *ALL* makefiles. Partially for that reason,
201 # it's expected to be invoked manually.
203 alldeps: perlreq
204 $(PERL) mkdep.pl -M Makefile.in Mkfiles/*.mak -- \
205 . output
206 ./config.status
208 #-- Magic hints to mkdep.pl --#
209 # @object-ending: ".$(O)"
210 # @path-separator: "/"
211 #-- Everything below is generated by mkdep.pl - do not edit --#
212 assemble.$(O): assemble.c assemble.h compiler.h config.h insns.h insnsi.h \
213 nasm.h nasmlib.h pptok.h preproc.h regflags.c regs.h regvals.c version.h
214 crc64.$(O): crc64.c
215 disasm.$(O): disasm.c compiler.h config.h disasm.h insns.h insnsi.h insnsn.c \
216 names.c nasm.h nasmlib.h regdis.c regs.c regs.h sync.h version.h
217 eval.$(O): eval.c compiler.h config.h eval.h insnsi.h labels.h nasm.h \
218 nasmlib.h regs.h version.h
219 exprlib.$(O): exprlib.c compiler.h config.h insnsi.h nasm.h nasmlib.h regs.h \
220 version.h
221 float.$(O): float.c compiler.h config.h insnsi.h nasm.h nasmlib.h regs.h \
222 version.h
223 hashtbl.$(O): hashtbl.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
224 nasmlib.h regs.h version.h
225 insnsa.$(O): insnsa.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
226 regs.h version.h
227 insnsd.$(O): insnsd.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
228 regs.h version.h
229 insnsn.$(O): insnsn.c
230 labels.$(O): labels.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
231 nasmlib.h regs.h version.h
232 listing.$(O): listing.c compiler.h config.h insnsi.h listing.h nasm.h \
233 nasmlib.h regs.h version.h
234 macros.$(O): macros.c
235 names.$(O): names.c insnsn.c regs.c
236 nasm.$(O): nasm.c assemble.h compiler.h config.h eval.h insns.h insnsi.h \
237 labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \
238 regs.h stdscan.h version.h
239 nasmlib.$(O): nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h \
240 nasmlib.h regs.h version.h
241 ndisasm.$(O): ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
242 nasmlib.h regs.h sync.h version.h
243 outform.$(O): outform.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
244 outform.h regs.h version.h
245 output/outaout.$(O): output/outaout.c compiler.h config.h insnsi.h nasm.h \
246 nasmlib.h outform.h regs.h stdscan.h version.h
247 output/outas86.$(O): output/outas86.c compiler.h config.h insnsi.h nasm.h \
248 nasmlib.h outform.h regs.h version.h
249 output/outbin.$(O): output/outbin.c compiler.h config.h eval.h insnsi.h \
250 labels.h nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
251 output/outcoff.$(O): output/outcoff.c compiler.h config.h insnsi.h nasm.h \
252 nasmlib.h outform.h regs.h version.h
253 output/outdbg.$(O): output/outdbg.c compiler.h config.h insnsi.h nasm.h \
254 nasmlib.h outform.h regs.h version.h
255 output/outelf32.$(O): output/outelf32.c compiler.h config.h insnsi.h nasm.h \
256 nasmlib.h outform.h regs.h stdscan.h version.h
257 output/outelf64.$(O): output/outelf64.c compiler.h config.h insnsi.h nasm.h \
258 nasmlib.h outform.h regs.h stdscan.h version.h
259 output/outieee.$(O): output/outieee.c compiler.h config.h insnsi.h nasm.h \
260 nasmlib.h outform.h regs.h version.h
261 output/outmacho.$(O): output/outmacho.c compiler.h config.h insnsi.h nasm.h \
262 nasmlib.h outform.h regs.h version.h
263 output/outobj.$(O): output/outobj.c compiler.h config.h insnsi.h nasm.h \
264 nasmlib.h outform.h regs.h stdscan.h version.h
265 output/outrdf.$(O): output/outrdf.c compiler.h config.h insnsi.h nasm.h \
266 nasmlib.h outform.h regs.h version.h
267 output/outrdf2.$(O): output/outrdf2.c compiler.h config.h insnsi.h nasm.h \
268 nasmlib.h outform.h rdoff/rdoff.h regs.h version.h
269 parser.$(O): parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
270 nasmlib.h parser.h regflags.c regs.h stdscan.h version.h
271 pptok.$(O): pptok.c compiler.h config.h nasmlib.h pptok.h preproc.h
272 preproc.$(O): preproc.c compiler.h config.h hashtbl.h insnsi.h macros.c \
273 nasm.h nasmlib.h pptok.h preproc.h regs.h version.h
274 regdis.$(O): regdis.c
275 regflags.$(O): regflags.c
276 regs.$(O): regs.c
277 regvals.$(O): regvals.c
278 stdscan.$(O): stdscan.c compiler.h config.h insns.h insnsi.h nasm.h \
279 nasmlib.h regs.h stdscan.h version.h
280 sync.$(O): sync.c compiler.h config.h nasmlib.h sync.h
281 tokhash.$(O): tokhash.c compiler.h config.h insns.h insnsi.h nasm.h \
282 nasmlib.h regs.h version.h