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.
27 bindir = $(prefix)/bin
28 datadir = $(prefix)/lib
29 libdir = $(prefix)/lib
30 mandir = $(datadir)/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 = $(datadir)/info
41 includedir = $(prefix)/include
42 docdir = $(srcdir)/doc
47 INSTALL_PROGRAM = $(INSTALL)
48 INSTALL_DATA = $(INSTALL)
56 INCDIR = $(srcdir)/../include
57 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
64 # Change this (to MINIMIZE=1) to save space in executables.
65 # Currently, all this does is control the target_vector in targets.c.
69 CFLAGS = $(MINUS_G) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # -DINTEL960VERSION
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 ctor.o seclet.o
75 BFD_MACHINES = cpu-h8300.o cpu-i960.o cpu-sparc.o cpu-m68k.o cpu-m88k.o \
76 cpu-vax.o cpu-mips.o cpu-a29k.o cpu-i386.o cpu-rs6000.o
78 BFD_BACKENDS = oasys.o ieee.o srec.o elf.o stab-syms.o\
79 aout64.o aout32.o demo64.o sunos.o newsos3.o i386aout.o bout.o \
80 coff-i960.o coff-a29k.o coff-m68k.o coff-i386.o coff-m88k.o \
81 coff-mips.o coff-rs6000.o coff-h8300.o
83 OPTIONAL_BACKENDS = trad-core.o
85 #### host and target dependent Makefile fragments come in here.
90 # C source files that correspond to .o's.
91 CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c archures.c \
92 coff-i386.c aout64.c aout32.c sunos.c demo64.c coff-i960.c srec.c \
93 oasys.c ieee.c coff-m68k.c coff-a29k.c coff-rs6000.c \
94 format.c section.c core.c syms.c stab-syms.c reloc.c init.c ctor.c seclet.c \
95 coff-m88k.c coff-mips.c trad-core.c newsos3.c i386aout.c bout.c elf.c \
96 cpu-h8300.c cpu-i960.c cpu-sparc.c cpu-m68k.c cpu-m88k.c \
97 cpu-vax.c cpu-mips.c cpu-a29k.c cpu-i386.c cpu-rs6000.c coff-h8300.c
99 STAGESTUFF = $(TARGETLIB) $(OFILES)
102 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)"
105 $(MAKE) subdir_do DO=info "DODIRS=$(SUBDIRS)"
108 $(MAKE) subdir_do DO=install-info "DODIRS=$(SUBDIRS)"
110 # HDEPFILES comes from the host config; TDEPFILES from the target config.
111 OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES)
113 $(TARGETLIB): $(OFILES)
115 $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES)
116 $(RANLIB) $(TARGETLIB)
118 # When compiling targets.c, supply the default target info from configure.
120 $(CC) $(CFLAGS) -c -DMINIMIZE=$(MINIMIZE) $(TDEFAULTS) $<
123 for i in $(DODIRS); do \
124 if [ -d $(unsubdir)/$$i ] ; then \
125 if (cd $(unsubdir)/$$i$(subdir); \
127 "against=$(against)" \
129 "AR_FLAGS=$(AR_FLAGS)" \
132 "BISON=$(BISON)" $(DO)) ; then true ; \
139 - mv -f $(STAGESTUFF) stage1
140 $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
144 - mv -f $(STAGESTUFF) stage2
145 $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
149 - mv -f $(STAGESTUFF) stage3
150 $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
155 for i in *.o ; do cmp $$i $(against)/$$i || exit 1 ; done
156 $(MAKE) subdir_do DO=comparison "DODIRS=$(SUBDIRS)"
159 - (cd stage1 ; mv -f $(STAGESTUFF) ..)
161 $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
164 - (cd stage2 ; mv -f $(STAGESTUFF) ..)
166 $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
169 - (cd stage3 ; mv -f $(STAGESTUFF) ..)
171 $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
176 etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
179 rm -f *.[oa] *~ core *.E *.p *.ip aout-params.h gen-aout
180 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)"
182 clobber realclean: clean
184 $(MAKE) subdir_do DO=clobber "DODIRS=$(SUBDIRS)"
186 # Mark everything as depending on config.status, since the timestamp on
187 # sysdep.h might actually move backwards if we reconfig and relink it
188 # to a different hosts/h-xxx.h file. This will force a recompile anyway.
189 RECONFIG = config.status
190 $(BFD_LIBS): libbfd.h $(BFD_H) $(RECONFIG)
191 $(BFD_MACHINES): libbfd.h $(BFD_H) $(RECONFIG)
192 $(BFD_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
193 $(OPTIONAL_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
195 # Get around a Sun Make bug in SunOS 4.1.1 with VPATH
196 cpu-i386.o:cpu-i386.c
199 #suppress 65 on bfd_map_over_sections
200 #suppress 66 on bfd_map_over_sections
201 #suppress 67 on bfd_map_over_sections
202 #suppress 68 on bfd_map_over_sections
203 #suppress 69 on bfd_map_over_sections
204 #suppress 70 on bfd_map_over_sections
205 #suppress 110 in bfd_map_over_sections
206 #suppress 112 in bfd_map_over_sections
208 #suppress 590 in swap_exec_header
209 #suppress 590 in _bfd_dummy_core_file_matches_executable_p
210 #suppress 590 in bfd_dont_truncate_arname
211 #suppress 590 on ignore
212 #suppress 590 on abfd
213 #setopt load_flags $(CFLAGS)
217 #-----------------------------------------------------------------------------
218 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
220 # 'VERSION' file must be present and contain a string of the form "x.y"
221 #-----------------------------------------------------------------------------
225 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
228 # This target should be invoked before building a new release.
229 # 'VERSION' file must be present and contain a string of the form "x.y"
233 MAJ=`sed 's/\..*//' VERSION` ; \
234 MIN=`sed 's/.*\.//' VERSION` ; \
235 V=$$MAJ.`expr $$MIN + 1` ; \
237 echo $$V >VERSION ; \
240 # Dummy target to force execution of dependent targets.
245 $(INSTALL_DATA) libbfd.a $(libdir)/libbfd.a
246 $(RANLIB) $(libdir)/libbfd.a
247 $(INSTALL_DATA) $(INCDIR)/bfd.h $(includedir)/bfd.h
248 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)"
250 # Target to uncomment host-specific lines in this makefile. Such lines must
251 # have the following string beginning in column 1: #__<hostname>__#
252 # Original Makefile is backed up as 'Makefile.old'.
254 # Invoke with: make make HOST=xxx
257 -@if test $(HOST)x = x ; then \
258 echo '
\aSpecify "make make HOST=???"'; \
261 grep -s "^#The next line was generated by 'make make'" Makefile; \
262 if test $$? = 0 ; then \
263 echo "
\aMakefile has already been processed with 'make make'";\
266 mv -f Makefile Makefile.old; \
267 echo "#The next line was generated by 'make make'" >Makefile ; \
268 echo "HOST=$(HOST)" >>Makefile ; \
270 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
272 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
273 $(SHELL) ./config.status
278 gen-aout: $(srcdir)/gen-aout.c
279 $(CC) -o gen-aout $(CFLAGS) $(LFLAGS) $(srcdir)/gen-aout.c
281 aout-params.h: gen-aout
282 ./gen-aout > aout-params.h
284 host-aout.o: aout-params.h
287 (cd $(docdir); $(MAKE) protos)
288 # Rebuild prototypes in bfd.h
289 cp $(docdir)/bfd.h $(BFD_H)
290 cp $(docdir)/libbfd.h $(srcdir)/libbfd.h
291 cp $(docdir)/libcoff.h $(srcdir)/libcoff.h
294 ( cd $(docdir); $(MAKE) bfd.info)
297 (cd $(docdir); $(MAKE) bfd.dvi)
300 (cd $(docdir); $(MAKE) bfd.ps)
302 # What appears below is generated by a hacked mkdep using gcc -MM.
304 # DO NOT DELETE THIS LINE -- mkdep uses it.
305 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
307 libbfd.o : libbfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
308 opncls.o : opncls.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
309 bfd.o : bfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
310 archive.o : archive.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
311 $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h
312 targets.o : targets.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
313 cache.o : cache.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
314 archures.o : archures.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h
316 aout32.o : aout32.c aoutx.h $(INCDIR)/bfd.h $(INCDIR)/ansidecl.h \
317 $(INCDIR)/obstack.h libaout.h libbfd.h $(INCDIR)/aout/aout64.h \
318 $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
319 sunos.o : sunos.c aoutf1.h $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
320 libaout.h libbfd.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
321 $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
324 srec.o : srec.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
325 oasys.o : oasys.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
326 $(INCDIR)/oasys.h liboasys.h
327 ieee.o : ieee.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
328 $(INCDIR)/ieee.h libieee.h
329 coff-h8300.o: coff-h8300.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
330 $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
331 coff-a29k.o: coff-a29k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
332 $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
333 coff-i386.o: coff-i386.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
334 $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
335 coff-i960.o: coff-i960.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
336 $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
337 coff-m68k.o: coff-m68k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
338 $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
339 coff-m88k.o: coff-m88k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
340 $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
341 coff-mips.o: coff-mips.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
342 $(INCDIR)/coff/mips.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
343 coff-rs6000.o: coff-rs6000.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
344 $(INCDIR)/coff/rs6000.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h
345 format.o : format.c $(INCDIR)/bfd.h \
346 $(INCDIR)/obstack.h libbfd.h
347 section.o : section.c $(INCDIR)/bfd.h \
348 $(INCDIR)/obstack.h libbfd.h
349 core.o : core.c $(INCDIR)/bfd.h \
350 $(INCDIR)/obstack.h libbfd.h
351 syms.o : syms.c $(INCDIR)/bfd.h \
352 $(INCDIR)/obstack.h libbfd.h
354 reloc.o : reloc.c $(INCDIR)/bfd.h \
355 $(INCDIR)/obstack.h libbfd.h
357 trad-core.o : trad-core.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
359 newsos3.o : newsos3.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
360 $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
361 $(INCDIR)/aout/ar.h libaout.h
362 i386aout.o : i386aout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
363 $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
364 $(INCDIR)/aout/ar.h libaout.h
365 bout.o : bout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
366 $(INCDIR)/bout.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h
368 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY