1 # Makefile template for Configure for the BFD library.
2 # Copyright (C) 1990, 1991 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 libdir = $(ddestdir)/lib
26 docdir = $(srcdir)/doc
31 INCDIR = $(srcdir)/../include
32 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
38 #### host and target dependent Makefile fragments come in here.
42 CFLAGS = $(MINUS_G) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # -DINTEL960VERSION
45 BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o \
46 archures.o core.o section.o format.o syms.o reloc.o init.o ctor.o
48 BFD_MACHINES = cpu-h8300.o cpu-i960.o cpu-sparc.o cpu-m68k.o cpu-m88k.o \
49 cpu-vax.o cpu-mips.o cpu-a29k.o cpu-i386.o cpu-rs6000.o
51 BFD_BACKENDS = oasys.o ieee.o srec.o elf.o \
52 aout64.o aout32.o demo64.o sunos.o newsos3.o i386aout.o bout.o \
53 coff-i960.o coff-a29k.o coff-m68k.o coff-i386.o coff-m88k.o \
54 coff-mips.o coff-rs6000.o
56 OPTIONAL_BACKENDS = trad-core.o
60 # C source files that correspond to .o's.
61 CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c archures.c \
62 coff-i386.c aout64.c aout32.c sunos.c demo64.c coff-i960.c srec.c \
63 oasys.c ieee.c coff-m68k.c coff-a29k.c coff-rs6000.c \
64 format.c section.c core.c syms.c reloc.c init.c ctor.c \
65 coff-m88k.c coff-mips.c trad-core.c newsos3.c i386aout.c bout.c elf.c \
66 cpu-h8300.c cpu-i960.c cpu-sparc.c cpu-m68k.c cpu-m88k.c \
67 cpu-vax.c cpu-mips.c cpu-a29k.c cpu-i386.c cpu-rs6000.c
69 STAGESTUFF = $(TARGETLIB) $(OFILES)
72 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)"
74 # HDEPFILES comes from the host config; TDEPFILES from the target config.
75 OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES)
77 $(TARGETLIB): $(OFILES)
79 $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES)
80 $(RANLIB) $(TARGETLIB)
82 # When compiling targets.c, supply the default target info from configure.
84 $(CC) $(CFLAGS) -c $(TDEFAULTS) $<
87 for i in $(DODIRS); do \
88 if [ -d $(unsubdir)/$$i ] ; then \
89 if (cd $(unsubdir)/$$i$(subdir); \
91 "against=$(against)" \
94 "AR_FLAGS=$(AR_FLAGS)" \
96 "BISON=$(BISON)" $(DO)) ; then true ; \
103 - mv -f $(STAGESTUFF) stage1
104 $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
108 - mv -f $(STAGESTUFF) stage2
109 $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
113 - mv -f $(STAGESTUFF) stage3
114 $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
119 for i in *.o ; do cmp $$i $(against)/$$i || exit 1 ; done
120 $(MAKE) subdir_do DO=comparison "DODIRS=$(SUBDIRS)"
123 - (cd stage1 ; mv -f $(STAGESTUFF) ..)
125 $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
128 - (cd stage2 ; mv -f $(STAGESTUFF) ..)
130 $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
133 - (cd stage3 ; mv -f $(STAGESTUFF) ..)
135 $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
140 etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
143 rm -f *.[oa] *~ core *.E *.p *.ip
144 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)"
146 clobber realclean: clean
148 $(MAKE) subdir_do DO=clobber "DODIRS=$(SUBDIRS)"
150 # Mark everything as depending on config.status, since the timestamp on
151 # sysdep.h might actually move backwards if we reconfig and relink it
152 # to a different hosts/h-xxx.h file. This will force a recompile anyway.
153 RECONFIG = config.status
154 $(BFD_LIBS): libbfd.h $(BFD_H) $(RECONFIG)
155 $(BFD_MACHINES): libbfd.h $(BFD_H) $(RECONFIG)
156 $(BFD_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
157 $(OPTIONAL_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
159 # Get around a Sun Make bug in SunOS 4.1.1 with VPATH
160 cpu-i386.o:cpu-i386.c
163 #suppress 65 on bfd_map_over_sections
164 #suppress 66 on bfd_map_over_sections
165 #suppress 67 on bfd_map_over_sections
166 #suppress 68 on bfd_map_over_sections
167 #suppress 69 on bfd_map_over_sections
168 #suppress 70 on bfd_map_over_sections
169 #suppress 110 in bfd_map_over_sections
170 #suppress 112 in bfd_map_over_sections
172 #suppress 590 in swap_exec_header
173 #suppress 590 in _bfd_dummy_core_file_matches_executable_p
174 #suppress 590 in bfd_dont_truncate_arname
175 #suppress 590 on ignore
176 #suppress 590 on abfd
177 #setopt load_flags $(CFLAGS)
181 #-----------------------------------------------------------------------------
182 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
184 # 'VERSION' file must be present and contain a string of the form "x.y"
185 #-----------------------------------------------------------------------------
189 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
192 # This target should be invoked before building a new release.
193 # 'VERSION' file must be present and contain a string of the form "x.y"
197 MAJ=`sed 's/\..*//' VERSION` ; \
198 MIN=`sed 's/.*\.//' VERSION` ; \
199 V=$$MAJ.`expr $$MIN + 1` ; \
201 echo $$V >VERSION ; \
204 # Dummy target to force execution of dependent targets.
209 cp libbfd.a $(libdir)/libbfd.a.new
210 $(RANLIB) $(libdir)/libbfd.a.new
211 mv -f $(libdir)/libbfd.a.new $(libdir)/libbfd.a
212 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)"
214 # Target to uncomment host-specific lines in this makefile. Such lines must
215 # have the following string beginning in column 1: #__<hostname>__#
216 # Original Makefile is backed up as 'Makefile.old'.
218 # Invoke with: make make HOST=xxx
221 -@if test $(HOST)x = x ; then \
222 echo '
\aSpecify "make make HOST=???"'; \
225 grep -s "^#The next line was generated by 'make make'" Makefile; \
226 if test $$? = 0 ; then \
227 echo "
\aMakefile has already been processed with 'make make'";\
230 mv -f Makefile Makefile.old; \
231 echo "#The next line was generated by 'make make'" >Makefile ; \
232 echo "HOST=$(HOST)" >>Makefile ; \
234 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
236 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
237 $(SHELL) ./config.status
245 cp $(srcdir)/bfd-in.h $(docdir)
246 cp $(srcdir)/libbfd-in.h $(docdir)
247 cp $(srcdir)/libcoff-in.h $(docdir)
248 (cd $(docdir); $(MAKE) protos)
249 # Rebuild prototypes in bfd.h
250 cp $(docdir)/bfd.h $(BFD_H)
251 cp $(docdir)/libbfd.h $(srcdir)/libbfd.h
252 cp $(docdir)/libcoff.h $(srcdir)/libcoff.h
253 rm -f $(docdir)/bfd-in.h
254 rm -f $(docdir)/libbfd-in.h
255 rm -f $(docdir)/libcoff-in.h
258 ( cd $(docdir); $(MAKE) bfd.info)
261 (cd $(docdir); $(MAKE) bfd.dvi)
264 (cd $(docdir); $(MAKE) bfd.ps)
266 # What appears below is generated by a hacked mkdep using gcc -MM.
268 # DO NOT DELETE THIS LINE -- mkdep uses it.
269 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
271 libbfd.o : libbfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
272 opncls.o : opncls.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
273 bfd.o : bfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
274 archive.o : archive.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
275 $(INCDIR)/ar.h $(INCDIR)/ranlib.h
276 targets.o : targets.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
277 cache.o : cache.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
278 archures.o : archures.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h
279 coff-i386.o : coff-i386.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
280 $(INCDIR)/coff-i386.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
282 aout32.o : aout32.c aoutx.h $(INCDIR)/bfd.h $(INCDIR)/ansidecl.h \
283 $(INCDIR)/obstack.h libaout.h libbfd.h $(INCDIR)/aout64.h \
284 $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def $(INCDIR)/ar.h
285 sunos.o : sunos.c aoutf1.h $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
286 libaout.h libbfd.h $(INCDIR)/aout64.h $(INCDIR)/stab.gnu.h \
287 $(INCDIR)/stab.def $(INCDIR)/ar.h
289 coff-i960.o : coff-i960.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
290 $(INCDIR)/coff-i960.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
291 srec.o : srec.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
292 oasys.o : oasys.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
293 $(INCDIR)/oasys.h liboasys.h
294 ieee.o : ieee.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
295 $(INCDIR)/ieee.h libieee.h
296 coff-m68k.o : coff-m68k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
297 $(INCDIR)/coff-m68k.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
298 coff-a29k.o : coff-a29k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
299 $(INCDIR)/coff-a29k.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
300 coff-rs6000.o: coff-rs6000.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
301 $(INCDIR)/coff-rs6000.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
302 format.o : format.c $(INCDIR)/bfd.h \
303 $(INCDIR)/obstack.h libbfd.h
304 section.o : section.c $(INCDIR)/bfd.h \
305 $(INCDIR)/obstack.h libbfd.h
306 core.o : core.c $(INCDIR)/bfd.h \
307 $(INCDIR)/obstack.h libbfd.h
308 syms.o : syms.c $(INCDIR)/bfd.h \
309 $(INCDIR)/obstack.h libbfd.h
310 reloc.o : reloc.c $(INCDIR)/bfd.h \
311 $(INCDIR)/obstack.h libbfd.h
312 coff-m88k.o : coff-m88k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
313 $(INCDIR)/coff-m88k.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
314 coff-mips.o : coff-mips.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
315 $(INCDIR)/coff-mips.h $(INCDIR)/internalcoff.h libcoff.h trad-core.h \
317 trad-core.o : trad-core.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
319 newsos3.o : newsos3.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
320 $(INCDIR)/aout64.h $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def \
321 $(INCDIR)/ar.h libaout.h
322 i386aout.o : i386aout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
323 $(INCDIR)/aout64.h $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def \
324 $(INCDIR)/ar.h libaout.h
325 bout.o : bout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
326 $(INCDIR)/bout.h $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def libaout.h
328 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY