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