1 # Makefile template for Configure for the BFD library.
2 # Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
3 # Written by Cygnus Support.
5 # This file is part of BFD, the Binary File Descriptor library.
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.
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.
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.
25 exec_prefix = $(prefix)
26 bindir = $(exec_prefix)/bin
27 libdir = $(exec_prefix)/lib
29 datadir = $(prefix)/lib
30 mandir = $(prefix)/man
31 man1dir = $(mandir)/man1
32 man2dir = $(mandir)/man2
33 man3dir = $(mandir)/man3
34 man4dir = $(mandir)/man4
35 man5dir = $(mandir)/man5
36 man6dir = $(mandir)/man6
37 man7dir = $(mandir)/man7
38 man8dir = $(mandir)/man8
39 man9dir = $(mandir)/man9
40 infodir = $(prefix)/info
41 includedir = $(prefix)/include
48 INSTALL_PROGRAM = $(INSTALL)
49 INSTALL_DATA = $(INSTALL)
60 INCDIR = $(srcdir)/../include
61 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
69 # bfd.h goes here, for now
72 BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o \
73 archures.o core.o section.o format.o syms.o reloc.o init.o \
74 ctor.o seclet.o coffgen.o reloc16.o
76 ALL_MACHINES = cpu-h8300.o cpu-i960.o cpu-sparc.o cpu-m68k.o cpu-m88k.o \
77 cpu-vax.o cpu-mips.o cpu-a29k.o cpu-i386.o cpu-rs6000.o cpu-hppa.o \
78 cpu-z8k.o cpu-we32k.o cpu-h8500.o cpu-alpha.o cpu-sh.o
82 elf32.o elf32-sparc.o elf32-i386.o elf32-i860.o elf32-m68k.o \
83 elf32-hppa.o elf32-mips.o elf32-m88k.o elf32-generic.o \
84 aout32.o sunos.o newsos3.o mipsbsd.o aout-adobe.o \
85 i386aout.o i386bsd.o i386linux.o i386lynx.o \
87 coff-i960.o coff-a29k.o coff-m68k.o coff-i386.o coff-m88k.o \
88 coff-rs6000.o coff-h8300.o coff-h8500.o coff-z8k.o coff-we32k.o \
89 coff-mips.o coff-msym.o coff-alpha.o coff-sh.o \
90 hppa.o oasys.o ieee.o srec.o \
94 elf64.o elf64-generic.o \
97 OPTIONAL_BACKENDS = trad-core.o
99 # These are defined by configure.in:
101 # BFD_BACKENDS = $(BFD32_BACKENDS)
102 # Change this (to MINIMIZE=1) to save space in executables.
103 # Currently, all this does is control the target_vector in targets.c.
108 #### host and target dependent Makefile fragments come in here.
113 "exec_prefix=$(exec_prefix)" \
114 "against=$(against)" \
116 "AR_FLAGS=$(AR_FLAGS)" \
118 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
121 "MAKEINFO=$(MAKEINFO)" \
122 "INSTALL=$(INSTALL)" \
123 "INSTALL_DATA=$(INSTALL_DATA)" \
124 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
128 $(CC) -c $(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $<
130 # C source files that correspond to .o's.
131 CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c \
132 archures.c coff-i386.c aout64.c aout32.c sunos.c demo64.c \
133 coff-i960.c srec.c tekhex.c oasys.c ieee.c coff-m68k.c \
134 coff-a29k.c coff-rs6000.c coff-msym.c coffgen.c format.c \
135 section.c core.c syms.c stab-syms.c reloc.c init.c ctor.c \
136 seclet.c coff-m88k.c coff-mips.c coff-sh.c trad-core.c newsos3.c \
137 i386aout.c i386linux.c bout.c aout-adobe.c coff-we32k.c \
138 i386bsd.c cpu-h8300.c cpu-i960.c cpu-sparc.c cpu-m68k.c \
139 cpu-m88k.c cpu-vax.c cpu-mips.c cpu-a29k.c cpu-i386.c \
140 cpu-rs6000.c coff-h8300.c hppa.c cpu-hppa.c cpu-we32k.c reloc16.c \
142 elf32.c elf32-sparc.c elf32-i386.c elf32-i860.c elf32-m68k.c \
143 elf32-hppa.c elf32-m88k.c elf32-mips.c elf32-generic.c \
145 coff-alpha.c cpu-alpha.c \
146 hp300hpux.c i386lynx.c
148 STAGESTUFF = $(TARGETLIB) $(OFILES)
150 all: Makefile $(TARGETLIB)
151 @$(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
160 @$(MAKE) subdir_do DO=$@ "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
163 @$(MAKE) subdir_do DO=clean-info "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
166 @$(MAKE) subdir_do DO=install-info "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
168 # HDEPFILES comes from the host config; TDEPFILES from the target config.
169 OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES)
172 rm -f ofiles2 ofiles ofiles3
174 for i in $(OFILES) ; do \
175 echo $$i >> ofiles2 ; \
177 sort < ofiles2 | uniq > ofiles3
179 rm -f ofiles2 ofiles3
181 $(TARGETLIB): $(OFILES) ofiles
183 @echo ofiles = `cat ofiles`
184 $(AR) $(AR_FLAGS) $(TARGETLIB) `cat ofiles`
185 $(RANLIB) $(TARGETLIB)
187 # When compiling archures.c and targets.c, supply the default target
188 # info from configure.
191 targets.o: targets.c Makefile
192 $(CC) -c $(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) -DMINIMIZE=$(MINIMIZE) $(TDEFAULTS) $<
194 archures.o: archures.c Makefile
195 $(CC) -c $(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) -DMINIMIZE=$(MINIMIZE) $(TDEFAULTS) $<
198 @for i in $(DODIRS); do \
199 if [ -d ./$$i ] ; then \
201 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
209 etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
212 rm -f *.o *~ core *.E *.p *.ip aout-params.h gen-aout
213 do_clean: do_mostlyclean
214 rm -f libbfd.a TAGS bfd.h stmp-bfd.h
215 do_distclean: do_clean
216 rm -f Makefile config.status sysdep.h
217 do_realclean: do_distclean
218 rm -f $(srcdir)/libcoff.h $(srcdir)/libbfd.h $(BFDIN_H)
220 mostlyclean: do_mostlyclean
221 $(MAKE) subdir_do DO=mostlyclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
223 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
225 $(MAKE) subdir_do DO=distclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
228 $(MAKE) subdir_do DO=realclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
231 # Mark everything as depending on config.status, since the timestamp on
232 # sysdep.h might actually move backwards if we reconfig and relink it
233 # to a different hosts/h-xxx.h file. This will force a recompile anyway.
234 RECONFIG = config.status
235 $(BFD_LIBS): libbfd.h $(BFD_H) $(RECONFIG)
236 $(BFD_MACHINES): libbfd.h $(BFD_H) $(RECONFIG)
237 $(BFD_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
238 $(OPTIONAL_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
240 # Get around a Sun Make bug in SunOS 4.1.1 with VPATH
241 cpu-i386.o:cpu-i386.c
243 cpu-h8500.o: cpu-h8500.c
244 cpu-we32k.o: cpu-we32k.c
247 #suppress 65 on bfd_map_over_sections
248 #suppress 66 on bfd_map_over_sections
249 #suppress 67 on bfd_map_over_sections
250 #suppress 68 on bfd_map_over_sections
251 #suppress 69 on bfd_map_over_sections
252 #suppress 70 on bfd_map_over_sections
253 #suppress 110 in bfd_map_over_sections
254 #suppress 112 in bfd_map_over_sections
256 #suppress 590 in swap_exec_header
257 #suppress 590 in _bfd_dummy_core_file_matches_executable_p
258 #suppress 590 in bfd_dont_truncate_arname
259 #suppress 590 on ignore
260 #suppress 590 on abfd
261 #setopt load_flags $(CFLAGS)
265 #-----------------------------------------------------------------------------
266 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
268 # 'VERSION' file must be present and contain a string of the form "x.y"
269 #-----------------------------------------------------------------------------
273 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
276 # This target should be invoked before building a new release.
277 # 'VERSION' file must be present and contain a string of the form "x.y"
281 MAJ=`sed 's/\..*//' VERSION` ; \
282 MIN=`sed 's/.*\.//' VERSION` ; \
283 V=$$MAJ.`expr $$MIN + 1` ; \
285 echo $$V >VERSION ; \
288 # Dummy target to force execution of dependent targets.
293 $(INSTALL_DATA) libbfd.a $(libdir)/libbfd.a
294 $(RANLIB) $(libdir)/libbfd.a
295 # Install BFD include file, and others that it needs. Install them
296 # both in GCC's include directory, and in the system include dir
297 # if configured as $(oldincludedir) -- which it usually isnt.
298 $(INSTALL_DATA) $(BFD_H) $(includedir)/bfd.h
299 $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(includedir)/ansidecl.h
300 $(INSTALL_DATA) $(INCDIR)/obstack.h $(includedir)/obstack.h
301 -if [ -z "$(oldincludedir)" ] ; then true ; \
302 else if [ -d $(oldincludedir) ] ; then true ; \
303 else mkdir $(oldincludedir) ; \
305 $(INSTALL_DATA) $(BFD_H) $(oldincludedir)/bfd.h;\
306 $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(oldincludedir)/ansidecl.h;\
307 $(INSTALL_DATA) $(INCDIR)/obstack.h $(oldincludedir)/obstack.h;\
309 @$(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
312 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
313 $(SHELL) ./config.status
318 host-aout.o: Makefile
320 # The following program can be used to generate a simple config file
321 # which can be folded into an h-XXX file for a new host, with some editing.
322 aout-params.h: gen-aout
323 ./gen-aout > aout-params.h
324 gen-aout: $(srcdir)/gen-aout.c Makefile
325 $(CC) -o gen-aout $(CFLAGS) $(LFLAGS) $(srcdir)/gen-aout.c
327 BFDIN_H= $(srcdir)/bfd-in2.h
329 $(BFD_H): stmp-bfd.h ; @true
331 # The file ../include/bfd.h is from earlier attempts to get this right.
332 # If the file is still there, kill it.
333 stmp-bfd.h : $(BFDIN_H) Makefile
334 rm -f bfd.h2 64 ../include/bfd.h
335 -grep HOST_64_BIT sysdep.h > 64
336 sed -e 's/@WORDSIZE@/$(WORDSIZE)/' -e '/64-bit.*sysdep.h/ r 64' < $(BFDIN_H) > bfd.h2
337 $(srcdir)/../move-if-change bfd.h2 $(BFD_H)
341 # Could really use a "copy-if-change"...
343 (cd $(docdir); $(MAKE) protos $(FLAGS_TO_PASS))
344 cp $(docdir)/bfd.h bfd.h-new
345 $(srcdir)/../move-if-change bfd.h-new $(BFDIN_H)
346 cp $(docdir)/libbfd.h libbfd.h-new
347 $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
348 cp $(docdir)/libcoff.h libcoff.h-new
349 $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
352 (cd $(docdir); $(MAKE) bfd.info $(FLAGS_TO_PASS))
355 (cd $(docdir); $(MAKE) bfd.dvi $(FLAGS_TO_PASS))
358 (cd $(docdir); $(MAKE) bfd.ps $(FLAGS_TO_PASS))
360 # What appears below is generated by a hacked mkdep using gcc -MM.
362 # DO NOT DELETE THIS LINE -- mkdep uses it.
363 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
365 libbfd.o : libbfd.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h
366 opncls.o : opncls.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h
367 bfd.o : bfd.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
368 $(INCDIR)/coff/sym.h libecoff.h
369 archive.o : archive.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
370 $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h
371 targets.o : targets.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h
372 cache.o : cache.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h
373 archures.o : archures.c $(BFD_H) $(INCDIR)/obstack.h
375 aout32.o : aout32.c aoutx.h $(BFD_H) $(INCDIR)/ansidecl.h \
376 $(INCDIR)/obstack.h libaout.h libbfd.h $(INCDIR)/aout/aout64.h \
377 $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
378 sunos.o : sunos.c aoutf1.h $(BFD_H) $(INCDIR)/obstack.h \
379 libaout.h libbfd.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
380 $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
381 hp300hpux.o : hp300hpux.c aoutx.h $(BFD_H) $(INCDIR)/ansidecl.h \
382 $(INCDIR)/obstack.h libaout.h libbfd.h $(INCDIR)/aout/aout64.h \
383 $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
384 $(INCDIR)/aout/hp300hpux.h aout-target.h
387 srec.o : srec.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h
388 oasys.o : oasys.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
389 $(INCDIR)/oasys.h liboasys.h
390 ieee.o : ieee.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
391 $(INCDIR)/ieee.h libieee.h
392 coff-h8300.o: coff-h8300.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
393 $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
395 coff-h8500.o: coff-h8500.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
396 $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
398 coff-a29k.o: coff-a29k.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
399 $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
401 coff-i386.o: coff-i386.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
402 $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
404 coff-i960.o: coff-i960.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
405 $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
407 coff-m68k.o: coff-m68k.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
408 $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
410 coff-m88k.o: coff-m88k.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
411 $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
413 coff-mips.o: coff-mips.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
414 $(INCDIR)/coff/mips.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
415 coffswap.h seclet.h libecoff.h
416 coff-rs6000.o: coff-rs6000.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
417 $(INCDIR)/coff/rs6000.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
419 coff-z8k.o: coff-z8k.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
420 $(INCDIR)/coff/z8k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
422 coff-we32k.o: coff-we32k.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
423 $(INCDIR)/coff/we32k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h \
425 coffgen.o: coffgen.c $(BFD_H) libbfd.h $(INCDIR)/coff/internal.h \
427 reloc16.o: reloc16.c $(BFD_H) libbfd.h $(INCDIR)/coff/internal.h \
429 format.o : format.c $(BFD_H) \
430 $(INCDIR)/obstack.h libbfd.h
431 section.o : section.c $(BFD_H) \
432 $(INCDIR)/obstack.h libbfd.h
433 core.o : core.c $(BFD_H) \
434 $(INCDIR)/obstack.h libbfd.h
435 syms.o : syms.c $(BFD_H) \
436 $(INCDIR)/obstack.h libbfd.h
438 reloc.o : reloc.c $(BFD_H) \
439 $(INCDIR)/obstack.h libbfd.h
441 trad-core.o : trad-core.c $(BFD_H) $(INCDIR)/obstack.h \
444 coff-msym.o: coff-msym.c $(BFD_H) $(INCDIR)/coff/ecoff-ext.h \
445 $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h
447 newsos3.o : newsos3.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
448 $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
449 $(INCDIR)/aout/ar.h libaout.h
450 i386lynx.o : i386lynx.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
451 $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
452 $(INCDIR)/aout/ar.h libaout.h
453 i386aout.o : i386aout.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
454 $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
455 $(INCDIR)/aout/ar.h libaout.h
456 i386linux.o : i386linux.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
457 $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
458 $(INCDIR)/aout/ar.h libaout.h
459 i386bsd.o : i386bsd.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
460 $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
461 $(INCDIR)/aout/ar.h libaout.h
462 bout.o : bout.c $(BFD_H) $(INCDIR)/obstack.h libbfd.h \
463 $(INCDIR)/bout.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h
464 mipsbsd.o : mipsbsd.c $(BFD_H) $(INCDIR)/obstack.h \
466 elf.o : elf.c libelf.h libbfd.h $(BFD_H) $(INCDIR)/obstack.h
467 elf32.o : elf32.c elfcode.h libelf.h libbfd.h $(BFD_H) \
469 elf32-sparc.o : elf32-sparc.c libelf.h libbfd.h $(BFD_H) \
471 elf32-m68k.o : elf32-m68k.c libelf.h libbfd.h $(BFD_H) \
473 elf32-i860.o : elf32-i860.c libelf.h libbfd.h $(BFD_H) \
475 elf32-i386.o : elf32-i386.c libelf.h libbfd.h $(BFD_H) \
477 elf32-hppa.o : elf32-hppa.c $(srcdir)/elf32-hppa.h libelf.h libbfd.h \
478 $(BFD_H) $(INCDIR)/obstack.h
479 elf32-m88k.o : elf32-m88k.c libelf.h libbfd.h \
480 $(BFD_H) $(INCDIR)/obstack.h
481 elf32-mips.o : elf32-mips.c libelf.h libbfd.h \
482 $(BFD_H) $(INCDIR)/obstack.h
483 elf32-generic.o : elf32-generic.c libelf.h libbfd.h \
484 $(BFD_H) $(INCDIR)/obstack.h
485 elf64.o : elf64.c elfcode.h libelf.h libbfd.h $(BFD_H) \
487 elf64-generic.o : elf64-generic.c libelf.h libbfd.h \
488 $(BFD_H) $(INCDIR)/obstack.h
490 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY