Define a proper hash table library
[nasm/autotest.git] / Makefile.in
blob476b7d8ec29d4dd565fcef86d931e556c98bb95b
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) parser.$(O) outform.$(O) output/outbin.$(O) \
55 output/outaout.$(O) output/outcoff.$(O) \
56 output/outelf32.$(O) output/outelf64.$(O) \
57 output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
58 output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
59 preproc.$(O) pptok.$(O) \
60 listing.$(O) eval.$(O) stdscan.$(O) tokhash.$(O)
62 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
64 all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man
65 cd rdoff && $(MAKE) all
67 nasm$(X): $(NASM)
68 $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(LIBS)
70 ndisasm$(X): $(NDISASM)
71 $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(LIBS)
73 # These source files are automagically generated from a single
74 # instruction-table file by a Perl script. They're distributed,
75 # though, so it isn't necessary to have Perl just to recompile NASM
76 # from the distribution.
78 insnsa.c: insns.dat insns.pl
79 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
80 insnsd.c: insns.dat insns.pl
81 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
82 insnsi.h: insns.dat insns.pl
83 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
84 insnsn.c: insns.dat insns.pl
85 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
87 # These files contains all the standard macros that are derived from
88 # the version number.
89 version.h: version version.pl
90 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
92 version.mac: version version.pl
93 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
95 # This source file is generated from the standard macros file
96 # `standard.mac' by another Perl script. Again, it's part of the
97 # standard distribution.
99 macros.c: macros.pl standard.mac version.mac
100 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.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 regvals.c: regs.dat regs.pl
111 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
112 regs.h: regs.dat regs.pl
113 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
115 # Assembler token hash
116 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
117 $(PERL) $(srcdir)/tokhash.pl $(srcdir)/insns.dat $(srcdir)/regs.dat \
118 $(srcdir)/tokens.dat > tokhash.c
120 # Preprocessor token hash
121 pptok.h: pptok.dat pptok.pl perllib/phash.ph
122 $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
123 pptok.c: pptok.dat pptok.pl perllib/phash.ph
124 $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
126 # This target generates all files that require perl.
127 # This allows easier generation of distribution (see dist target).
128 PERLREQ = macros.c insnsa.c insnsd.c insnsi.h insnsn.c \
129 regs.c regs.h regflags.c regdis.c regvals.c tokhash.c \
130 version.h version.mac pptok.h pptok.c
131 perlreq: $(PERLREQ)
133 install: nasm$(X) ndisasm$(X)
134 $(INSTALL_PROGRAM) nasm$(X) $(INSTALLROOT)$(bindir)/nasm$(X)
135 $(INSTALL_PROGRAM) ndisasm$(X) $(INSTALLROOT)$(bindir)/ndisasm$(X)
136 $(INSTALL_DATA) $(srcdir)/nasm.1 $(INSTALLROOT)$(mandir)/man1/nasm.1
137 $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(INSTALLROOT)$(mandir)/man1/ndisasm.1
139 clean:
140 rm -f *.$(O) *.s *.i
141 rm -f output/*.$(O) output/*.s output/*.i
142 rm -f nasm$(X) ndisasm$(X)
143 cd rdoff && $(MAKE) clean
145 distclean: clean
146 rm -f config.h config.log config.status
147 rm -f Makefile *~ *.bak *.lst *.bin
148 rm -f output/*~ output/*.bak
149 rm -f test/*.lst test/*.bin test/*.$(O) test/*.bin
150 rm -rf autom4te*.cache
151 cd rdoff && $(MAKE) distclean
153 cleaner: clean
154 rm -f $(PERLREQ) *.man nasm.spec
155 cd doc && $(MAKE) clean
157 spotless: distclean cleaner
158 rm -f doc/Makefile doc/*~ doc/*.bak
160 strip:
161 strip --strip-unneeded nasm$(X) ndisasm$(X)
163 rdf:
164 cd rdoff && $(MAKE)
166 rdf_install install_rdf:
167 cd rdoff && $(MAKE) install
169 doc:
170 cd doc && $(MAKE) all
172 doc_install install_doc:
173 cd doc && $(MAKE) install
175 everything: all doc rdf
177 install_everything: everything install install_doc install_rdf
179 dist: spotless perlreq spec
180 autoheader
181 autoconf
182 rm -rf ./autom4te*.cache
184 tar: dist
185 tar -cvj --exclude CVS -C .. -f ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 `basename \`pwd\``
187 spec: nasm.spec
189 nasm.spec: nasm.spec.in version version.pl
190 sed -e s/@@VERSION@@/`cat $(srcdir)/version`/g \
191 < nasm.spec.in > nasm.spec
193 splint:
194 splint -weak *.c
197 # This build dependencies in *ALL* makefiles. Partially for that reason,
198 # it's expected to be invoked manually.
200 alldeps: perlreq
201 $(PERL) mkdep.pl -M Makefile.in Mkfiles/Makefile.* -- \
202 . output
203 ./config.status
205 #-- Magic hints to mkdep.pl --#
206 # @object-ending: ".$(O)"
207 # @path-separator: "/"
208 #-- Everything below is generated by mkdep.pl - do not edit --#
209 assemble.$(O): assemble.c preproc.h insns.h pptok.h regs.h regflags.c \
210 config.h version.h nasmlib.h nasm.h regvals.c insnsi.h assemble.h
211 disasm.$(O): disasm.c insns.h sync.h regdis.c regs.h config.h regs.c \
212 version.h nasm.h insnsn.c names.c insnsi.h disasm.h
213 eval.$(O): eval.c labels.h eval.h regs.h config.h version.h nasmlib.h nasm.h \
214 insnsi.h
215 float.$(O): float.c regs.h config.h version.h nasm.h insnsi.h
216 insnsa.$(O): insnsa.c insns.h regs.h config.h version.h nasm.h insnsi.h
217 insnsd.$(O): insnsd.c insns.h regs.h config.h version.h nasm.h insnsi.h
218 insnsn.$(O): insnsn.c
219 labels.$(O): labels.c regs.h config.h version.h nasmlib.h nasm.h insnsi.h
220 listing.$(O): listing.c regs.h config.h version.h nasmlib.h nasm.h insnsi.h \
221 listing.h
222 macros.$(O): macros.c
223 names.$(O): names.c regs.c insnsn.c
224 nasm.$(O): nasm.c labels.h preproc.h insns.h parser.h eval.h pptok.h regs.h \
225 outform.h config.h version.h nasmlib.h nasm.h stdscan.h assemble.h insnsi.h \
226 listing.h
227 nasmlib.$(O): nasmlib.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
228 insnsi.h
229 ndisasm.$(O): ndisasm.c insns.h sync.h regs.h config.h version.h nasmlib.h \
230 nasm.h insnsi.h disasm.h
231 outform.$(O): outform.c regs.h config.h outform.h version.h nasm.h insnsi.h
232 output/outaout.$(O): output/outaout.c regs.h outform.h config.h version.h \
233 nasmlib.h nasm.h stdscan.h insnsi.h
234 output/outas86.$(O): output/outas86.c regs.h outform.h config.h version.h \
235 nasmlib.h nasm.h insnsi.h
236 output/outbin.$(O): output/outbin.c labels.h eval.h regs.h outform.h \
237 config.h version.h nasmlib.h nasm.h stdscan.h insnsi.h
238 output/outcoff.$(O): output/outcoff.c regs.h outform.h config.h version.h \
239 nasmlib.h nasm.h insnsi.h
240 output/outdbg.$(O): output/outdbg.c regs.h outform.h config.h version.h \
241 nasmlib.h nasm.h insnsi.h
242 output/outelf32.$(O): output/outelf32.c regs.h outform.h config.h version.h \
243 nasmlib.h nasm.h stdscan.h insnsi.h
244 output/outelf64.$(O): output/outelf64.c regs.h outform.h config.h version.h \
245 nasmlib.h nasm.h stdscan.h insnsi.h
246 output/outieee.$(O): output/outieee.c regs.h outform.h config.h version.h \
247 nasmlib.h nasm.h insnsi.h
248 output/outmacho.$(O): output/outmacho.c compiler.h regs.h outform.h config.h \
249 version.h nasmlib.h nasm.h insnsi.h
250 output/outobj.$(O): output/outobj.c regs.h outform.h config.h version.h \
251 nasmlib.h nasm.h stdscan.h insnsi.h
252 output/outrdf.$(O): output/outrdf.c regs.h outform.h config.h version.h \
253 nasmlib.h nasm.h insnsi.h
254 output/outrdf2.$(O): output/outrdf2.c rdoff/rdoff.h regs.h outform.h \
255 config.h version.h nasmlib.h nasm.h insnsi.h
256 parser.$(O): parser.c insns.h parser.h float.h regs.h regflags.c config.h \
257 version.h nasmlib.h nasm.h stdscan.h insnsi.h
258 pptok.$(O): pptok.c preproc.h pptok.h nasmlib.h
259 preproc.$(O): preproc.c preproc.h macros.c pptok.h regs.h config.h version.h \
260 nasmlib.h nasm.h insnsi.h
261 regdis.$(O): regdis.c
262 regflags.$(O): regflags.c
263 regs.$(O): regs.c
264 regvals.$(O): regvals.c
265 stdscan.$(O): stdscan.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
266 stdscan.h insnsi.h
267 sync.$(O): sync.c sync.h
268 tokhash.$(O): tokhash.c insns.h regs.h config.h version.h nasm.h insnsi.h