Added core.c prototypes to bfd.h
[binutils-gdb.git] / bfd / Makefile.in
1 #
2 CC=gcc -Wall -ansi
3 # Copyright (C) 1990, 1991 Free Software Foundation, Inc.
4 #
5 # This file is part of BFD, the Binary File Diddler.
6 #
7 # BFD 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 1, or (at your option)
10 # any later version.
11 #
12 # BFD 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 BFD; see the file COPYING. If not, write to
19 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21 # $Id$
22
23 srcdir = .
24 destdir = /usr/local
25 libdir = $(destdir)/lib
26
27 RANLIB = ranlib
28 AR = ar
29 AR_FLAGS = clq
30 INCDIR = $(srcdir)/../include
31 CSEARCH = -I$(INCDIR)
32 DEP = mkdep
33 #### host and target dependent Makefile fragments come in here.
34 ###
35
36 TARGETLIB = libbfd.a
37 CFLAGS = -g $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # -DINTEL960VERSION
38
39
40 BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o \
41 archures.o core.o section.o format.o syms.o reloc.o
42
43 BFD_BACKENDS = oasys.o ieee.o srec.o aout64.o aout32.o sunos.o icoff.o \
44 demo64.o \
45 m68kcoff.o i386coff.o m88k-bcs.o ecoff.o newsos3.o # trad-core.o bout.o
46
47 BFD_H=$(INCDIR)/bfd.h
48 SYSDEP_H=$(INCDIR)/sysdep.h
49
50 # C source files that correspond to .o's.
51 CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c archures.c \
52 i386coff.c aout64.c aout32.c sunos.c demo64.c icoff.c srec.c \
53 oasys.c ieee.c m68kcoff.c \
54 format.c section.c core.c syms.c reloc.c \
55 m88k-bcs.c ecoff.c trad-core.c newsos3.c #bout.c
56
57 STAGESTUFF = $(TARGETLIB) $(OFILES)
58
59 all: $(TARGETLIB)
60
61 # XDEPFILES comes from the host config; TDEPFILES from the target config.
62 OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(XDEPFILES) $(TDEPFILES)
63
64 $(TARGETLIB): $(OFILES)
65 rm -f $(TARGETLIB)
66 $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES)
67 $(RANLIB) $(TARGETLIB)
68
69 stage1: force
70 - mkdir stage1
71 - mv -f $(STAGESTUFF) stage1
72
73 stage2: force
74 - mkdir stage2
75 - mv -f $(STAGESTUFF) stage2
76
77 stage3: force
78 - mkdir stage3
79 - mv -f $(STAGESTUFF) stage3
80
81 against=stage2
82
83 comparison: force
84 for i in *.o ; do cmp $$i $(against)/$$i || exit 1 ; done
85
86 de-stage1: force
87 - (cd stage1 ; mv -f $(STAGESTUFF) ..)
88 - rmdir stage1
89
90 de-stage2: force
91 - (cd stage2 ; mv -f $(STAGESTUFF) ..)
92 - rmdir stage2
93
94 de-stage3: force
95 - (cd stage3 ; mv -f $(STAGESTUFF) ..)
96 - rmdir stage3
97
98 tags etags: TAGS
99
100 TAGS: force
101 etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
102
103 clean:
104 rm -f *.[oa] *~ core *.E
105
106 clobber realclean: clean
107 rm -f libbfd.a TAGS
108
109 $(BFD_LIBS) $(BFD_BACKENDS): libbfd.h $(BFD_H)
110
111 saber:
112 #suppress 65 on bfd_map_over_sections
113 #suppress 66 on bfd_map_over_sections
114 #suppress 67 on bfd_map_over_sections
115 #suppress 68 on bfd_map_over_sections
116 #suppress 69 on bfd_map_over_sections
117 #suppress 70 on bfd_map_over_sections
118 #suppress 110 in bfd_map_over_sections
119 #suppress 112 in bfd_map_over_sections
120 #suppress 530
121 #suppress 590 in swap_exec_header
122 #suppress 590 in _bfd_dummy_core_file_matches_executable_p
123 #suppress 590 in bfd_dont_truncate_arname
124 #suppress 590 on ignore
125 #suppress 590 on abfd
126 #setopt load_flags $(CFLAGS)
127 #load $(CFILES)
128
129
130 #-----------------------------------------------------------------------------
131 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
132 #
133 # 'VERSION' file must be present and contain a string of the form "x.y"
134 #-----------------------------------------------------------------------------
135
136 ver960.c: FORCE
137 rm -f ver960.c
138 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
139
140
141 # This target should be invoked before building a new release.
142 # 'VERSION' file must be present and contain a string of the form "x.y"
143 #
144 roll:
145 @V=`cat VERSION` ; \
146 MAJ=`sed 's/\..*//' VERSION` ; \
147 MIN=`sed 's/.*\.//' VERSION` ; \
148 V=$$MAJ.`expr $$MIN + 1` ; \
149 rm -f VERSION ; \
150 echo $$V >VERSION ; \
151 echo Version $$V
152
153 # Dummy target to force execution of dependent targets.
154 #
155 force:
156
157 install:
158 install -c libbfd.a $(libdir)
159 $(RANLIB) $(libdir)/libbfd.a
160
161 # Target to uncomment host-specific lines in this makefile. Such lines must
162 # have the following string beginning in column 1: #__<hostname>__#
163 # Original Makefile is backed up as 'Makefile.old'.
164 #
165 # Invoke with: make make HOST=xxx
166 #
167 make:
168 -@if test $(HOST)x = x ; then \
169 echo '\aSpecify "make make HOST=???"'; \
170 exit 1; \
171 fi ; \
172 grep -s "^#The next line was generated by 'make make'" Makefile; \
173 if test $$? = 0 ; then \
174 echo "\aMakefile has already been processed with 'make make'";\
175 exit 1; \
176 fi ; \
177 mv -f Makefile Makefile.old; \
178 echo "#The next line was generated by 'make make'" >Makefile ; \
179 echo "HOST=$(HOST)" >>Makefile ; \
180 echo >>Makefile ; \
181 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
182
183 Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
184 (cd $(srcdir) ; \
185 ./configure +norecurse \
186 +destdir=$(destdir) \
187 `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
188 $(host) +target=$(target);)
189
190 dep: $(CFILES)
191 mkdep $(CFLAGS) $?
192
193
194 # Stuff to make the documentation for bfd.
195 #
196 # make docs
197 # rebuilds the documentation. Has to be done when the source is
198 # modified until I work out how to do this properly
199 #
200 # make docs headers
201 # rebuilds the header files from the source
202 #
203 # make docs texdoc
204 # rebuilds the bfd.dvi manual
205 #
206 # make docs texinfo
207 # rebuilts the bfdinfo manual
208
209
210 .SUFFIXES: .doc .o .c .h .proto
211
212 .c.doc:
213 makedoc <$< doc/$*.doc doc/$*.proto doc/$*.protointernal doc/$*.drop
214
215 .h.doc:
216 makedoc <$< doc/$*.doc doc/$*.proto doc/$*.protointernal doc/$*.drop
217
218 .proto.doc:
219 makedoc <$< doc/$*.doc doc/$*.proto doc/$*.protointernal doc/$*.drop
220
221
222 DSRC=$(CFILES)
223
224 docs: syms.doc bfd.doc cache.doc format.doc section.doc archive.doc \
225 core.doc libbfd.doc archures.doc reloc.doc opncls.doc \
226 targets.doc aoutx.doc coffcode.doc
227
228
229 PROTOS = doc/opncls.proto doc/archures.proto doc/libbfd.proto doc/section.proto doc/syms.proto doc/bfd.proto doc/archive.proto \
230 doc/reloc.proto doc/targets.proto doc/format.proto
231
232
233 headers : $(PROTOS)
234 - mkdir doc
235 # Rebuild prototypes in bfd.h
236 sed <$(BFD_H) >bfd.h.new -e '1,/THE FOLLOWING/!d'
237 cat doc/opncls.proto doc/archures.proto \
238 doc/libbfd.proto doc/section.proto doc/syms.proto \
239 doc/bfd.proto doc/archive.proto \
240 doc/core.proto \
241 doc/reloc.proto doc/targets.proto doc/format.proto >>bfd.h.new
242 echo >> bfd.h.new
243 echo "#endif" >> bfd.h.new
244 echo >> bfd.h.new
245 mv bfd.h.new $(BFD_H)
246
247 # and libbfd.h
248 sed < libbfd.h >libbfd.h.new -e '1,/THE FOLLOWING/!d'
249 cat doc/libbfd.protointernal doc/cache.protointernal doc/reloc.protointernal >> libbfd.h.new
250 echo >> libbfd.h.new
251 mv libbfd.h.new libbfd.h
252
253 # and libcoff.h
254 sed < $(srcdir)/libcoff.h >libcoff.h.new -e '1,/THE FOLLOWING/!d'
255 cat doc/coffcode.proto >>libcoff.h.new
256 mv libcoff.h.new $(srcdir)/libcoff.h
257
258
259 texinfo:
260 makeinfo +no-validate bfd.texinfo
261
262 texdoc:
263 tex bfd.texinfo
264 texindex bfd.??
265 tex bfd.texinfo
266
267 quickdoc: $(DSRC) docs
268 tex bfd.texinfo
269
270
271