Generate a byte array instead of using strings for the byte codes
[platform/upstream/nasm.git] / Makefile.in
1 #
2 # Auto-configuring Makefile for the Netwide Assembler.
3 #
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.
8
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@
17
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
26
27 XOBJS           = @XOBJS@
28
29 INSTALL         = @INSTALL@
30 INSTALL_PROGRAM = @INSTALL_PROGRAM@
31 INSTALL_DATA    = @INSTALL_DATA@
32
33 NROFF           = @NROFF@
34
35 MKDIR           = mkdir
36 RM              = rm
37
38 STRIP           = strip
39
40 # Binary suffixes
41 O               = @OBJEXT@
42 X               = @EXEEXT@
43
44 .SUFFIXES: .c .i .s .$(O) .1 .man
45
46 .PHONY: all doc rdf install clean distclean cleaner spotless install_rdf
47 .PHONY: install_doc everything install_everything strip perlreq dist
48
49 .c.$(O):
50         $(CC) -c $(ALL_CFLAGS) -o $@ $<
51
52 .c.s:
53         $(CC) -S $(ALL_CFLAGS) -o $@ $<
54
55 .c.i:
56         $(CC) -E $(ALL_CFLAGS) -o $@ $<
57
58 .1.man:
59         $(NROFF) -man $< > $@
60
61 NASM =  nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
62         labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
63         outform.$(O) output/outbin.$(O) \
64         output/outaout.$(O) output/outcoff.$(O) \
65         output/outelf32.$(O) output/outelf64.$(O) \
66         output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
67         output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
68         preproc.$(O) pptok.$(O) \
69         listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O)
70
71 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
72
73 all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man
74         cd rdoff && $(MAKE) all
75
76 nasm$(X): $(NASM) $(XOBJS)
77         $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(XOBJS) $(LIBS)
78
79 ndisasm$(X): $(NDISASM) $(XOBJS)
80         $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(XOBJS) $(LIBS)
81
82 # These source files are automagically generated from a single
83 # instruction-table file by a Perl script. They're distributed,
84 # though, so it isn't necessary to have Perl just to recompile NASM
85 # from the distribution.
86
87 insnsb.c: insns.dat insns.pl
88         $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
89 insnsa.c: insns.dat insns.pl
90         $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
91 insnsd.c: insns.dat insns.pl
92         $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
93 insnsi.h: insns.dat insns.pl
94         $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
95 insnsn.c: insns.dat insns.pl
96         $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
97
98 # These files contains all the standard macros that are derived from
99 # the version number.
100 version.h: version version.pl
101         $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
102
103 version.mac: version version.pl
104         $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
105
106 version.sed: version version.pl
107         $(PERL) $(srcdir)/version.pl sed < $(srcdir)/version > version.sed
108
109 # This source file is generated from the standard macros file
110 # `standard.mac' by another Perl script. Again, it's part of the
111 # standard distribution.
112
113 macros.c: macros.pl standard.mac version.mac
114         $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
115
116 # These source files are generated from regs.dat by yet another
117 # perl script.
118 regs.c: regs.dat regs.pl
119         $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
120 regflags.c: regs.dat regs.pl
121         $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
122 regdis.c: regs.dat regs.pl
123         $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
124 regvals.c: regs.dat regs.pl
125         $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
126 regs.h: regs.dat regs.pl
127         $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
128
129 # Assembler token hash
130 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
131         $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \
132                 $(srcdir)/tokens.dat > tokhash.c
133
134 # Assembler token metadata
135 tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
136         $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \
137                 $(srcdir)/tokens.dat > tokens.h
138
139 # Preprocessor token hash
140 pptok.h: pptok.dat pptok.pl perllib/phash.ph
141         $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
142 pptok.c: pptok.dat pptok.pl perllib/phash.ph
143         $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
144
145 # This target generates all files that require perl.
146 # This allows easier generation of distribution (see dist target).
147 PERLREQ = macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
148           regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h \
149           version.h version.mac pptok.h pptok.c
150 perlreq: $(PERLREQ)
151
152 install: nasm$(X) ndisasm$(X)
153         $(MKDIR) -p $(INSTALLROOT)$(bindir)
154         $(INSTALL_PROGRAM) nasm$(X) $(INSTALLROOT)$(bindir)/nasm$(X)
155         $(INSTALL_PROGRAM) ndisasm$(X) $(INSTALLROOT)$(bindir)/ndisasm$(X)
156         $(MKDIR) -p $(INSTALLROOT)$(mandir)/man1
157         $(INSTALL_DATA) $(srcdir)/nasm.1 $(INSTALLROOT)$(mandir)/man1/nasm.1
158         $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(INSTALLROOT)$(mandir)/man1/ndisasm.1
159
160 clean:
161         $(RM) -f *.$(O) *.s *.i
162         $(RM) -f output/*.$(O) output/*.s output/*.i
163         $(RM) -f nasm$(X) ndisasm$(X)
164         cd rdoff && $(MAKE) clean
165
166 distclean: clean
167         $(RM) -f config.h config.log config.status
168         $(RM) -f Makefile *~ *.bak *.lst *.bin
169         $(RM) -f output/*~ output/*.bak
170         $(RM) -f test/*.lst test/*.bin test/*.$(O) test/*.bin
171         $(RM) -rf autom4te*.cache
172         cd rdoff && $(MAKE) distclean
173
174 cleaner: clean
175         $(RM) -f $(PERLREQ) *.man nasm.spec
176         cd doc && $(MAKE) clean
177
178 spotless: distclean cleaner
179         $(RM) -f doc/Makefile doc/*~ doc/*.bak
180
181 strip:
182         $(STRIP) --strip-unneeded nasm$(X) ndisasm$(X)
183
184 rdf:
185         cd rdoff && $(MAKE)
186
187 rdf_install install_rdf:
188         cd rdoff && $(MAKE) install
189
190 doc:
191         cd doc && $(MAKE) all
192
193 doc_install install_doc:
194         cd doc && $(MAKE) install
195
196 everything: all doc rdf
197
198 install_everything: everything install install_doc install_rdf
199
200 dist: spotless perlreq spec
201         autoheader
202         autoconf
203         $(RM) -rf ./autom4te*.cache
204
205 tar: dist
206         tar -cvj --exclude CVS -C .. -f ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 `basename \`pwd\``
207
208 spec: nasm.spec
209
210 nasm.spec: nasm.spec.in version.sed
211         sed -f version.sed < nasm.spec.in > nasm.spec
212
213 splint:
214         splint -weak *.c
215
216 #
217 # This build dependencies in *ALL* makefiles.  Partially for that reason,
218 # it's expected to be invoked manually.
219 #
220 alldeps: perlreq
221         $(PERL) mkdep.pl -M Makefile.in Mkfiles/*.mak -- \
222                 . output lib
223         ./config.status
224
225 #-- Magic hints to mkdep.pl --#
226 # @object-ending: ".$(O)"
227 # @path-separator: "/"
228 #-- Everything below is generated by mkdep.pl - do not edit --#
229 assemble.$(O): assemble.c assemble.h compiler.h config.h insns.h insnsi.h \
230  nasm.h nasmlib.h pptok.h preproc.h regflags.c regs.h regvals.c tokens.h \
231  version.h
232 crc64.$(O): crc64.c compiler.h config.h
233 disasm.$(O): disasm.c compiler.h config.h disasm.h insns.h insnsi.h insnsn.c \
234  names.c nasm.h nasmlib.h regdis.c regs.c regs.h sync.h tokens.h version.h
235 eval.$(O): eval.c compiler.h config.h eval.h float.h insnsi.h labels.h \
236  nasm.h nasmlib.h regs.h version.h
237 exprlib.$(O): exprlib.c compiler.h config.h insnsi.h nasm.h nasmlib.h regs.h \
238  version.h
239 float.$(O): float.c compiler.h config.h float.h insnsi.h nasm.h nasmlib.h \
240  regs.h version.h
241 hashtbl.$(O): hashtbl.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
242  nasmlib.h regs.h version.h
243 insnsa.$(O): insnsa.c compiler.h config.h insns.h insnsb.c insnsi.h nasm.h \
244  nasmlib.h regs.h tokens.h version.h
245 insnsb.$(O): insnsb.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
246  regs.h tokens.h version.h
247 insnsd.$(O): insnsd.c compiler.h config.h insns.h insnsb.c insnsi.h nasm.h \
248  nasmlib.h regs.h tokens.h version.h
249 insnsn.$(O): insnsn.c
250 labels.$(O): labels.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
251  nasmlib.h regs.h version.h
252 lib/snprintf.$(O): lib/snprintf.c compiler.h config.h nasmlib.h
253 lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h config.h nasmlib.h
254 listing.$(O): listing.c compiler.h config.h insnsi.h listing.h nasm.h \
255  nasmlib.h regs.h version.h
256 macros.$(O): macros.c compiler.h config.h
257 names.$(O): names.c compiler.h config.h insnsn.c regs.c
258 nasm.$(O): nasm.c assemble.h compiler.h config.h eval.h float.h insns.h \
259  insnsi.h labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h \
260  preproc.h regs.h stdscan.h tokens.h version.h
261 nasmlib.$(O): nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h \
262  nasmlib.h regs.h tokens.h version.h
263 ndisasm.$(O): ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
264  nasmlib.h regs.h sync.h tokens.h version.h
265 outform.$(O): outform.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
266  outform.h regs.h version.h
267 output/outaout.$(O): output/outaout.c compiler.h config.h insnsi.h nasm.h \
268  nasmlib.h outform.h regs.h stdscan.h version.h
269 output/outas86.$(O): output/outas86.c compiler.h config.h insnsi.h nasm.h \
270  nasmlib.h outform.h regs.h version.h
271 output/outbin.$(O): output/outbin.c compiler.h config.h eval.h insnsi.h \
272  labels.h nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
273 output/outcoff.$(O): output/outcoff.c compiler.h config.h insnsi.h nasm.h \
274  nasmlib.h outform.h regs.h version.h
275 output/outdbg.$(O): output/outdbg.c compiler.h config.h insnsi.h nasm.h \
276  nasmlib.h outform.h regs.h version.h
277 output/outelf32.$(O): output/outelf32.c compiler.h config.h insnsi.h nasm.h \
278  nasmlib.h outform.h regs.h stdscan.h version.h wsaa.h
279 output/outelf64.$(O): output/outelf64.c compiler.h config.h insnsi.h nasm.h \
280  nasmlib.h outform.h regs.h stdscan.h version.h wsaa.h
281 output/outieee.$(O): output/outieee.c compiler.h config.h insnsi.h nasm.h \
282  nasmlib.h outform.h regs.h version.h
283 output/outmacho.$(O): output/outmacho.c compiler.h config.h insnsi.h nasm.h \
284  nasmlib.h outform.h regs.h version.h
285 output/outobj.$(O): output/outobj.c compiler.h config.h insnsi.h nasm.h \
286  nasmlib.h outform.h regs.h stdscan.h version.h
287 output/outrdf.$(O): output/outrdf.c compiler.h config.h insnsi.h nasm.h \
288  nasmlib.h outform.h regs.h version.h
289 output/outrdf2.$(O): output/outrdf2.c compiler.h config.h insnsi.h nasm.h \
290  nasmlib.h outform.h rdoff/rdoff.h regs.h version.h
291 parser.$(O): parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
292  nasmlib.h parser.h regflags.c regs.h stdscan.h tokens.h version.h
293 pptok.$(O): pptok.c compiler.h config.h hashtbl.h nasmlib.h pptok.h \
294  preproc.h
295 preproc.$(O): preproc.c compiler.h config.h hashtbl.h insnsi.h macros.c \
296  nasm.h nasmlib.h pptok.h preproc.h regs.h stdscan.h tokens.h version.h
297 regdis.$(O): regdis.c
298 regflags.$(O): regflags.c
299 regs.$(O): regs.c compiler.h config.h
300 regvals.$(O): regvals.c
301 stdscan.$(O): stdscan.c compiler.h config.h insns.h insnsi.h nasm.h \
302  nasmlib.h regs.h stdscan.h tokens.h version.h
303 sync.$(O): sync.c compiler.h config.h nasmlib.h sync.h
304 tokhash.$(O): tokhash.c compiler.h config.h hashtbl.h insns.h insnsi.h \
305  nasm.h nasmlib.h regs.h tokens.h version.h