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