Quit moving *-in.h into and out of doc subdir. Doc subdir knows how
[binutils-gdb.git] / bfd / Makefile.in
1 # Makefile template for Configure for the BFD library.
2 # Copyright (C) 1990, 1991 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 ddestdir = /usr/local
25 libdir = $(ddestdir)/lib
26 docdir = $(srcdir)/doc
27 includedir= $(ddestdir)/include
28 RANLIB = ranlib
29 AR = ar
30 AR_FLAGS = clq
31 INCDIR = $(srcdir)/../include
32 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
33 DEP = mkdep
34 MINUS_G=-g
35
36 SUBDIRS = doc
37
38 #### host and target dependent Makefile fragments come in here.
39 ###
40
41 TARGETLIB = libbfd.a
42 CFLAGS = $(MINUS_G) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # -DINTEL960VERSION
43
44
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
47
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
50
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
55
56 OPTIONAL_BACKENDS = trad-core.o
57
58 BFD_H=$(INCDIR)/bfd.h
59
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
68
69 STAGESTUFF = $(TARGETLIB) $(OFILES)
70
71 all: $(TARGETLIB)
72 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)"
73
74 all-info: force
75 $(MAKE) subdir_do DO=all-info "DODIRS=$(SUBDIRS)"
76
77 install-info: force
78 $(MAKE) subdir_do DO=install-info "DODIRS=$(SUBDIRS)"
79
80 # HDEPFILES comes from the host config; TDEPFILES from the target config.
81 OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES)
82
83 $(TARGETLIB): $(OFILES)
84 rm -f $(TARGETLIB)
85 $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES)
86 $(RANLIB) $(TARGETLIB)
87
88 # When compiling targets.c, supply the default target info from configure.
89 targets.o: targets.c
90 $(CC) $(CFLAGS) -c $(TDEFAULTS) $<
91
92 subdir_do: force
93 for i in $(DODIRS); do \
94 if [ -d $(unsubdir)/$$i ] ; then \
95 if (cd $(unsubdir)/$$i$(subdir); \
96 $(MAKE) \
97 "against=$(against)" \
98 "AR=$(AR)" \
99 "CC=$(CC)" \
100 "AR_FLAGS=$(AR_FLAGS)" \
101 "RANLIB=$(RANLIB)" \
102 "BISON=$(BISON)" $(DO)) ; then true ; \
103 else exit 1 ; fi ; \
104 else true ; fi ; \
105 done
106
107 stage1: force
108 - mkdir stage1
109 - mv -f $(STAGESTUFF) stage1
110 $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
111
112 stage2: force
113 - mkdir stage2
114 - mv -f $(STAGESTUFF) stage2
115 $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
116
117 stage3: force
118 - mkdir stage3
119 - mv -f $(STAGESTUFF) stage3
120 $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
121
122 against=stage2
123
124 comparison: force
125 for i in *.o ; do cmp $$i $(against)/$$i || exit 1 ; done
126 $(MAKE) subdir_do DO=comparison "DODIRS=$(SUBDIRS)"
127
128 de-stage1: force
129 - (cd stage1 ; mv -f $(STAGESTUFF) ..)
130 - rmdir stage1
131 $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
132
133 de-stage2: force
134 - (cd stage2 ; mv -f $(STAGESTUFF) ..)
135 - rmdir stage2
136 $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
137
138 de-stage3: force
139 - (cd stage3 ; mv -f $(STAGESTUFF) ..)
140 - rmdir stage3
141 $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
142
143 tags etags: TAGS
144
145 TAGS: force
146 etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
147
148 clean:
149 rm -f *.[oa] *~ core *.E *.p *.ip
150 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)"
151
152 clobber realclean: clean
153 rm -f libbfd.a TAGS
154 $(MAKE) subdir_do DO=clobber "DODIRS=$(SUBDIRS)"
155
156 # Mark everything as depending on config.status, since the timestamp on
157 # sysdep.h might actually move backwards if we reconfig and relink it
158 # to a different hosts/h-xxx.h file. This will force a recompile anyway.
159 RECONFIG = config.status
160 $(BFD_LIBS): libbfd.h $(BFD_H) $(RECONFIG)
161 $(BFD_MACHINES): libbfd.h $(BFD_H) $(RECONFIG)
162 $(BFD_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
163 $(OPTIONAL_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG)
164
165 # Get around a Sun Make bug in SunOS 4.1.1 with VPATH
166 cpu-i386.o:cpu-i386.c
167
168 saber:
169 #suppress 65 on bfd_map_over_sections
170 #suppress 66 on bfd_map_over_sections
171 #suppress 67 on bfd_map_over_sections
172 #suppress 68 on bfd_map_over_sections
173 #suppress 69 on bfd_map_over_sections
174 #suppress 70 on bfd_map_over_sections
175 #suppress 110 in bfd_map_over_sections
176 #suppress 112 in bfd_map_over_sections
177 #suppress 530
178 #suppress 590 in swap_exec_header
179 #suppress 590 in _bfd_dummy_core_file_matches_executable_p
180 #suppress 590 in bfd_dont_truncate_arname
181 #suppress 590 on ignore
182 #suppress 590 on abfd
183 #setopt load_flags $(CFLAGS)
184 #load $(CFILES)
185
186
187 #-----------------------------------------------------------------------------
188 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
189 #
190 # 'VERSION' file must be present and contain a string of the form "x.y"
191 #-----------------------------------------------------------------------------
192
193 ver960.c: FORCE
194 rm -f ver960.c
195 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
196
197
198 # This target should be invoked before building a new release.
199 # 'VERSION' file must be present and contain a string of the form "x.y"
200 #
201 roll:
202 @V=`cat VERSION` ; \
203 MAJ=`sed 's/\..*//' VERSION` ; \
204 MIN=`sed 's/.*\.//' VERSION` ; \
205 V=$$MAJ.`expr $$MIN + 1` ; \
206 rm -f VERSION ; \
207 echo $$V >VERSION ; \
208 echo Version $$V
209
210 # Dummy target to force execution of dependent targets.
211 #
212 force:
213
214 install:
215 cp libbfd.a $(libdir)/libbfd.a.new
216 $(RANLIB) $(libdir)/libbfd.a.new
217 mv -f $(libdir)/libbfd.a.new $(libdir)/libbfd.a
218 cp $(INCDIR)/bfd.h $(includedir)/bfd.h
219 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)"
220
221 # Target to uncomment host-specific lines in this makefile. Such lines must
222 # have the following string beginning in column 1: #__<hostname>__#
223 # Original Makefile is backed up as 'Makefile.old'.
224 #
225 # Invoke with: make make HOST=xxx
226 #
227 make:
228 -@if test $(HOST)x = x ; then \
229 echo '\aSpecify "make make HOST=???"'; \
230 exit 1; \
231 fi ; \
232 grep -s "^#The next line was generated by 'make make'" Makefile; \
233 if test $$? = 0 ; then \
234 echo "\aMakefile has already been processed with 'make make'";\
235 exit 1; \
236 fi ; \
237 mv -f Makefile Makefile.old; \
238 echo "#The next line was generated by 'make make'" >Makefile ; \
239 echo "HOST=$(HOST)" >>Makefile ; \
240 echo >>Makefile ; \
241 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
242
243 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
244 $(SHELL) ./config.status
245
246 dep: $(CFILES)
247 mkdep $(CFLAGS) $?
248
249
250
251 headers:
252 (cd $(docdir); $(MAKE) protos)
253 # Rebuild prototypes in bfd.h
254 cp $(docdir)/bfd.h $(BFD_H)
255 cp $(docdir)/libbfd.h $(srcdir)/libbfd.h
256 cp $(docdir)/libcoff.h $(srcdir)/libcoff.h
257
258 bfd.info:
259 ( cd $(docdir); $(MAKE) bfd.info)
260
261 bfd.dvi:
262 (cd $(docdir); $(MAKE) bfd.dvi)
263
264 bfd.ps:
265 (cd $(docdir); $(MAKE) bfd.ps)
266
267 # What appears below is generated by a hacked mkdep using gcc -MM.
268
269 # DO NOT DELETE THIS LINE -- mkdep uses it.
270 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
271
272 libbfd.o : libbfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
273 opncls.o : opncls.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
274 bfd.o : bfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
275 archive.o : archive.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
276 $(INCDIR)/ar.h $(INCDIR)/ranlib.h
277 targets.o : targets.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
278 cache.o : cache.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
279 archures.o : archures.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h
280 coff-i386.o : coff-i386.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
281 $(INCDIR)/coff-i386.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
282 aout64.o : aout64.c
283 aout32.o : aout32.c aoutx.h $(INCDIR)/bfd.h $(INCDIR)/ansidecl.h \
284 $(INCDIR)/obstack.h libaout.h libbfd.h $(INCDIR)/aout64.h \
285 $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def $(INCDIR)/ar.h
286 sunos.o : sunos.c aoutf1.h $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
287 libaout.h libbfd.h $(INCDIR)/aout64.h $(INCDIR)/stab.gnu.h \
288 $(INCDIR)/stab.def $(INCDIR)/ar.h
289 demo64.o : demo64.c
290 coff-i960.o : coff-i960.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
291 $(INCDIR)/coff-i960.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
292 srec.o : srec.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h
293 oasys.o : oasys.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
294 $(INCDIR)/oasys.h liboasys.h
295 ieee.o : ieee.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
296 $(INCDIR)/ieee.h libieee.h
297 coff-m68k.o : coff-m68k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
298 $(INCDIR)/coff-m68k.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
299 coff-a29k.o : coff-a29k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
300 $(INCDIR)/coff-a29k.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
301 coff-rs6000.o: coff-rs6000.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
302 $(INCDIR)/coff-rs6000.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
303 format.o : format.c $(INCDIR)/bfd.h \
304 $(INCDIR)/obstack.h libbfd.h
305 section.o : section.c $(INCDIR)/bfd.h \
306 $(INCDIR)/obstack.h libbfd.h
307 core.o : core.c $(INCDIR)/bfd.h \
308 $(INCDIR)/obstack.h libbfd.h
309 syms.o : syms.c $(INCDIR)/bfd.h \
310 $(INCDIR)/obstack.h libbfd.h
311 reloc.o : reloc.c $(INCDIR)/bfd.h \
312 $(INCDIR)/obstack.h libbfd.h
313 coff-m88k.o : coff-m88k.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
314 $(INCDIR)/coff-m88k.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h
315 coff-mips.o : coff-mips.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
316 $(INCDIR)/coff-mips.h $(INCDIR)/internalcoff.h libcoff.h trad-core.h \
317 coffcode.h
318 trad-core.o : trad-core.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
319 libbfd.h libaout.h
320 newsos3.o : newsos3.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
321 $(INCDIR)/aout64.h $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def \
322 $(INCDIR)/ar.h libaout.h
323 i386aout.o : i386aout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
324 $(INCDIR)/aout64.h $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def \
325 $(INCDIR)/ar.h libaout.h
326 bout.o : bout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
327 $(INCDIR)/bout.h $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def libaout.h
328
329 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
330