]>
Commit | Line | Data |
---|---|---|
3c8a3c56 | 1 | # Makefile template for Configure for the BFD library. |
a26878d1 | 2 | # Copyright (C) 1990, 1991 Free Software Foundation, Inc. |
3c8a3c56 JG |
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 | |
99a42820 | 8 | # it under the terms of the GNU General Public License as published by |
3c8a3c56 JG |
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, | |
99a42820 RP |
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. | |
3c8a3c56 | 16 | # |
99a42820 | 17 | # You should have received a copy of the GNU General Public License |
3c8a3c56 JG |
18 | # along with this program; if not, write to the Free Software |
19 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
99a42820 RP |
20 | |
21 | # $Id$ | |
22 | ||
23 | srcdir = . | |
6f715d66 | 24 | destdir = /usr/local |
6a469027 | 25 | libdir = $(destdir)/H-$(host_alias)/T-independent/lib |
12e7087f | 26 | docdir = $(srcdir)/doc |
99a42820 RP |
27 | |
28 | RANLIB = ranlib | |
1b494bfa RP |
29 | AR = ar |
30 | AR_FLAGS = clq | |
d6a554ae | 31 | INCDIR = $(srcdir)/../include |
239326c8 | 32 | CSEARCH = -I. -I$(INCDIR) |
a5c6b4b3 | 33 | DEP = mkdep |
12e7087f JG |
34 | |
35 | ||
99a42820 | 36 | #### host and target dependent Makefile fragments come in here. |
99a42820 RP |
37 | ### |
38 | ||
5176a6bc RP |
39 | TARGETLIB = libbfd.a |
40 | CFLAGS = -g $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # -DINTEL960VERSION | |
99a42820 RP |
41 | |
42 | ||
726cc6ef | 43 | BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o \ |
63ffe5ef SC |
44 | archures.o core.o section.o format.o syms.o reloc.o init.o |
45 | ||
cbdc7909 JG |
46 | BFD_MACHINES = cpu-h8300.o cpu-i960.o cpu-sparc.o cpu-m68k.o cpu-m88k.o \ |
47 | cpu-vax.o cpu-mips.o cpu-a29k.o cpu-i386.o cpu-rs6000.o | |
99a42820 | 48 | |
3c8a3c56 | 49 | BFD_BACKENDS = oasys.o ieee.o srec.o \ |
b7de6963 | 50 | aout64.o aout32.o demo64.o sunos.o newsos3.o i386aout.o bout.o \ |
cbdc7909 JG |
51 | icoff.o amdcoff.o m68kcoff.o i386coff.o m88k-bcs.o ecoff.o elf.o \ |
52 | rs6000coff.o | |
c6e7b0ed | 53 | |
63ffe5ef | 54 | |
c6e7b0ed | 55 | OPTIONAL_BACKENDS = trad-core.o |
99a42820 RP |
56 | |
57 | BFD_H=$(INCDIR)/bfd.h | |
99a42820 RP |
58 | |
59 | # C source files that correspond to .o's. | |
60 | CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c archures.c \ | |
6f715d66 | 61 | i386coff.c aout64.c aout32.c sunos.c demo64.c icoff.c srec.c \ |
cbdc7909 | 62 | oasys.c ieee.c m68kcoff.c amdcoff.c rs6000coff.c \ |
63ffe5ef | 63 | format.c section.c core.c syms.c reloc.c init.c \ |
b7de6963 | 64 | m88k-bcs.c ecoff.c trad-core.c newsos3.c i386aout.c bout.c elf.c \ |
3f85ebce | 65 | cpu-h8300.c cpu-i960.c cpu-sparc.c cpu-m68k.c cpu-m88k.c \ |
cbdc7909 | 66 | cpu-vax.c cpu-mips.c cpu-a29k.c cpu-i386.c cpu-rs6000.c |
63ffe5ef | 67 | |
5176a6bc RP |
68 | STAGESTUFF = $(TARGETLIB) $(OFILES) |
69 | ||
70 | all: $(TARGETLIB) | |
71 | ||
6a469027 JG |
72 | # HDEPFILES comes from the host config; TDEPFILES from the target config. |
73 | OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES) | |
5176a6bc RP |
74 | |
75 | $(TARGETLIB): $(OFILES) | |
76 | rm -f $(TARGETLIB) | |
1b494bfa RP |
77 | $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES) |
78 | $(RANLIB) $(TARGETLIB) | |
5176a6bc RP |
79 | |
80 | stage1: force | |
81 | - mkdir stage1 | |
82 | - mv -f $(STAGESTUFF) stage1 | |
83 | ||
84 | stage2: force | |
85 | - mkdir stage2 | |
86 | - mv -f $(STAGESTUFF) stage2 | |
87 | ||
88 | stage3: force | |
89 | - mkdir stage3 | |
90 | - mv -f $(STAGESTUFF) stage3 | |
91 | ||
a01bf1fb RP |
92 | against=stage2 |
93 | ||
94 | comparison: force | |
95 | for i in *.o ; do cmp $$i $(against)/$$i || exit 1 ; done | |
96 | ||
5176a6bc RP |
97 | de-stage1: force |
98 | - (cd stage1 ; mv -f $(STAGESTUFF) ..) | |
99 | - rmdir stage1 | |
99a42820 | 100 | |
5176a6bc RP |
101 | de-stage2: force |
102 | - (cd stage2 ; mv -f $(STAGESTUFF) ..) | |
103 | - rmdir stage2 | |
99a42820 | 104 | |
5176a6bc RP |
105 | de-stage3: force |
106 | - (cd stage3 ; mv -f $(STAGESTUFF) ..) | |
107 | - rmdir stage3 | |
99a42820 RP |
108 | |
109 | tags etags: TAGS | |
110 | ||
5176a6bc | 111 | TAGS: force |
453063fe | 112 | etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c |
99a42820 RP |
113 | |
114 | clean: | |
3a26c0cd | 115 | rm -f *.[oa] *~ core *.E *.p *.ip |
99a42820 RP |
116 | |
117 | clobber realclean: clean | |
118 | rm -f libbfd.a TAGS | |
119 | ||
23d44ec9 JG |
120 | # Mark everything as depending on config.status, since the timestamp on |
121 | # sysdep.h might actually move backwards if we reconfig and relink it | |
122 | # to a different hosts/h-xxx.h file. This will force a recompile anyway. | |
123 | RECONFIG = config.status | |
124 | $(BFD_LIBS): libbfd.h $(BFD_H) $(RECONFIG) | |
125 | $(BFD_MACHINES): libbfd.h $(BFD_H) $(RECONFIG) | |
126 | $(BFD_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG) | |
127 | $(OPTIONAL_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG) | |
99a42820 | 128 | |
cbdc7909 JG |
129 | # Get around a Sun Make bug in SunOS 4.1.1 with VPATH |
130 | cpu-i386.o:cpu-i386.c | |
131 | ||
99a42820 RP |
132 | saber: |
133 | #suppress 65 on bfd_map_over_sections | |
134 | #suppress 66 on bfd_map_over_sections | |
135 | #suppress 67 on bfd_map_over_sections | |
136 | #suppress 68 on bfd_map_over_sections | |
137 | #suppress 69 on bfd_map_over_sections | |
138 | #suppress 70 on bfd_map_over_sections | |
139 | #suppress 110 in bfd_map_over_sections | |
140 | #suppress 112 in bfd_map_over_sections | |
141 | #suppress 530 | |
142 | #suppress 590 in swap_exec_header | |
143 | #suppress 590 in _bfd_dummy_core_file_matches_executable_p | |
144 | #suppress 590 in bfd_dont_truncate_arname | |
145 | #suppress 590 on ignore | |
146 | #suppress 590 on abfd | |
147 | #setopt load_flags $(CFLAGS) | |
148 | #load $(CFILES) | |
a5c6b4b3 | 149 | |
99a42820 RP |
150 | |
151 | #----------------------------------------------------------------------------- | |
152 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
153 | # | |
154 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
155 | #----------------------------------------------------------------------------- | |
156 | ||
157 | ver960.c: FORCE | |
158 | rm -f ver960.c | |
159 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
160 | ||
161 | ||
162 | # This target should be invoked before building a new release. | |
163 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
164 | # | |
165 | roll: | |
166 | @V=`cat VERSION` ; \ | |
167 | MAJ=`sed 's/\..*//' VERSION` ; \ | |
168 | MIN=`sed 's/.*\.//' VERSION` ; \ | |
169 | V=$$MAJ.`expr $$MIN + 1` ; \ | |
170 | rm -f VERSION ; \ | |
171 | echo $$V >VERSION ; \ | |
172 | echo Version $$V | |
173 | ||
174 | # Dummy target to force execution of dependent targets. | |
175 | # | |
5176a6bc | 176 | force: |
99a42820 | 177 | |
99a42820 | 178 | install: |
6a469027 JG |
179 | cp libbfd.a $(libdir)/libbfd.a.new |
180 | $(RANLIB) $(libdir)/libbfd.a.new | |
181 | mv -f $(libdir)/libbfd.a.new $(libdir)/libbfd.a | |
99a42820 RP |
182 | |
183 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
184 | # have the following string beginning in column 1: #__<hostname>__# | |
185 | # Original Makefile is backed up as 'Makefile.old'. | |
186 | # | |
187 | # Invoke with: make make HOST=xxx | |
188 | # | |
189 | make: | |
190 | -@if test $(HOST)x = x ; then \ | |
191 | echo '\aSpecify "make make HOST=???"'; \ | |
192 | exit 1; \ | |
193 | fi ; \ | |
194 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
195 | if test $$? = 0 ; then \ | |
196 | echo "\aMakefile has already been processed with 'make make'";\ | |
197 | exit 1; \ | |
198 | fi ; \ | |
199 | mv -f Makefile Makefile.old; \ | |
200 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
201 | echo "HOST=$(HOST)" >>Makefile ; \ | |
202 | echo >>Makefile ; \ | |
203 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
204 | ||
b7de6963 | 205 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 206 | $(SHELL) ./config.status |
a5c6b4b3 SC |
207 | |
208 | dep: $(CFILES) | |
209 | mkdep $(CFLAGS) $? | |
6f715d66 SC |
210 | |
211 | ||
6f715d66 | 212 | |
12e7087f JG |
213 | headers: |
214 | cp $(srcdir)/bfd-in.h $(docdir) | |
215 | cp $(srcdir)/libbfd-in.h $(docdir) | |
216 | cp $(srcdir)/libcoff-in.h $(docdir) | |
b5493bc4 | 217 | (cd $(docdir); $(MAKE) protos) |
6f715d66 | 218 | # Rebuild prototypes in bfd.h |
12e7087f JG |
219 | cp $(docdir)/bfd.h $(BFD_H) |
220 | cp $(docdir)/libbfd.h $(srcdir)/libbfd.h | |
221 | cp $(docdir)/libcoff.h $(srcdir)/libcoff.h | |
63ffe5ef SC |
222 | rm -f $(docdir)/bfd-in.h |
223 | rm -f $(docdir)/libbfd-in.h | |
224 | rm -f $(docdir)/libcoff-in.h | |
12e7087f JG |
225 | |
226 | bfd.info: | |
b5493bc4 | 227 | ( cd $(docdir); $(MAKE) bfd.info) |
12e7087f JG |
228 | |
229 | bfd.dvi: | |
b5493bc4 | 230 | (cd $(docdir); $(MAKE) bfd.dvi) |
12e7087f JG |
231 | |
232 | bfd.ps: | |
b5493bc4 | 233 | (cd $(docdir); $(MAKE) bfd.ps) |
12e7087f JG |
234 | |
235 | # What appears below is generated by a hacked mkdep using gcc -MM. | |
236 | ||
237 | # DO NOT DELETE THIS LINE -- mkdep uses it. | |
238 | # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. | |
239 | ||
a26878d1 RP |
240 | libbfd.o : libbfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h |
241 | opncls.o : opncls.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h | |
242 | bfd.o : bfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h | |
243 | archive.o : archive.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ | |
244 | $(INCDIR)/ar.h $(INCDIR)/ranlib.h | |
245 | targets.o : targets.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h | |
246 | cache.o : cache.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h | |
247 | archures.o : archures.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h | |
248 | i386coff.o : i386coff.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ | |
249 | $(INCDIR)/i386coff.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h | |
12e7087f | 250 | aout64.o : aout64.c |
a26878d1 RP |
251 | aout32.o : aout32.c aoutx.h $(INCDIR)/bfd.h $(INCDIR)/ansidecl.h \ |
252 | $(INCDIR)/obstack.h libaout.h libbfd.h $(INCDIR)/aout64.h \ | |
253 | $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def $(INCDIR)/ar.h | |
254 | sunos.o : sunos.c aoutf1.h $(INCDIR)/bfd.h $(INCDIR)/obstack.h \ | |
255 | libaout.h libbfd.h $(INCDIR)/aout64.h $(INCDIR)/stab.gnu.h \ | |
256 | $(INCDIR)/stab.def $(INCDIR)/ar.h | |
12e7087f | 257 | demo64.o : demo64.c |
a26878d1 RP |
258 | icoff.o : icoff.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ |
259 | $(INCDIR)/intel-coff.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h | |
260 | srec.o : srec.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h | |
261 | oasys.o : oasys.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ | |
262 | $(INCDIR)/oasys.h liboasys.h | |
263 | ieee.o : ieee.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ | |
264 | $(INCDIR)/ieee.h libieee.h | |
265 | m68kcoff.o : m68kcoff.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ | |
266 | $(INCDIR)/m68kcoff.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h | |
267 | amdcoff.o : amdcoff.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ | |
268 | $(INCDIR)/amdcoff.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h | |
cbdc7909 JG |
269 | rs6000coff.o: rs6000coff.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ |
270 | $(INCDIR)/rs6000coff.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h | |
23d44ec9 | 271 | format.o : format.c $(INCDIR)/bfd.h \ |
a26878d1 | 272 | $(INCDIR)/obstack.h libbfd.h |
23d44ec9 | 273 | section.o : section.c $(INCDIR)/bfd.h \ |
a26878d1 | 274 | $(INCDIR)/obstack.h libbfd.h |
23d44ec9 | 275 | core.o : core.c $(INCDIR)/bfd.h \ |
a26878d1 | 276 | $(INCDIR)/obstack.h libbfd.h |
23d44ec9 | 277 | syms.o : syms.c $(INCDIR)/bfd.h \ |
a26878d1 | 278 | $(INCDIR)/obstack.h libbfd.h |
23d44ec9 | 279 | reloc.o : reloc.c $(INCDIR)/bfd.h \ |
a26878d1 RP |
280 | $(INCDIR)/obstack.h libbfd.h |
281 | m88k-bcs.o : m88k-bcs.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ | |
282 | $(INCDIR)/m88k-bcs.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h | |
283 | ecoff.o : ecoff.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ | |
284 | $(INCDIR)/ecoff.h $(INCDIR)/internalcoff.h libcoff.h trad-core.h \ | |
12e7087f | 285 | coffcode.h |
a26878d1 | 286 | trad-core.o : trad-core.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h \ |
12e7087f | 287 | libbfd.h libaout.h |
a26878d1 RP |
288 | newsos3.o : newsos3.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ |
289 | $(INCDIR)/aout64.h $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def \ | |
290 | $(INCDIR)/ar.h libaout.h | |
b7de6963 JG |
291 | i386aout.o : i386aout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ |
292 | $(INCDIR)/aout64.h $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def \ | |
293 | $(INCDIR)/ar.h libaout.h | |
a26878d1 RP |
294 | bout.o : bout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ |
295 | $(INCDIR)/bout.h $(INCDIR)/stab.gnu.h $(INCDIR)/stab.def libaout.h | |
12e7087f JG |
296 | |
297 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY | |
a26878d1 | 298 |