Update dependencies.
[platform/upstream/nasm.git] / Makefile.in
1 # $Id$
2 #
3 # Auto-configuring Makefile for the Netwide Assembler.
4 #
5 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
6 # Julian Hall. All rights reserved. The software is
7 # redistributable under the licence given in the file "Licence"
8 # distributed in the NASM archive.
9
10 srcdir          = @srcdir@
11 VPATH           = @srcdir@
12 prefix          = @prefix@
13 exec_prefix     = @exec_prefix@
14 bindir          = @bindir@
15 mandir          = @mandir@
16
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
25
26 INSTALL         = @INSTALL@
27 INSTALL_PROGRAM = @INSTALL_PROGRAM@
28 INSTALL_DATA    = @INSTALL_DATA@
29
30 NROFF           = @NROFF@
31
32 # Binary suffixes
33 O               = @OBJEXT@
34 X               = @EXEEXT@
35
36 .SUFFIXES: .c .i .s .$(O) .1 .man
37
38 .PHONY: all doc rdf install clean distclean cleaner spotless install_rdf
39 .PHONY: install_doc everything install_everything strip perlreq dist
40
41 .c.$(O):
42         $(CC) -c $(ALL_CFLAGS) -o $@ $<
43
44 .c.s:
45         $(CC) -S $(ALL_CFLAGS) -o $@ $<
46
47 .c.i:
48         $(CC) -E $(ALL_CFLAGS) -o $@ $<
49
50 .1.man:
51         $(NROFF) -man $< > $@
52
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) listing.$(O) eval.$(O)
60
61 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
62
63 all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man
64         cd rdoff && $(MAKE) all
65
66 nasm$(X): $(NASM)
67         $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(LIBS)
68
69 ndisasm$(X): $(NDISASM)
70         $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(LIBS)
71
72 # These source files are automagically generated from a single
73 # instruction-table file by a Perl script. They're distributed,
74 # though, so it isn't necessary to have Perl just to recompile NASM
75 # from the distribution.
76
77 insnsa.c: insns.dat insns.pl
78         $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
79 insnsd.c: insns.dat insns.pl
80         $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
81 insnsi.h: insns.dat insns.pl
82         $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
83 insnsn.c: insns.dat insns.pl
84         $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
85
86 # These files contains all the standard macros that are derived from
87 # the version number.
88 version.h: version version.pl
89         $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
90
91 version.mac: version version.pl
92         $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
93
94 # This source file is generated from the standard macros file
95 # `standard.mac' by another Perl script. Again, it's part of the
96 # standard distribution.
97
98 macros.c: macros.pl standard.mac version.mac
99         $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
100
101 # These source files are generated from regs.dat by yet another
102 # perl script.
103 regs.c: regs.dat regs.pl
104         $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
105 regflags.c: regs.dat regs.pl
106         $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
107 regdis.c: regs.dat regs.pl
108         $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
109 regvals.c: regs.dat regs.pl
110         $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
111 regs.h: regs.dat regs.pl
112         $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
113
114 # This target generates all files that require perl.
115 # This allows easier generation of distribution (see dist target).
116 PERLREQ = macros.c insnsa.c insnsd.c insnsi.h insnsn.c \
117           regs.c regs.h regflags.c regdis.c regvals.c \
118           version.h version.mac
119 perlreq: $(PERLREQ)
120
121 install: nasm$(X) ndisasm$(X)
122         $(INSTALL_PROGRAM) nasm$(X) $(INSTALLROOT)$(bindir)/nasm$(X)
123         $(INSTALL_PROGRAM) ndisasm$(X) $(INSTALLROOT)$(bindir)/ndisasm$(X)
124         $(INSTALL_DATA) $(srcdir)/nasm.1 $(INSTALLROOT)$(mandir)/man1/nasm.1
125         $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(INSTALLROOT)$(mandir)/man1/ndisasm.1
126
127 clean:
128         rm -f *.$(O) *.s *.i
129         rm -f output/*.$(O) output/*.s output/*.i
130         rm -f nasm$(X) ndisasm$(X)
131         cd rdoff && $(MAKE) clean
132
133 distclean: clean
134         rm -f config.h config.log config.status
135         rm -f Makefile *~ *.bak *.lst *.bin
136         rm -f output/*~ output/*.bak
137         rm -f test/*.lst test/*.bin test/*.$(O) test/*.bin
138         rm -rf autom4te*.cache
139         cd rdoff && $(MAKE) distclean
140
141 cleaner: clean
142         rm -f $(PERLREQ) *.man nasm.spec
143         cd doc && $(MAKE) clean
144
145 spotless: distclean cleaner
146         rm -f doc/Makefile doc/*~ doc/*.bak
147
148 strip:
149         strip --strip-unneeded nasm$(X) ndisasm$(X)
150
151 rdf:
152         cd rdoff && $(MAKE)
153
154 rdf_install install_rdf:
155         cd rdoff && $(MAKE) install
156
157 doc:
158         cd doc && $(MAKE) all
159
160 doc_install install_doc:
161         cd doc && $(MAKE) install
162
163 everything: all doc rdf
164
165 install_everything: everything install install_doc install_rdf
166
167 dist: spotless perlreq spec
168         autoheader
169         autoconf
170         rm -rf ./autom4te*.cache
171
172 tar: dist
173         tar cvjf ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 ../`./nasm-dir`
174
175 spec: nasm.spec
176
177 nasm.spec: nasm.spec.in version version.pl
178         sed -e s/@@VERSION@@/`cat $(srcdir)/version`/g \
179             -e s/@@ID@@/`$(PERL) $(srcdir)/version.pl id < $(srcdir)/version`/g \
180             < nasm.spec.in > nasm.spec
181
182 splint:
183         splint -weak *.c
184
185 #
186 # This build dependencies in *ALL* makefiles.  Partially for that reason,
187 # it's expected to be invoked manually.
188 #
189 alldeps: perlreq
190         $(PERL) mkdep.pl -M Makefile.in Mkfiles/Makefile.* -- \
191                 . output
192         ./config.status
193
194 #-- Magic hints to mkdep.pl --#
195 # @object-ending: ".$(O)"
196 # @path-separator: "/"
197 #-- Everything below is generated by mkdep.pl - do not edit --#
198 assemble.$(O): assemble.c preproc.h insns.h regs.h regflags.c config.h \
199  version.h nasmlib.h nasm.h regvals.c assemble.h insnsi.h
200 disasm.$(O): disasm.c insns.h sync.h regdis.c regs.h config.h regs.c \
201  version.h nasm.h insnsn.c names.c insnsi.h disasm.h
202 eval.$(O): eval.c labels.h eval.h regs.h config.h version.h nasmlib.h nasm.h
203 float.$(O): float.c regs.h config.h version.h nasm.h
204 insnsa.$(O): insnsa.c insns.h regs.h config.h version.h nasm.h insnsi.h
205 insnsd.$(O): insnsd.c insns.h regs.h config.h version.h nasm.h insnsi.h
206 insnsn.$(O): insnsn.c
207 labels.$(O): labels.c regs.h config.h version.h nasmlib.h nasm.h
208 listing.$(O): listing.c regs.h config.h version.h nasmlib.h nasm.h listing.h
209 macros.$(O): macros.c
210 names.$(O): names.c regs.c insnsn.c
211 nasm.$(O): nasm.c labels.h preproc.h insns.h parser.h eval.h regs.h \
212  outform.h config.h version.h nasmlib.h nasm.h assemble.h insnsi.h listing.h
213 nasmlib.$(O): nasmlib.c insns.h regs.h config.h regs.c version.h nasmlib.h \
214  nasm.h insnsn.c names.c insnsi.h
215 ndisasm.$(O): ndisasm.c insns.h sync.h regs.h config.h version.h nasmlib.h \
216  nasm.h insnsi.h disasm.h
217 outform.$(O): outform.c regs.h config.h outform.h version.h nasm.h
218 output/outaout.$(O): output/outaout.c regs.h outform.h config.h version.h \
219  nasmlib.h nasm.h
220 output/outas86.$(O): output/outas86.c regs.h outform.h config.h version.h \
221  nasmlib.h nasm.h
222 output/outbin.$(O): output/outbin.c labels.h eval.h regs.h outform.h \
223  config.h version.h nasmlib.h nasm.h
224 output/outcoff.$(O): output/outcoff.c regs.h outform.h config.h version.h \
225  nasmlib.h nasm.h
226 output/outdbg.$(O): output/outdbg.c regs.h outform.h config.h version.h \
227  nasmlib.h nasm.h
228 output/outelf32.$(O): output/outelf32.c regs.h outform.h config.h version.h \
229  nasmlib.h nasm.h
230 output/outelf64.$(O): output/outelf64.c regs.h outform.h config.h version.h \
231  nasmlib.h nasm.h
232 output/outieee.$(O): output/outieee.c regs.h outform.h config.h version.h \
233  nasmlib.h nasm.h
234 output/outmacho.$(O): output/outmacho.c compiler.h regs.h outform.h config.h \
235  version.h nasmlib.h nasm.h
236 output/outobj.$(O): output/outobj.c regs.h outform.h config.h version.h \
237  nasmlib.h nasm.h
238 output/outrdf.$(O): output/outrdf.c regs.h outform.h config.h version.h \
239  nasmlib.h nasm.h
240 output/outrdf2.$(O): output/outrdf2.c rdoff/rdoff.h regs.h outform.h \
241  config.h version.h nasmlib.h nasm.h
242 parser.$(O): parser.c insns.h parser.h float.h regs.h regflags.c config.h \
243  version.h nasmlib.h nasm.h insnsi.h
244 preproc.$(O): preproc.c macros.c regs.h config.h version.h nasmlib.h nasm.h
245 regdis.$(O): regdis.c
246 regflags.$(O): regflags.c
247 regs.$(O): regs.c
248 regvals.$(O): regvals.c
249 sync.$(O): sync.c sync.h