Pass on MINUS_G to recursive makes. Recognize ncr3000 config.
[binutils-gdb.git] / bfd / Makefile.in
1 # Makefile template for Configure for the BFD library.
2 # Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
3 # Written by Cygnus Support.
4 #
5 # This file is part of BFD, the Binary File Descriptor library.
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 # $Id$
22
23 srcdir = .
24
25 prefix = /usr/local
26
27 exec_prefix = $(prefix)
28 bindir = $(exec_prefix)/bin
29 libdir = $(exec_prefix)/lib
30
31 datadir = $(prefix)/lib
32 mandir = $(prefix)/man
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
42 infodir = $(prefix)/info
43 includedir = $(prefix)/include
44 oldincludedir =
45 docdir = $(srcdir)/doc
46
47 SHELL = /bin/sh
48
49 INSTALL = install -c
50 INSTALL_PROGRAM = $(INSTALL)
51 INSTALL_DATA = $(INSTALL)
52
53 AR = ar
54 AR_FLAGS = qc
55 BISON = bison
56 MAKEINFO = makeinfo
57 RANLIB = ranlib
58
59 INCDIR = $(srcdir)/../include
60 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
61 DEP = mkdep
62 MINUS_G=-g
63
64 SUBDIRS = doc
65
66
67 # Change this (to MINIMIZE=1) to save space in executables.
68 # Currently, all this does is control the target_vector in targets.c.
69 MINIMIZE=0
70
71 TARGETLIB = libbfd.a
72 CFLAGS = $(MINUS_G) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # -DINTEL960VERSION
73
74
75 BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o \
76 archures.o core.o section.o format.o syms.o reloc.o init.o ctor.o seclet.o
77
78 BFD_MACHINES = cpu-h8300.o cpu-i960.o cpu-sparc.o cpu-m68k.o cpu-m88k.o \
79 cpu-vax.o cpu-mips.o cpu-a29k.o cpu-i386.o cpu-rs6000.o
80
81 BFD_BACKENDS = oasys.o ieee.o srec.o elf.o stab-syms.o\
82 aout64.o aout32.o demo64.o sunos.o newsos3.o i386aout.o bout.o \
83 coff-i960.o coff-a29k.o coff-m68k.o coff-i386.o coff-m88k.o \
84 coff-mips.o coff-rs6000.o coff-h8300.o coff-msym.o
85
86 OPTIONAL_BACKENDS = trad-core.o
87
88 #### host and target dependent Makefile fragments come in here.
89 ###
90
91 BFD_H=$(INCDIR)/bfd.h
92
93 # C source files that correspond to .o's.
94 CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c archures.c \
95 coff-i386.c aout64.c aout32.c sunos.c demo64.c coff-i960.c srec.c \
96 oasys.c ieee.c coff-m68k.c coff-a29k.c coff-rs6000.c coff-msym.c \
97 format.c section.c core.c syms.c stab-syms.c reloc.c init.c ctor.c seclet.c \
98 coff-m88k.c coff-mips.c trad-core.c newsos3.c i386aout.c bout.c elf.c \
99 cpu-h8300.c cpu-i960.c cpu-sparc.c cpu-m68k.c cpu-m88k.c \
100 cpu-vax.c cpu-mips.c cpu-a29k.c cpu-i386.c cpu-rs6000.c coff-h8300.c
101
102 STAGESTUFF = $(TARGETLIB) $(OFILES)
103
104 all: $(TARGETLIB)
105 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)"
106
107 check:
108
109 info: force
110 $(MAKE) subdir_do DO=info "DODIRS=$(SUBDIRS)" "MAKEINFO=$(MAKEINFO)"
111
112 clean-info:
113 $(MAKE) subdir_do DO=clean-info "DODIRS=$(SUBDIRS)"
114
115 install-info: force
116 $(MAKE) subdir_do DO=install-info "DODIRS=$(SUBDIRS)"
117
118 # HDEPFILES comes from the host config; TDEPFILES from the target config.
119 OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES)
120
121 $(TARGETLIB): $(OFILES)
122 rm -f $(TARGETLIB)
123 $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES)
124 $(RANLIB) $(TARGETLIB)
125
126 # When compiling targets.c, supply the default target info from configure.
127 targets.o: targets.c
128 $(CC) $(CFLAGS) -c -DMINIMIZE=$(MINIMIZE) $(TDEFAULTS) $<
129
130 subdir_do: force
131 for i in $(DODIRS); do \
132 if [ -d ./$$i ] ; then \
133 if (cd ./$$i; \
134 $(MAKE) \
135 "against=$(against)" \
136 "AR=$(AR)" \
137 "AR_FLAGS=$(AR_FLAGS)" \
138 "CC=$(CC)" \
139 "MINUS_G=$(MINUS_G)" \
140 "RANLIB=$(RANLIB)" \
141 "MAKEINFO=$(MAKEINFO)" \
142 "BISON=$(BISON)" $(DO)) ; then true ; \
143 else exit 1 ; fi ; \
144 else true ; fi ; \
145 done
146
147 stage1: force
148 - mkdir stage1
149 - mv -f $(STAGESTUFF) stage1
150 $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
151
152 stage2: force
153 - mkdir stage2
154 - mv -f $(STAGESTUFF) stage2
155 $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
156
157 stage3: force
158 - mkdir stage3
159 - mv -f $(STAGESTUFF) stage3
160 $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
161
162 against=stage2
163
164 comparison: force
165 for i in *.o ; do cmp $$i $(against)/$$i || exit 1 ; done
166 $(MAKE) subdir_do DO=comparison "DODIRS=$(SUBDIRS)"
167
168 de-stage1: force
169 - (cd stage1 ; mv -f $(STAGESTUFF) ..)
170 - rmdir stage1
171 $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
172
173 de-stage2: force
174 - (cd stage2 ; mv -f $(STAGESTUFF) ..)
175 - rmdir stage2
176 $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
177
178 de-stage3: force
179 - (cd stage3 ; mv -f $(STAGESTUFF) ..)
180 - rmdir stage3
181 $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
182
183 tags etags: TAGS
184
185 TAGS: force
186 etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
187
188 clean:
189 rm -f *.[oa] *~ core *.E *.p *.ip aout-params.h gen-aout
190 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)"
191
192 clobber realclean: clean
193 rm -f libbfd.a TAGS
194 $(MAKE) subdir_do DO=clobber "DODIRS=$(SUBDIRS)"
195
196 # Mark everything as depending on config.status, since the timestamp on
197 # sysdep.h might actually move backwards if we reconfig and relink it
198 # to a different hosts/h-xxx.h file. This will force a recompile anyway.
199 RECONFIG = config.status
200 $(BFD_LIBS): libbfd.h $(BFD_H) $(RECONFIG)
201 $(BFD_MACHINES): libbfd.h $(BFD_H) $(RECONFIG)
202 $(BFD_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
203 $(OPTIONAL_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
204
205 # Get around a Sun Make bug in SunOS 4.1.1 with VPATH
206 cpu-i386.o:cpu-i386.c
207
208 saber:
209 #suppress 65 on bfd_map_over_sections
210 #suppress 66 on bfd_map_over_sections
211 #suppress 67 on bfd_map_over_sections
212 #suppress 68 on bfd_map_over_sections
213 #suppress 69 on bfd_map_over_sections
214 #suppress 70 on bfd_map_over_sections
215 #suppress 110 in bfd_map_over_sections
216 #suppress 112 in bfd_map_over_sections
217 #suppress 530
218 #suppress 590 in swap_exec_header
219 #suppress 590 in _bfd_dummy_core_file_matches_executable_p
220 #suppress 590 in bfd_dont_truncate_arname
221 #suppress 590 on ignore
222 #suppress 590 on abfd
223 #setopt load_flags $(CFLAGS)
224 #load $(CFILES)
225
226
227 #-----------------------------------------------------------------------------
228 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
229 #
230 # 'VERSION' file must be present and contain a string of the form "x.y"
231 #-----------------------------------------------------------------------------
232
233 ver960.c: FORCE
234 rm -f ver960.c
235 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
236
237
238 # This target should be invoked before building a new release.
239 # 'VERSION' file must be present and contain a string of the form "x.y"
240 #
241 roll:
242 @V=`cat VERSION` ; \
243 MAJ=`sed 's/\..*//' VERSION` ; \
244 MIN=`sed 's/.*\.//' VERSION` ; \
245 V=$$MAJ.`expr $$MIN + 1` ; \
246 rm -f VERSION ; \
247 echo $$V >VERSION ; \
248 echo Version $$V
249
250 # Dummy target to force execution of dependent targets.
251 #
252 force:
253
254 install:
255 $(INSTALL_DATA) libbfd.a $(libdir)/libbfd.a
256 $(RANLIB) $(libdir)/libbfd.a
257 $(INSTALL_DATA) $(INCDIR)/bfd.h $(includedir)/bfd.h
258 [ -z "$(oldincludedir)" ] || $(INSTALL_DATA) $(INCDIR)/bfd.h $(oldincludedir)/bfd.h
259 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)"
260
261 # Target to uncomment host-specific lines in this makefile. Such lines must
262 # have the following string beginning in column 1: #__<hostname>__#
263 # Original Makefile is backed up as 'Makefile.old'.
264 #
265 # Invoke with: make make HOST=xxx
266 #
267 make:
268 -@if test $(HOST)x = x ; then \
269 echo '\aSpecify "make make HOST=???"'; \
270 exit 1; \
271 fi ; \
272 grep -s "^#The next line was generated by 'make make'" Makefile; \
273 if test $$? = 0 ; then \
274 echo "\aMakefile has already been processed with 'make make'";\
275 exit 1; \
276 fi ; \
277 mv -f Makefile Makefile.old; \
278 echo "#The next line was generated by 'make make'" >Makefile ; \
279 echo "HOST=$(HOST)" >>Makefile ; \
280 echo >>Makefile ; \
281 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
282
283 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
284 $(SHELL) ./config.status
285
286 dep: $(CFILES)
287 mkdep $(CFLAGS) $?
288
289 host-aout.o: Makefile
290
291 # The following program can be used to generate a simple config file
292 # which can be folded into an h-XXX file for a new host, with some editing.
293 aout-params.h: gen-aout
294 ./gen-aout > aout-params.h
295 gen-aout: $(srcdir)/gen-aout.c Makefile
296 $(CC) -o gen-aout $(CFLAGS) $(LFLAGS) $(srcdir)/gen-aout.c
297
298 headers:
299 (cd $(docdir); $(MAKE) protos)
300 # Rebuild prototypes in bfd.h
301 cp $(docdir)/bfd.h $(BFD_H)
302 cp $(docdir)/libbfd.h $(srcdir)/libbfd.h
303 cp $(docdir)/libcoff.h $(srcdir)/libcoff.h
304
305 bfd.info:
306 ( cd $(docdir); $(MAKE) bfd.info)
307
308 bfd.dvi:
309 (cd $(docdir); $(MAKE) bfd.dvi)
310
311 bfd.ps:
312 (cd $(docdir); $(MAKE) bfd.ps)
313
314 # What appears below is generated by a hacked mkdep using gcc -MM.
315
316 # DO NOT DELETE THIS LINE -- mkdep uses it.
317 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
318
319 libbfd.o : libbfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
320 opncls.o : opncls.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
321 bfd.o : bfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
322 archive.o : archive.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
323 $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h
324 targets.o : targets.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
325 cache.o : cache.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
326 archures.o : archures.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h
327 aout64.o : aout64.c
328 aout32.o : aout32.c aoutx.h $(INCDIR)/bfd.h $(INCDIR)/ansidecl.h \
329 $(INCDIR)/obstack.h libaout.h libbfd.h $(INCDIR)/aout/aout64.h \
330 $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
331 sunos.o : sunos.c aoutf1.h $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
332 libaout.h libbfd.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
333 $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
334 demo64.o : demo64.c
335
336 srec.o : srec.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
337 oasys.o : oasys.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
338 $(INCDIR)/oasys.h liboasys.h
339 ieee.o : ieee.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
340 $(INCDIR)/ieee.h libieee.h
341 coff-h8300.o: coff-h8300.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
342 $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
343 coff-a29k.o: coff-a29k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
344 $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
345 coff-i386.o: coff-i386.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
346 $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
347 coff-i960.o: coff-i960.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
348 $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
349 coff-m68k.o: coff-m68k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
350 $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
351 coff-m88k.o: coff-m88k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
352 $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
353 coff-mips.o: coff-mips.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
354 $(INCDIR)/coff/mips.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
355 coff-rs6000.o: coff-rs6000.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
356 $(INCDIR)/coff/rs6000.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
357 format.o : format.c $(INCDIR)/bfd.h \
358 $(INCDIR)/obstack.h libbfd.h
359 section.o : section.c $(INCDIR)/bfd.h \
360 $(INCDIR)/obstack.h libbfd.h
361 core.o : core.c $(INCDIR)/bfd.h \
362 $(INCDIR)/obstack.h libbfd.h
363 syms.o : syms.c $(INCDIR)/bfd.h \
364 $(INCDIR)/obstack.h libbfd.h
365 syms.o : stab-syms.c
366 reloc.o : reloc.c $(INCDIR)/bfd.h \
367 $(INCDIR)/obstack.h libbfd.h
368
369 trad-core.o : trad-core.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
370 libbfd.h libaout.h
371
372 coff-msym.o: coff-msym.c $(INCDIR)/bfd.h $(INCDIR)/coff/ecoff-ext.h \
373 $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h
374
375 newsos3.o : newsos3.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
376 $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
377 $(INCDIR)/aout/ar.h libaout.h
378 i386aout.o : i386aout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
379 $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
380 $(INCDIR)/aout/ar.h libaout.h
381 bout.o : bout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
382 $(INCDIR)/bout.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h
383
384 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
385