Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / as / Makefile.in
1 # $FreeBSD: src/gnu/usr.bin/as/Makefile.in,v 1.6 1999/08/27 23:34:10 peter Exp $
2
3 # Makefile for GNU Assembler
4 #   Copyright (C) 1987-1992 Free Software Foundation, Inc.
5
6 #This file is part of GNU GAS.
7
8 #GNU GAS is free software; you can redistribute it and/or modify
9 #it under the terms of the GNU General Public License as published by
10 #the Free Software Foundation; either version 2, or (at your option)
11 #any later version.
12
13 #GNU GAS is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #GNU General Public License for more details.
17
18 #You should have received a copy of the GNU General Public License
19 #along with GNU GAS; see the file COPYING.  If not, write to
20 #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 # The targets for external use include:
23 # all, doc, proto, install, uninstall, includes, TAGS,
24 # clean, cleanconfig, realclean, stage1, stage2, stage3, stage4.
25
26 # Variables that exist for you to override.
27 # See below for how to change them for certain systems.
28
29 srcdir = .
30
31 prefix = /usr/local
32
33 bindir = $(prefix)/bin
34 datadir = $(prefix)/lib
35 libdir = $(prefix)/lib
36 mandir = $(datadir)/man
37 man1dir = $(mandir)/man1
38 man2dir = $(mandir)/man2
39 man3dir = $(mandir)/man3
40 man4dir = $(mandir)/man4
41 man5dir = $(mandir)/man5
42 man6dir = $(mandir)/man6
43 man7dir = $(mandir)/man7
44 man8dir = $(mandir)/man8
45 man9dir = $(mandir)/man9
46 infodir = $(datadir)/info
47 includedir = $(prefix)/include
48 docdir = $(datadir)/doc
49
50 SHELL = /bin/sh
51
52 INSTALL = install -c
53 INSTALL_PROGRAM = $(INSTALL)
54 INSTALL_DATA = $(INSTALL)
55
56 AR = ar
57 AR_FLAGS = qv
58 BISON = bison
59 MAKEINFO = makeinfo
60 RANLIB = ranlib
61 MINUS_G = -g
62
63 # Lists of files for various purposes.
64
65 REAL_SOURCES = \
66         $(srcdir)/app.c \
67         $(srcdir)/as.c \
68         $(srcdir)/atof-generic.c \
69         $(srcdir)/bignum-copy.c \
70         $(srcdir)/cond.c \
71         $(srcdir)/expr.c \
72         $(srcdir)/flo-const.c \
73         $(srcdir)/flo-copy.c \
74         $(srcdir)/flonum-mult.c \
75         $(srcdir)/frags.c \
76         $(srcdir)/hash.c \
77         $(srcdir)/hex-value.c \
78         $(srcdir)/input-file.c \
79         $(srcdir)/input-scrub.c \
80         $(srcdir)/messages.c \
81         $(srcdir)/obstack.c \
82         $(srcdir)/output-file.c \
83         $(srcdir)/read.c \
84         $(srcdir)/strerror.c \
85         $(srcdir)/strstr.c \
86         $(srcdir)/subsegs.c \
87         $(srcdir)/symbols.c \
88         $(srcdir)/version.c \
89         $(srcdir)/write.c \
90         $(srcdir)/listing.c \
91         $(srcdir)/xmalloc.c \
92         $(srcdir)/xrealloc.c
93
94 # in an expedient order
95 LINKED_SOURCES = \
96         targ-cpu.c \
97         obj-format.c \
98         atof-targ.c
99
100 SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES)
101
102 REAL_HEADERS = \
103         $(srcdir)/as.h \
104         $(srcdir)/bignum.h \
105         $(srcdir)/expr.h \
106         $(srcdir)/flonum.h \
107         $(srcdir)/frags.h \
108         $(srcdir)/hash.h \
109         $(srcdir)/input-file.h \
110         $(srcdir)/listing.h \
111         $(srcdir)/tc.h \
112         $(srcdir)/obj.h \
113         $(srcdir)/obstack.h \
114         $(srcdir)/read.h \
115         $(srcdir)/struc-symbol.h \
116         $(srcdir)/subsegs.h \
117         $(srcdir)/symbols.h \
118         $(srcdir)/write.h
119
120 LINKED_HEADERS = \
121         a.out.gnu.h \
122         a.out.h \
123         host.h \
124         targ-env.h \
125         targ-cpu.h \
126         obj-format.h \
127         atof-targ.h
128
129 HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS)
130
131 OBJS = \
132         targ-cpu.o \
133         obj-format.o \
134         atof-targ.o \
135         app.o \
136         as.o \
137         atof-generic.o \
138         bignum-copy.o \
139         cond.o \
140         expr.o \
141         flo-const.o \
142         flo-copy.o \
143         flonum-mult.o \
144         frags.o \
145         hash.o \
146         hex-value.o \
147         input-file.o \
148         input-scrub.o \
149         messages.o \
150         obstack.o \
151         output-file.o \
152         read.o \
153         strerror.o \
154         strstr.o \
155         subsegs.o \
156         symbols.o \
157         version.o \
158         write.o \
159         listing.o \
160         xmalloc.o \
161         xrealloc.o
162
163 #### host, target, and site specific Makefile frags come in here.
164
165 all: as.new
166         (cd doc ; $(MAKE) all)
167
168 info:
169         (cd doc ; $(MAKE) info)
170
171 install-info:
172         (cd doc ; $(MAKE) install-info)
173
174 clean-info:
175         (cd doc ; $(MAKE) clean-info)
176
177 # Now figure out from those variables how to compile and link.
178
179 # This is the variable actually used when we compile.
180 ALL_CFLAGS = $(MINUS_G) $(INTERNAL_CFLAGS) $(CFLAGS) $(HDEFINES) $(TDEFINES) -DPIC -DOLD_GAS
181
182 # How to link with both our special library facilities
183 # and the system's installed libraries.
184
185 LIBS = $(HLIBS)
186
187 # Specify the directories to be searched for header files.
188 # Both . and srcdir are used, in that order,
189 # so that tm.h and config.h will be found in the compilation
190 # subdirectory rather than in the source directory.
191 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config # -I$(srcdir)/../include
192 SUBDIR_INCLUDES = -I.. -I$(srcdir) -I$(srcdir)/config
193
194 # Always use -I$(srcdir)/config when compiling.
195 .c.o:
196         $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
197
198 # This tells GNU make version 3 not to export all the variables
199 # defined in this file into the environment.
200 .NOEXPORT:
201
202 # Files to be copied away after each stage in building.
203 STAGESTUFF = *.o as.new
204
205 as.new: $(OBJS) $(LIBDEPS)
206         -mv -f as.new as.old
207         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS)
208
209 config.status:
210         @echo You must configure gas.  Look at the INSTALL file for details.
211         @false
212
213 # Compiling object files from source files.
214
215 app.o : app.c as.h host.h targ-env.h obj-format.h \
216   targ-cpu.h struc-symbol.h \
217   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
218 as.o : as.c as.h host.h targ-env.h obj-format.h \
219   targ-cpu.h struc-symbol.h \
220   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
221 atof-generic.o : atof-generic.c as.h host.h targ-env.h obj-format.h \
222   targ-cpu.h struc-symbol.h \
223   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
224 bignum-copy.o : bignum-copy.c as.h host.h \
225   targ-env.h obj-format.h \
226   targ-cpu.h struc-symbol.h \
227   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
228 cond.o : cond.c as.h host.h targ-env.h obj-format.h \
229   targ-cpu.h struc-symbol.h \
230   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
231
232 debug.o : debug.c as.h host.h targ-env.h obj-format.h \
233   targ-cpu.h struc-symbol.h \
234   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
235   subsegs.h
236 expr.o : expr.c as.h host.h targ-env.h obj-format.h \
237   targ-cpu.h  struc-symbol.h \
238   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
239
240 flo-const.o : flo-const.c flonum.h bignum.h
241 flo-copy.o : flo-copy.c as.h host.h targ-env.h obj-format.h \
242   targ-cpu.h  struc-symbol.h \
243   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
244 flonum-mult.o : flonum-mult.c flonum.h bignum.h
245 frags.o : frags.c as.h host.h targ-env.h obj-format.h \
246   targ-cpu.h  struc-symbol.h \
247   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
248   subsegs.h
249 hash.o : hash.c as.h host.h targ-env.h obj-format.h \
250   targ-cpu.h  struc-symbol.h \
251   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
252 hex-value.o : hex-value.c
253 input-file.o : input-file.c as.h host.h \
254    targ-env.h obj-format.h targ-cpu.h \
255    struc-symbol.h write.h flonum.h bignum.h expr.h \
256   frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
257 input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \
258   as.h host.h targ-env.h obj-format.h \
259   targ-cpu.h  struc-symbol.h \
260   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
261   input-file.h
262 listing.o : listing.c as.h host.h targ-env.h flonum.h bignum.h \
263   listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
264   frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
265 messages.o : messages.c as.h host.h targ-env.h obj-format.h \
266   targ-cpu.h  struc-symbol.h \
267   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
268 obstack.o : obstack.c
269 output-file.o : output-file.c as.h host.h targ-env.h obj-format.h \
270   targ-cpu.h  struc-symbol.h \
271   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
272   output-file.h
273 read.o : read.c as.h host.h targ-env.h obj-format.h \
274   targ-cpu.h  struc-symbol.h \
275   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
276
277 strstr.o : strstr.c
278 subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \
279   targ-cpu.h  struc-symbol.h \
280   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
281   subsegs.h
282 symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \
283   targ-cpu.h  struc-symbol.h \
284   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
285    subsegs.h
286 version.o : version.c
287 write.o : write.c as.h host.h targ-env.h obj-format.h \
288   targ-cpu.h  struc-symbol.h \
289   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
290   subsegs.h  output-file.h
291 xmalloc.o : xmalloc.c
292 xrealloc.o : xrealloc.c
293 atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \
294   targ-cpu.h struc-symbol.h \
295   write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
296   symbols.h tc.h obj.h
297 obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \
298   targ-cpu.h struc-symbol.h \
299   write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
300   symbols.h tc.h obj.h
301 targ-cpu.o : targ-cpu.c targ-env.h obj-format.h \
302   targ-cpu.h struc-symbol.h \
303   write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
304   symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS)
305
306 # Remake the info files.
307
308 doc: $(srcdir)/as.info
309
310 $(srcdir)/as.info: $(srcdir)/doc/as.texinfo
311         (cd doc; make as.info; mv -f as.info $srcdir)
312
313 clean:
314         (cd doc ; $(MAKE) clean)
315         -rm -f $(STAGESTUFF) core
316
317 # Like clean but also delete the links made to configure gas.
318 distclean: clean
319         -rm -f config.status Makefile host.h targ-env.h targ-cpu.h \
320                 targ-cpu.c obj-format.h obj-format.c atof-targ.c \
321                 gas.aux gas.cps gas.fns gas.info gas.kys gas.pgs \
322                 gas.tps gas.vrs TAGS gas.info* gas.?? gas.??s gas.log \
323                 gas.toc gas.*aux *.dvi
324
325 # Entry points `install', `includes' and `uninstall'.
326
327 # Copy the files into directories where they will be run.
328 install:
329         if [ "$(host_alias)" = "$(target_alias)" ] ; then \
330                 $(INSTALL_PROGRAM) as.new $(bindir)/as ; \
331         else \
332                 $(INSTALL_PROGRAM) as.new $(bindir)/as-$(target_alias) ; \
333         fi
334
335 # Create the installation directory.
336 install-dir:
337         -mkdir $(libdir)
338         -mkdir $(libdir)/gcc
339         -mkdir $(libdir)/gcc/$(target)
340         -mkdir $(libdir)/gcc/$(target)/$(version)
341
342 # Cancel installation by deleting the installed files.
343 uninstall:
344         -rm -rf $(libsubdir)
345         -rm -rf $(bindir)/as
346         -rm -rf $(mandir)/gas.$(manext)
347
348
349 # These exist for maintenance purposes.
350
351 tags TAGS: force
352         etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in
353
354 bootstrap: as.new force
355         $(MAKE) stage1
356         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
357         $(MAKE) stage2
358         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
359         $(MAKE) comparison against=stage2
360
361 bootstrap2: force
362         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
363         $(MAKE) stage2
364         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
365         $(MAKE) comparison against=stage2
366
367 bootstrap3: force
368         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
369         $(MAKE) comparison against=stage2
370
371 # Copy the object files from a particular stage into a subdirectory.
372 stage1: force
373         -mkdir stage1
374         -mv -f $(STAGESTUFF) stage1
375         if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi
376
377 stage2: force
378         -mkdir stage2
379         -mv -f $(STAGESTUFF) stage2
380         if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi
381
382 stage3: force
383         -mkdir stage3
384         -mv -f $(STAGESTUFF) stage3
385         if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi
386
387 against=stage2
388
389 comparison: force
390         for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
391
392 de-stage1: force
393         - (cd stage1 ; rm -f as ; mv -f * ..)
394         - rmdir stage1
395
396 de-stage2: force
397         - (cd stage2 ; rm -f as ; mv -f * ..)
398         - rmdir stage2
399
400 de-stage3: force
401         - (cd stage3 ; rm -f as ; mv -f * ..)
402         - rmdir stage3
403
404 #In GNU Make, ignore whether `stage*' exists.
405 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
406
407 force:
408
409 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
410         $(SHELL) ./config.status
411