3 # Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
5 # This file 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 2 of the License, or
8 # (at your option) any later version.
10 # This program 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.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
25 exec_prefix = @exec_prefix@
31 man1dir = $(mandir)/man1
32 man2dir = $(mandir)/man2
33 man3dir = $(mandir)/man3
34 man4dir = $(mandir)/man4
35 man5dir = $(mandir)/man5
36 man6dir = $(mandir)/man6
37 man7dir = $(mandir)/man7
38 man8dir = $(mandir)/man8
39 man9dir = $(mandir)/man9
41 includedir = @includedir@
48 INSTALL_PROGRAM = @INSTALL_PROGRAM@
49 INSTALL_DATA = @INSTALL_DATA@
58 #### Host, target, and site specific Makefile fragments come in here.
62 $(CC) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $<
64 DOCFILES = aoutx.texi archive.texi archures.texi \
65 bfdt.texi cache.texi coffcode.texi \
66 core.texi elf.texi elfcode.texi format.texi libbfd.texi \
67 opncls.texi reloc.texi section.texi \
68 syms.texi targets.texi init.texi hash.texi linker.texi
70 PROTOS = archive.p archures.p bfd.p \
72 libbfd.p opncls.p reloc.p \
73 section.p syms.p targets.p \
74 format.p core.p init.p
76 IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip coffcode.ip
78 # SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction
79 # between VPATH and suffix rules. If you use GNU Make, perhaps other Makes,
80 # you don't need these three:
81 SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \
82 $(srcdir)/../archures.c $(srcdir)/../bfd.c \
83 $(srcdir)/../cache.c $(srcdir)/../coffcode.h \
84 $(srcdir)/../corefile.c $(srcdir)/../elf.c \
85 $(srcdir)/../elfcode.h $(srcdir)/../format.c \
86 $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
87 $(srcdir)/../reloc.c $(srcdir)/../section.c \
88 $(srcdir)/../syms.c $(srcdir)/../targets.c \
89 $(srcdir)/../hash.c $(srcdir)/../linker.c
91 SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
92 $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \
93 $(srcdir)/../format.c $(srcdir)/../libbfd.c \
94 $(srcdir)/../opncls.c $(srcdir)/../reloc.c \
95 $(srcdir)/../section.c $(srcdir)/../syms.c \
96 $(srcdir)/../targets.c $(srcdir)/../init.c
98 SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \
99 $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \
100 $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \
103 STAGESTUFF = $(DOCFILES) *.info*
105 TEXIDIR = $(srcdir)/../../texinfo/fsf
114 $(SHELL) $(srcdir)/../../mkinstalldirs $(infodir)
115 if [ -r bfd.info ]; then \
120 for i in `cd $$dir; echo *.info*`; do \
121 $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i; \
124 docs: $(MKDOC) protos bfd.info bfd.dvi bfd.ps
127 $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
130 $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
132 protos: libbfd.h libcoff.h bfd.h
135 # We can't replace these rules with an implicit rule, because
136 # makes without VPATH support couldn't find the .h files in `..'.
138 # We use s-XXX targets so that we can distribute the info files,
139 # and permit people to rebuild them, without requiring the makeinfo
140 # program. If somebody tries to rebuild info, but none of the .texi
141 # files have changed, then this Makefile will build chew, and will
142 # build all of the stamp files, but will not actually have to rebuild
145 s-aoutx: $(MKDOC) $(srcdir)/../aoutx.h $(srcdir)/doc.str
146 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp
147 $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi
151 s-archive: $(MKDOC) $(srcdir)/../archive.c $(srcdir)/doc.str
152 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp
153 $(srcdir)/../../move-if-change archive.tmp archive.texi
155 archive.texi: s-archive
157 s-archures: $(MKDOC) $(srcdir)/../archures.c $(srcdir)/doc.str
158 $(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
159 $(srcdir)/../../move-if-change archures.tmp archures.texi
161 archures.texi: s-archures
163 # We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
164 # bfd.texinfo on an 8.3 filesystem.
165 s-bfd: $(MKDOC) $(srcdir)/../bfd.c $(srcdir)/doc.str
166 $(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
167 $(srcdir)/../../move-if-change bfd.tmp bfdt.texi
171 s-cache: $(MKDOC) $(srcdir)/../cache.c $(srcdir)/doc.str
172 $(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
173 $(srcdir)/../../move-if-change cache.tmp cache.texi
177 s-coffcode: $(MKDOC) $(srcdir)/../coffcode.h $(srcdir)/doc.str
178 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp
179 $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi
181 coffcode.texi: s-coffcode
183 s-core: $(MKDOC) $(srcdir)/../corefile.c $(srcdir)/doc.str
184 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp
185 $(srcdir)/../../move-if-change core.tmp core.texi
189 s-elf: $(MKDOC) $(srcdir)/../elf.c $(srcdir)/doc.str
190 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp
191 $(srcdir)/../../move-if-change elf.tmp elf.texi
195 s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str
196 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp
197 $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi
199 elfcode.texi: s-elfcode
201 s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str
202 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
203 $(srcdir)/../../move-if-change format.tmp format.texi
205 format.texi: s-format
207 s-libbfd: $(MKDOC) $(srcdir)/../libbfd.c $(srcdir)/doc.str
208 $(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
209 $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi
211 libbfd.texi: s-libbfd
213 s-opncls: $(MKDOC) $(srcdir)/../opncls.c $(srcdir)/doc.str
214 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp
215 $(srcdir)/../../move-if-change opncls.tmp opncls.texi
217 opncls.texi: s-opncls
219 s-reloc: $(MKDOC) $(srcdir)/../reloc.c
220 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp
221 $(srcdir)/../../move-if-change reloc.tmp reloc.texi
225 s-section: $(MKDOC) $(srcdir)/../section.c $(srcdir)/doc.str
226 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp
227 $(srcdir)/../../move-if-change section.tmp section.texi
229 section.texi: s-section
231 s-syms: $(MKDOC) $(srcdir)/../syms.c
232 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp
233 $(srcdir)/../../move-if-change syms.tmp syms.texi
237 s-targets: $(MKDOC) $(srcdir)/../targets.c $(srcdir)/doc.str
238 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp
239 $(srcdir)/../../move-if-change targets.tmp targets.texi
241 targets.texi: s-targets
243 s-init: $(MKDOC) $(srcdir)/../init.c $(srcdir)/doc.str
244 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp
245 $(srcdir)/../../move-if-change init.tmp init.texi
249 s-hash: $(MKDOC) $(srcdir)/../hash.c $(srcdir)/doc.str
250 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp
251 $(srcdir)/../../move-if-change hash.tmp hash.texi
255 s-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str
256 $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp
257 $(srcdir)/../../move-if-change linker.tmp linker.texi
259 linker.texi: s-linker
261 libbfd.h: $(srcdir)/../libbfd-in.h \
262 $(srcdir)/../init.c \
263 $(srcdir)/../libbfd.c \
264 $(srcdir)/../cache.c \
265 $(srcdir)/../reloc.c \
266 $(srcdir)/../cpu-h8300.c \
267 $(srcdir)/../cpu-i960.c \
268 $(srcdir)/../archures.c \
269 $(srcdir)/../elfcode.h \
270 $(srcdir)/proto.str \
272 cat $(srcdir)/../libbfd-in.h >libbfd.h
273 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../init.c >>libbfd.h
274 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../libbfd.c >>libbfd.h
275 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cache.c >>libbfd.h
276 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../reloc.c >>libbfd.h
277 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cpu-h8300.c >>libbfd.h
278 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cpu-i960.c >>libbfd.h
279 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../archures.c >>libbfd.h
280 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elf.c >>libbfd.h
281 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elfcode.h >>libbfd.h
283 libcoff.h: $(srcdir)/../libcoff-in.h \
284 $(srcdir)/../coffcode.h \
285 $(srcdir)/proto.str \
287 cat $(srcdir)/../libcoff-in.h >libcoff.h
288 $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../coffcode.h >>libcoff.h
290 bfd.h: $(srcdir)/../bfd-in.h \
291 $(srcdir)/../init.c \
292 $(srcdir)/../opncls.c \
293 $(srcdir)/../libbfd.c \
294 $(srcdir)/../section.c \
295 $(srcdir)/../archures.c \
296 $(srcdir)/../reloc.c \
297 $(srcdir)/../syms.c \
299 $(srcdir)/../archive.c \
300 $(srcdir)/../corefile.c \
301 $(srcdir)/../targets.c \
302 $(srcdir)/../format.c \
303 $(srcdir)/proto.str \
305 cat $(srcdir)/../bfd-in.h >bfd.h
306 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../init.c >>bfd.h
307 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../opncls.c >>bfd.h
308 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../libbfd.c >>bfd.h
309 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../section.c >>bfd.h
310 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archures.c >>bfd.h
311 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../reloc.c >>bfd.h
312 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../syms.c >>bfd.h
313 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../bfd.c >>bfd.h
314 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archive.c >>bfd.h
315 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../corefile.c >>bfd.h
316 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../targets.c >>bfd.h
317 $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../format.c >>bfd.h
318 echo "#ifdef __cplusplus" >>bfd.h
320 echo "#endif" >>bfd.h
321 echo "#endif" >>bfd.h
327 rm -rf *.log *.ps *~* *.dvi *# $(MKDOC) *.o
330 rm -rf $(STAGESTUFF) s-*
331 rm -f *.p *.ip bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
333 distclean: mostlyclean
334 rm -f *.p *.ip bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
336 rm -f Makefile config.status
338 maintainer-clean realclean: clean
339 rm -f Makefile config.status
341 bfd.info: $(DOCFILES) bfdsumm.texi bfd.texinfo
342 $(MAKEINFO) -I$(srcdir) -o bfd.info $(srcdir)/bfd.texinfo
344 bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
345 $(TEXI2DVI) $(srcdir)/bfd.texinfo
350 quickdoc: $(DOCFILES) bfdsumm.texi bfd.texinfo
351 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex bfd.texinfo
355 - mv -f $(STAGESTUFF) stage1
359 - mv -f $(STAGESTUFF) stage2
363 - mv -f $(STAGESTUFF) stage3
368 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i || exit 1 ; done
371 - (cd stage1 ; mv -f $(STAGESTUFF) ..)
375 - (cd stage2 ; mv -f $(STAGESTUFF) ..)
379 - (cd stage3 ; mv -f $(STAGESTUFF) ..)
384 Makefile: $(srcdir)/Makefile.in
385 cd .. && CONFIG_FILES=doc/$@ CONFIG_HEADERS= $(SHELL) ./config.status