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