doc: changes -- Add fixes for VMOVNTDQA, MOVNTDQA, MOVLPD
[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 ASCIIDOC        = @ASCIIDOC@
35 XMLTO           = @XMLTO@
36
37 MKDIR           = mkdir
38 RM              = rm
39
40 STRIP           = strip
41 FIND            = find
42
43 # Binary suffixes
44 O               = @OBJEXT@
45 X               = @EXEEXT@
46
47 # Debug stuff
48 ifeq ($(TRACE),1)
49         CFLAGS += -DNASM_TRACE
50 endif
51
52 .SUFFIXES: .c .i .s .$(O) .1 .txt .xml
53
54 .PHONY: all doc rdf install clean distclean cleaner spotless install_rdf test
55 .PHONY: install_doc everything install_everything strip perlreq dist tags TAGS
56
57 .c.$(O):
58         $(CC) -c $(ALL_CFLAGS) -o $@ $<
59
60 .c.s:
61         $(CC) -S $(ALL_CFLAGS) -o $@ $<
62
63 .c.i:
64         $(CC) -E $(ALL_CFLAGS) -o $@ $<
65
66 .txt.xml:
67         $(ASCIIDOC) -b docbook -d manpage -o $@ $<
68
69 .xml.1:
70         $(XMLTO) man --skip-validation $< 2>/dev/null
71
72
73 #-- Begin File Lists --#
74 NASM =  nasm.$(O) nasmlib.$(O) ver.$(O) \
75         raa.$(O) saa.$(O) rbtree.$(O) \
76         float.$(O) insnsa.$(O) insnsb.$(O) \
77         directiv.$(O) \
78         assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
79         output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \
80         output/nullout.$(O) \
81         output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
82         output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
83         output/outelfx32.$(O) \
84         output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
85         output/outdbg.$(O) output/outieee.$(O) output/outmac32.$(O) \
86         output/outmac64.$(O) preproc.$(O) quote.$(O) pptok.$(O) \
87         macros.$(O) listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) \
88         strfunc.$(O) tokhash.$(O) regvals.$(O) regflags.$(O) \
89         ilog2.$(O) \
90         lib/strlcpy.$(O) \
91         preproc-nop.$(O)
92
93 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \
94         insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
95 #-- End File Lists --#
96
97 all: nasm$(X) ndisasm$(X) nasm.1 ndisasm.1 rdf
98
99 nasm$(X): $(NASM) $(XOBJS)
100         $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(XOBJS) $(LIBS)
101
102 ndisasm$(X): $(NDISASM) $(XOBJS)
103         $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(XOBJS) $(LIBS)
104
105 # These source files are automagically generated from a single
106 # instruction-table file by a Perl script. They're distributed,
107 # though, so it isn't necessary to have Perl just to recompile NASM
108 # from the distribution.
109
110 insnsb.c: insns.dat insns.pl
111         $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
112 insnsa.c: insns.dat insns.pl
113         $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
114 insnsd.c: insns.dat insns.pl
115         $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
116 insnsi.h: insns.dat insns.pl
117         $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
118 insnsn.c: insns.dat insns.pl
119         $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
120
121 # These files contains all the standard macros that are derived from
122 # the version number.
123 version.h: version version.pl
124         $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
125 version.mac: version version.pl
126         $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
127 version.sed: version version.pl
128         $(PERL) $(srcdir)/version.pl sed < $(srcdir)/version > version.sed
129 version.mak: version version.pl
130         $(PERL) $(srcdir)/version.pl make < $(srcdir)/version > version.mak
131 version.nsh: version version.pl
132         $(PERL) $(srcdir)/version.pl nsis < $(srcdir)/version > version.nsh
133
134 # This source file is generated from the standard macros file
135 # `standard.mac' by another Perl script. Again, it's part of the
136 # standard distribution.
137 macros.c: macros.pl pptok.ph standard.mac version.mac \
138         $(srcdir)/macros/*.mac $(srcdir)/output/*.mac
139         $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac \
140                 $(srcdir)/macros/*.mac $(srcdir)/output/*.mac
141
142 # These source files are generated from regs.dat by yet another
143 # perl script.
144 regs.c: regs.dat regs.pl
145         $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
146 regflags.c: regs.dat regs.pl
147         $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
148 regdis.c: regs.dat regs.pl
149         $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
150 regdis.h: regs.dat regs.pl
151         $(PERL) $(srcdir)/regs.pl dh $(srcdir)/regs.dat > regdis.h
152 regvals.c: regs.dat regs.pl
153         $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
154 regs.h: regs.dat regs.pl
155         $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
156
157 # Assembler token hash
158 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
159         $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \
160                 $(srcdir)/tokens.dat > tokhash.c
161
162 # Assembler token metadata
163 tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
164         $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \
165                 $(srcdir)/tokens.dat > tokens.h
166
167 # Preprocessor token hash
168 pptok.h: pptok.dat pptok.pl perllib/phash.ph
169         $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
170 pptok.c: pptok.dat pptok.pl perllib/phash.ph
171         $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
172 pptok.ph: pptok.dat pptok.pl perllib/phash.ph
173         $(PERL) $(srcdir)/pptok.pl ph $(srcdir)/pptok.dat pptok.ph
174
175 # Directives hash
176 directiv.h: directiv.dat directiv.pl perllib/phash.ph
177         $(PERL) $(srcdir)/directiv.pl h $(srcdir)/directiv.dat directiv.h
178 directiv.c: directiv.dat directiv.pl perllib/phash.ph
179         $(PERL) $(srcdir)/directiv.pl c $(srcdir)/directiv.dat directiv.c
180
181 # This target generates all files that require perl.
182 # This allows easier generation of distribution (see dist target).
183 PERLREQ = macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
184           regs.c regs.h regflags.c regdis.c regdis.h regvals.c \
185           tokhash.c tokens.h pptok.h pptok.c pptok.ph \
186           directiv.c directiv.h \
187           version.h version.mac version.mak version.nsh
188 perlreq: $(PERLREQ)
189
190 install: nasm$(X) ndisasm$(X)
191         $(MKDIR) -p $(INSTALLROOT)$(bindir)
192         $(INSTALL_PROGRAM) nasm$(X) $(INSTALLROOT)$(bindir)/nasm$(X)
193         $(INSTALL_PROGRAM) ndisasm$(X) $(INSTALLROOT)$(bindir)/ndisasm$(X)
194         $(MKDIR) -p $(INSTALLROOT)$(mandir)/man1
195         $(INSTALL_DATA) $(srcdir)/nasm.1 $(INSTALLROOT)$(mandir)/man1/nasm.1
196         $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(INSTALLROOT)$(mandir)/man1/ndisasm.1
197
198 clean:
199         $(RM) -f *.$(O) *.s *.i
200         $(RM) -f lib/*.$(O) lib/*.s lib/*.i
201         $(RM) -f output/*.$(O) output/*.s output/*.i
202         $(RM) -f nasm$(X) ndisasm$(X)
203         $(RM) -f tags TAGS
204         cd rdoff && $(MAKE) clean
205
206 distclean: clean
207         $(RM) -f config.h config.log config.status
208         $(RM) -f Makefile *~ *.bak *.lst *.bin
209         $(RM) -f output/*~ output/*.bak
210         $(RM) -f test/*.lst test/*.bin test/*.$(O) test/*.bin
211         $(RM) -rf autom4te*.cache
212         cd rdoff && $(MAKE) distclean
213
214 cleaner: clean
215         $(RM) -f $(PERLREQ) *.1 nasm.spec
216         cd doc && $(MAKE) clean
217
218 spotless: distclean cleaner
219         $(RM) -f doc/Makefile doc/*~ doc/*.bak
220
221 strip:
222         $(STRIP) --strip-unneeded nasm$(X) ndisasm$(X)
223
224 rdf: nasmlib.$(O)
225         cd rdoff && $(MAKE) all
226
227 TAGS:
228         $(RM) -f TAGS
229         $(FIND) . -name '*.[hcS]' -print | xargs etags -a
230
231 tags:
232         $(RM) -f tags
233         $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
234
235 cscope:
236         $(RM) -f cscope.out cscope.files
237         $(FIND) . -name '*.[hcS]' -print > cscope.files
238         cscope -b -f cscope.out
239
240 rdf_install install_rdf:
241         cd rdoff && $(MAKE) install
242
243 doc:
244         cd doc && $(MAKE) all
245
246 doc_install install_doc:
247         cd doc && $(MAKE) install
248
249 everything: all doc rdf
250
251 install_everything: everything install install_doc install_rdf
252
253 dist: spotless perlreq spec
254         autoheader
255         autoconf
256         $(RM) -rf ./autom4te*.cache
257
258 tar: dist
259         tar -cvj --exclude CVS -C .. -f ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 `basename \`pwd\``
260
261 spec: nasm.spec
262
263 nasm.spec: nasm.spec.in version.sed
264         sed -f version.sed < nasm.spec.in > nasm.spec
265
266 splint:
267         splint -weak *.c
268
269 test: nasm$(X)
270         cd test && $(PERL) performtest.pl --nasm=../nasm *.asm
271
272 #
273 # This build dependencies in *ALL* makefiles.  Partially for that reason,
274 # it's expected to be invoked manually.
275 #
276 alldeps: perlreq
277         $(PERL) syncfiles.pl Makefile.in Mkfiles/*.mak
278         $(PERL) mkdep.pl -M Makefile.in Mkfiles/*.mak -- \
279                 . output lib
280         ./config.status
281
282 #-- Magic hints to mkdep.pl --#
283 # @object-ending: ".$(O)"
284 # @path-separator: "/"
285 #-- Everything below is generated by mkdep.pl - do not edit --#
286 assemble.$(O): assemble.c assemble.h compiler.h config.h directiv.h insns.h \
287  insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h \
288  tokens.h
289 crc64.$(O): crc64.c compiler.h config.h nasmlib.h
290 directiv.$(O): directiv.c compiler.h config.h directiv.h hashtbl.h insnsi.h \
291  nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
292 disasm.$(O): disasm.c compiler.h config.h directiv.h disasm.h insns.h \
293  insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h \
294  sync.h tables.h tokens.h
295 eval.$(O): eval.c compiler.h config.h directiv.h eval.h float.h insnsi.h \
296  labels.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
297 exprlib.$(O): exprlib.c compiler.h config.h directiv.h insnsi.h nasm.h \
298  nasmlib.h opflags.h pptok.h preproc.h regs.h
299 float.$(O): float.c compiler.h config.h directiv.h float.h insnsi.h nasm.h \
300  nasmlib.h opflags.h pptok.h preproc.h regs.h
301 hashtbl.$(O): hashtbl.c compiler.h config.h directiv.h hashtbl.h insnsi.h \
302  nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
303 ilog2.$(O): ilog2.c compiler.h config.h nasmlib.h
304 insnsa.$(O): insnsa.c compiler.h config.h directiv.h insns.h insnsi.h nasm.h \
305  nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
306 insnsb.$(O): insnsb.c compiler.h config.h directiv.h insns.h insnsi.h nasm.h \
307  nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
308 insnsd.$(O): insnsd.c compiler.h config.h directiv.h insns.h insnsi.h nasm.h \
309  nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
310 insnsn.$(O): insnsn.c compiler.h config.h insnsi.h opflags.h tables.h
311 labels.$(O): labels.c compiler.h config.h directiv.h hashtbl.h insnsi.h \
312  nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
313 lib/snprintf.$(O): lib/snprintf.c compiler.h config.h nasmlib.h
314 lib/strlcpy.$(O): lib/strlcpy.c compiler.h config.h
315 lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h config.h nasmlib.h
316 listing.$(O): listing.c compiler.h config.h directiv.h insnsi.h listing.h \
317  nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
318 macros.$(O): macros.c compiler.h config.h directiv.h hashtbl.h insnsi.h \
319  nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h \
320  tables.h
321 nasm.$(O): nasm.c assemble.h compiler.h config.h directiv.h eval.h float.h \
322  insns.h insnsi.h labels.h listing.h nasm.h nasmlib.h opflags.h \
323  output/outform.h parser.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h \
324  tokens.h
325 nasmlib.$(O): nasmlib.c compiler.h config.h directiv.h insns.h insnsi.h \
326  nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
327 ndisasm.$(O): ndisasm.c compiler.h config.h directiv.h disasm.h insns.h \
328  insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h \
329  tokens.h
330 output/nulldbg.$(O): output/nulldbg.c compiler.h config.h directiv.h \
331  insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
332 output/nullout.$(O): output/nullout.c compiler.h config.h directiv.h \
333  insnsi.h nasm.h nasmlib.h opflags.h output/outlib.h pptok.h preproc.h \
334  regs.h
335 output/outaout.$(O): output/outaout.c compiler.h config.h directiv.h eval.h \
336  insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
337  pptok.h preproc.h raa.h regs.h saa.h stdscan.h
338 output/outas86.$(O): output/outas86.c compiler.h config.h directiv.h \
339  insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
340  pptok.h preproc.h raa.h regs.h saa.h
341 output/outbin.$(O): output/outbin.c compiler.h config.h directiv.h eval.h \
342  insnsi.h labels.h nasm.h nasmlib.h opflags.h output/outform.h \
343  output/outlib.h pptok.h preproc.h regs.h saa.h stdscan.h
344 output/outcoff.$(O): output/outcoff.c compiler.h config.h directiv.h eval.h \
345  insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
346  output/pecoff.h pptok.h preproc.h raa.h regs.h saa.h
347 output/outdbg.$(O): output/outdbg.c compiler.h config.h directiv.h insnsi.h \
348  nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
349 output/outelf.$(O): output/outelf.c compiler.h config.h directiv.h insnsi.h \
350  nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h output/outelf.h \
351  output/outform.h pptok.h preproc.h regs.h
352 output/outelf32.$(O): output/outelf32.c compiler.h config.h directiv.h \
353  eval.h insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
354  output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
355  preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
356 output/outelf64.$(O): output/outelf64.c compiler.h config.h directiv.h \
357  eval.h insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
358  output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
359  preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
360 output/outelfx32.$(O): output/outelfx32.c compiler.h config.h directiv.h \
361  eval.h insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
362  output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
363  preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
364 output/outform.$(O): output/outform.c compiler.h config.h directiv.h \
365  insnsi.h nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h \
366  regs.h
367 output/outieee.$(O): output/outieee.c compiler.h config.h directiv.h \
368  insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
369  pptok.h preproc.h regs.h
370 output/outlib.$(O): output/outlib.c compiler.h config.h directiv.h insnsi.h \
371  nasm.h nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h
372 output/outmac32.$(O): output/outmac32.c compiler.h config.h directiv.h \
373  eval.h insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
374  pptok.h preproc.h raa.h regs.h saa.h
375 output/outmac64.$(O): output/outmac64.c compiler.h config.h directiv.h \
376  insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
377  pptok.h preproc.h raa.h regs.h saa.h
378 output/outobj.$(O): output/outobj.c compiler.h config.h directiv.h eval.h \
379  insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
380  pptok.h preproc.h regs.h stdscan.h
381 output/outrdf2.$(O): output/outrdf2.c compiler.h config.h directiv.h \
382  insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \
383  pptok.h preproc.h rdoff/rdoff.h regs.h saa.h
384 parser.$(O): parser.c compiler.h config.h directiv.h eval.h float.h insns.h \
385  insnsi.h nasm.h nasmlib.h opflags.h parser.h pptok.h preproc.h regs.h \
386  stdscan.h tables.h tokens.h
387 pptok.$(O): pptok.c compiler.h config.h hashtbl.h nasmlib.h pptok.h \
388  preproc.h
389 preproc-nop.$(O): preproc-nop.c compiler.h config.h directiv.h insnsi.h \
390  nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h
391 preproc.$(O): preproc.c compiler.h config.h directiv.h eval.h hashtbl.h \
392  insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h \
393  stdscan.h tables.h tokens.h
394 quote.$(O): quote.c compiler.h config.h nasmlib.h quote.h
395 raa.$(O): raa.c compiler.h config.h nasmlib.h raa.h
396 rbtree.$(O): rbtree.c compiler.h config.h rbtree.h
397 regdis.$(O): regdis.c regdis.h regs.h
398 regflags.$(O): regflags.c compiler.h config.h directiv.h insnsi.h nasm.h \
399  nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h
400 regs.$(O): regs.c compiler.h config.h insnsi.h opflags.h tables.h
401 regvals.$(O): regvals.c compiler.h config.h insnsi.h opflags.h tables.h
402 saa.$(O): saa.c compiler.h config.h nasmlib.h saa.h
403 stdscan.$(O): stdscan.c compiler.h config.h directiv.h insns.h insnsi.h \
404  nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \
405  tokens.h
406 strfunc.$(O): strfunc.c compiler.h config.h directiv.h insnsi.h nasm.h \
407  nasmlib.h opflags.h pptok.h preproc.h regs.h
408 sync.$(O): sync.c compiler.h config.h nasmlib.h sync.h
409 tokhash.$(O): tokhash.c compiler.h config.h directiv.h hashtbl.h insns.h \
410  insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h
411 ver.$(O): ver.c compiler.h config.h directiv.h insnsi.h nasm.h nasmlib.h \
412  opflags.h pptok.h preproc.h regs.h version.h