Don't delete config.h.in when doing "make spotless"
[nasm.git] / Makefile.in
bloba0dc21131168f6cccecdd69540f275d5d06550f4
1 # $Id$
3 # Auto-configuring Makefile for the Netwide Assembler.
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.
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@ @GCCFLAGS@ @DEFS@ -I$(srcdir) -I.
19 LDFLAGS = @LDFLAGS@
20 LIBS = @LIBS@
21 PERL = perl
23 INSTALL = @INSTALL@
24 INSTALL_PROGRAM = @INSTALL_PROGRAM@
25 INSTALL_DATA = @INSTALL_DATA@
27 NROFF = @NROFF@
29 # Binary suffixes
30 O = @OBJEXT@
31 X = @EXEEXT@
33 .SUFFIXES: .c .i .s .$(O) .1 .man
35 .PHONY: all doc rdf install clean distclean cleaner spotless install_rdf
36 .PHONY: install_doc everything install_everything strip perlreq dist
38 .c.$(O):
39 $(CC) -c $(CFLAGS) -o $@ $<
41 .c.s:
42 $(CC) -S $(CFLAGS) -o $@ $<
44 .c.i:
45 $(CC) -E $(CFLAGS) -o $@ $<
47 .1.man:
48 $(NROFF) -man $< > $@
50 NASM = nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
51 labels.$(O) parser.$(O) outform.$(O) output/outbin.$(O) \
52 output/outaout.$(O) output/outcoff.$(O) output/outelf.$(O) \
53 output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
54 output/outdbg.$(O) output/outieee.$(O) \
55 preproc.$(O) listing.$(O) eval.$(O)
57 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
59 all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man
60 cd rdoff && $(MAKE) all
62 nasm$(X): $(NASM)
63 $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(LIBS)
65 ndisasm$(X): $(NDISASM)
66 $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(LIBS)
68 # These source files are automagically generated from a single
69 # instruction-table file by a Perl script. They're distributed,
70 # though, so it isn't necessary to have Perl just to recompile NASM
71 # from the distribution.
73 insnsa.c: insns.dat insns.pl
74 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
75 insnsd.c: insns.dat insns.pl
76 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
77 insnsi.h: insns.dat insns.pl
78 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
79 insnsn.c: insns.dat insns.pl
80 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
82 # These files contains all the standard macros that are derived from
83 # the version number.
84 version.h: version version.pl
85 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
87 version.mac: version version.pl
88 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
90 # This source file is generated from the standard macros file
91 # `standard.mac' by another Perl script. Again, it's part of the
92 # standard distribution.
94 macros.c: macros.pl standard.mac version.mac
95 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
97 # These source files are generated from regs.dat by yet another
98 # perl script.
99 regs.c: regs.dat regs.pl
100 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
101 regflags.c: regs.dat regs.pl
102 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
103 regdis.c: regs.dat regs.pl
104 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
105 regvals.c: regs.dat regs.pl
106 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
107 regs.h: regs.dat regs.pl
108 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
110 # This target generates all files that require perl.
111 # This allows easier generation of distribution (see dist target).
112 PERLREQ = macros.c insnsa.c insnsd.c insnsi.h insnsn.c \
113 regs.c regs.h regflags.c regdis.c regvals.c \
114 version.h version.mac
115 perlreq: $(PERLREQ)
117 install: nasm$(X) ndisasm$(X)
118 $(INSTALL_PROGRAM) nasm$(X) $(INSTALLROOT)$(bindir)/nasm$(X)
119 $(INSTALL_PROGRAM) ndisasm$(X) $(INSTALLROOT)$(bindir)/ndisasm$(X)
120 $(INSTALL_DATA) $(srcdir)/nasm.1 $(INSTALLROOT)$(mandir)/man1/nasm.1
121 $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(INSTALLROOT)$(mandir)/man1/ndisasm.1
123 clean:
124 rm -f *.$(O) *.s *.i
125 rm -f output/*.$(O) output/*.s output/*.i
126 rm -f nasm$(X) ndisasm$(X)
127 cd rdoff && $(MAKE) clean
129 distclean: clean
130 rm -f config.h config.log config.status
131 rm -f Makefile *~ *.bak *.lst *.bin
132 rm -f output/*~ output/*.bak
133 rm -f test/*.lst test/*.bin test/*.$(O) test/*.bin
134 rm -rf autom4te*.cache
135 cd rdoff && $(MAKE) distclean
137 cleaner: clean
138 rm -f $(PERLREQ) *.man nasm.spec
139 cd doc && $(MAKE) clean
141 spotless: distclean cleaner
142 rm -f doc/Makefile doc/*~ doc/*.bak
144 strip:
145 strip --strip-unneeded nasm$(X) ndisasm$(X)
147 rdf:
148 cd rdoff && $(MAKE)
150 rdf_install install_rdf:
151 cd rdoff && $(MAKE) install
153 doc:
154 cd doc && $(MAKE) all
156 doc_install install_doc:
157 cd doc && $(MAKE) install
159 everything: all doc rdf
161 install_everything: everything install install_doc install_rdf
163 dist: spotless perlreq spec
164 autoheader
165 autoconf
166 rm -rf ./autom4te*.cache
168 tar: dist
169 tar cvjf ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 ../`./nasm-dir`
171 spec: nasm.spec
173 nasm.spec: nasm.spec.in version version.pl
174 sed -e s/@@VERSION@@/`cat $(srcdir)/version`/g \
175 -e s/@@ID@@/`$(PERL) $(srcdir)/version.pl id < $(srcdir)/version`/g \
176 < nasm.spec.in > nasm.spec
179 # This build dependencies in *ALL* makefiles. Partially for that reason,
180 # it's expected to be invoked manually.
182 alldeps: perlreq
183 $(PERL) mkdep.pl -M Makefile.in Mkfiles/Makefile.* -- \
184 . output
185 ./config.status
187 #-- Magic hints to mkdep.pl --#
188 # @object-ending: ".$(O)"
189 # @path-separator: "/"
190 #-- Everything below is generated by mkdep.pl - do not edit --#
191 assemble.$(O): assemble.c insns.h insnsi.h assemble.h nasmlib.h version.h \
192 regvals.c nasm.h regs.h
193 disasm.$(O): disasm.c insns.h regs.c insnsn.c insnsi.h sync.h version.h \
194 names.c nasm.h regdis.c disasm.h regs.h
195 eval.$(O): eval.c labels.h nasmlib.h version.h nasm.h eval.h regs.h
196 float.$(O): float.c version.h nasm.h regs.h
197 insnsa.$(O): insnsa.c insns.h insnsi.h version.h nasm.h regs.h
198 insnsd.$(O): insnsd.c insns.h insnsi.h version.h nasm.h regs.h
199 insnsn.$(O): insnsn.c
200 labels.$(O): labels.c nasmlib.h version.h nasm.h regs.h
201 listing.$(O): listing.c listing.h nasmlib.h version.h nasm.h regs.h
202 macros.$(O): macros.c
203 names.$(O): names.c insnsn.c regs.c
204 nasm.$(O): nasm.c listing.h preproc.h insns.h outform.h assemble.h parser.h \
205 nasm.h regs.h labels.h insnsi.h version.h nasmlib.h eval.h
206 nasmlib.$(O): nasmlib.c insns.h regs.c names.c nasm.h regs.h insnsn.c \
207 insnsi.h nasmlib.h version.h
208 ndisasm.$(O): ndisasm.c insns.h sync.h nasm.h disasm.h regs.h insnsi.h \
209 nasmlib.h version.h
210 outform.$(O): outform.c outform.h nasm.h regs.h version.h
211 output/outaout.$(O): output/outaout.c outform.h nasm.h regs.h nasmlib.h \
212 version.h
213 output/outas86.$(O): output/outas86.c outform.h nasm.h regs.h nasmlib.h \
214 version.h
215 output/outbin.$(O): output/outbin.c outform.h nasm.h regs.h nasmlib.h \
216 version.h
217 output/outcoff.$(O): output/outcoff.c outform.h nasm.h regs.h nasmlib.h \
218 version.h
219 output/outdbg.$(O): output/outdbg.c outform.h nasm.h regs.h nasmlib.h \
220 version.h
221 output/outelf.$(O): output/outelf.c outform.h nasm.h regs.h nasmlib.h \
222 version.h
223 output/outieee.$(O): output/outieee.c outform.h nasm.h regs.h nasmlib.h \
224 version.h
225 output/outobj.$(O): output/outobj.c outform.h nasm.h regs.h nasmlib.h \
226 version.h
227 output/outrdf.$(O): output/outrdf.c outform.h nasm.h regs.h nasmlib.h \
228 version.h
229 output/outrdf2.$(O): output/outrdf2.c outform.h nasm.h regs.h nasmlib.h \
230 version.h
231 parser.$(O): parser.c insns.h parser.h nasm.h regs.h insnsi.h regflags.c \
232 float.h nasmlib.h version.h
233 preproc.$(O): preproc.c nasm.h macros.c regs.h nasmlib.h version.h
234 regdis.$(O): regdis.c
235 regflags.$(O): regflags.c
236 regs.$(O): regs.c
237 regvals.$(O): regvals.c
238 sync.$(O): sync.c sync.h