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