2005-05-05 H.J. Lu <hongjiu.lu@intel.com>
[external/binutils.git] / bfd / doc / Makefile.am
1 ## Process this file with automake to generate Makefile.in
2
3 AUTOMAKE_OPTIONS = 1.9 cygnus
4
5 DOCFILES = aoutx.texi  archive.texi archures.texi \
6         bfdt.texi  cache.texi coffcode.texi \
7         core.texi elf.texi elfcode.texi  format.texi \
8         libbfd.texi bfdwin.texi bfdio.texi \
9         opncls.texi  reloc.texi  section.texi  \
10         syms.texi  targets.texi init.texi hash.texi linker.texi \
11         mmo.texi
12
13 PROTOS = archive.p archures.p bfd.p \
14          core.p format.p \
15         bfdio.p bfdwin.p \
16         libbfd.p opncls.p reloc.p \
17         section.p syms.p targets.p  \
18         format.p  core.p init.p
19
20 IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip coffcode.ip
21
22 # SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction 
23 # between VPATH and suffix rules.  If you use GNU Make, perhaps other Makes,
24 # you don't need these three:
25 SRCDOC = $(srcdir)/../aoutx.h  $(srcdir)/../archive.c \
26         $(srcdir)/../archures.c $(srcdir)/../bfd.c \
27         $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \
28         $(srcdir)/../cache.c $(srcdir)/../coffcode.h \
29         $(srcdir)/../corefile.c $(srcdir)/../elf.c \
30         $(srcdir)/../elfcode.h  $(srcdir)/../format.c \
31         $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
32         $(srcdir)/../reloc.c  $(srcdir)/../section.c \
33         $(srcdir)/../syms.c  $(srcdir)/../targets.c \
34         $(srcdir)/../hash.c $(srcdir)/../linker.c \
35         $(srcdir)/../mmo.c
36
37 SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
38         $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \
39         $(srcdir)/../format.c $(srcdir)/../libbfd.c \
40         $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \
41         $(srcdir)/../opncls.c $(srcdir)/../reloc.c \
42         $(srcdir)/../section.c $(srcdir)/../syms.c \
43         $(srcdir)/../targets.c $(srcdir)/../init.c
44
45 SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \
46         $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \
47         $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \
48         $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \
49         $(srcdir)/../init.c
50
51 TEXIDIR = $(srcdir)/../../texinfo/fsf
52
53 info_TEXINFOS = bfd.texinfo
54
55 MKDOC = chew$(EXEEXT_FOR_BUILD)
56
57 INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../../include \
58         -I$(srcdir)/../../intl -I../../intl
59
60 $(MKDOC): chew.o
61         $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD)
62
63 chew.o: chew.c
64         $(CC_FOR_BUILD) -c $(INCLUDES) $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
65
66 protos: libbfd.h libcoff.h bfd.h
67
68 $(srcdir)/bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
69
70 # We can't replace these rules with an implicit rule, because
71 # makes without VPATH support couldn't find the .h files in `..'.
72
73 # We do not depend on chew directly so that we can distribute the info
74 # files, and permit people to rebuild them, without requiring the makeinfo
75 # program.  If somebody tries to rebuild info, but none of the .texi files
76 # have changed, then nothing will be rebuilt.
77
78 aoutx.texi: chew.c $(srcdir)/../aoutx.h $(srcdir)/doc.str
79         $(MAKE) $(MKDOC)
80         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp
81         $(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi
82
83 archive.texi: chew.c $(srcdir)/../archive.c $(srcdir)/doc.str
84         $(MAKE) $(MKDOC)
85         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp
86         $(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi
87
88 archures.texi: chew.c $(srcdir)/../archures.c $(srcdir)/doc.str
89         $(MAKE) $(MKDOC)
90         ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
91         $(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi
92
93 # We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
94 # bfd.texinfo on an 8.3 filesystem.
95 bfdt.texi: chew.c $(srcdir)/../bfd.c $(srcdir)/doc.str
96         $(MAKE) $(MKDOC)
97         ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
98         $(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi
99
100 cache.texi: chew.c $(srcdir)/../cache.c $(srcdir)/doc.str
101         $(MAKE) $(MKDOC)
102         ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
103         $(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi
104
105 coffcode.texi: chew.c $(srcdir)/../coffcode.h $(srcdir)/doc.str
106         $(MAKE) $(MKDOC)
107         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp
108         $(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi
109
110 core.texi: chew.c $(srcdir)/../corefile.c $(srcdir)/doc.str
111         $(MAKE) $(MKDOC)
112         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp
113         $(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi
114
115 elf.texi: chew.c $(srcdir)/../elf.c $(srcdir)/doc.str
116         $(MAKE) $(MKDOC)
117         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp
118         $(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi
119
120 elfcode.texi: chew.c $(srcdir)/../elfcode.h $(srcdir)/doc.str
121         $(MAKE) $(MKDOC)
122         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp
123         $(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi
124
125 mmo.texi: chew.c $(srcdir)/../mmo.c $(srcdir)/doc.str
126         $(MAKE) $(MKDOC)
127         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp
128         $(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi
129
130 format.texi: chew.c $(srcdir)/../format.c $(srcdir)/doc.str
131         $(MAKE) $(MKDOC)
132         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
133         $(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi
134
135 libbfd.texi: chew.c $(srcdir)/../libbfd.c $(srcdir)/doc.str
136         $(MAKE) $(MKDOC)
137         ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
138         $(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi
139
140 bfdio.texi: chew.c $(srcdir)/../bfdio.c $(srcdir)/doc.str
141         $(MAKE) $(MKDOC)
142         ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp
143         $(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi
144
145 bfdwin.texi: chew.c $(srcdir)/../bfdwin.c $(srcdir)/doc.str
146         $(MAKE) $(MKDOC)
147         ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp
148         $(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi
149
150 opncls.texi: chew.c $(srcdir)/../opncls.c $(srcdir)/doc.str
151         $(MAKE) $(MKDOC)
152         ./$(MKDOC) -f $(srcdir)/doc.str  <$(srcdir)/../opncls.c >opncls.tmp
153         $(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi
154
155 reloc.texi: chew.c $(srcdir)/../reloc.c $(srcdir)/doc.str
156         $(MAKE) $(MKDOC)
157         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp
158         $(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi
159
160 section.texi: chew.c $(srcdir)/../section.c $(srcdir)/doc.str
161         $(MAKE) $(MKDOC)
162         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp
163         $(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi
164
165 syms.texi: chew.c $(srcdir)/../syms.c $(srcdir)/doc.str
166         $(MAKE) $(MKDOC)
167         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp
168         $(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi
169
170 targets.texi: chew.c $(srcdir)/../targets.c $(srcdir)/doc.str
171         $(MAKE) $(MKDOC)
172         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp
173         $(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi
174
175 init.texi: chew.c $(srcdir)/../init.c $(srcdir)/doc.str
176         $(MAKE) $(MKDOC)
177         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp
178         $(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi
179
180 hash.texi: chew.c $(srcdir)/../hash.c $(srcdir)/doc.str
181         $(MAKE) $(MKDOC)
182         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp
183         $(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi
184
185 linker.texi: chew.c $(srcdir)/../linker.c $(srcdir)/doc.str
186         $(MAKE) $(MKDOC)
187         ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp
188         $(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi
189
190 LIBBFD_H_DEP = \
191         $(srcdir)/../libbfd-in.h        \
192         $(srcdir)/../init.c             \
193         $(srcdir)/../libbfd.c           \
194         $(srcdir)/../bfdio.c            \
195         $(srcdir)/../bfdwin.c           \
196         $(srcdir)/../cache.c            \
197         $(srcdir)/../reloc.c            \
198         $(srcdir)/../archures.c         \
199         $(srcdir)/../elf.c              \
200         $(srcdir)/header.sed            \
201         $(srcdir)/proto.str             \
202         $(MKDOC)
203
204 libbfd.h: $(LIBBFD_H_DEP)
205         echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
206         for file in $(LIBBFD_H_DEP); do \
207           case $$file in \
208             *-in.h) cat $$file >> $@ ;; \
209             */header.sed) break ;; \
210             *)  echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
211                                 -e 's,$$,.  */,' >> $@ ; \
212                 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
213           esac; \
214         done
215
216 LIBCOFF_H_DEP = \
217         $(srcdir)/../libcoff-in.h       \
218         $(srcdir)/../coffcode.h         \
219         $(srcdir)/header.sed            \
220         $(srcdir)/proto.str             \
221         $(MKDOC)
222
223 libcoff.h: $(LIBCOFF_H_DEP)
224         echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@
225         for file in $(LIBCOFF_H_DEP); do \
226           case $$file in \
227             *-in.h) cat $$file >> $@ ;; \
228             */header.sed) break ;; \
229             *)  echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
230                                 -e 's,$$,.  */,' >> $@ ; \
231                 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
232           esac; \
233         done
234
235 BFD_H_DEP = \
236         $(srcdir)/../bfd-in.h           \
237         $(srcdir)/../init.c             \
238         $(srcdir)/../opncls.c           \
239         $(srcdir)/../libbfd.c           \
240         $(srcdir)/../bfdio.c            \
241         $(srcdir)/../bfdwin.c           \
242         $(srcdir)/../section.c          \
243         $(srcdir)/../archures.c         \
244         $(srcdir)/../reloc.c            \
245         $(srcdir)/../syms.c             \
246         $(srcdir)/../bfd.c              \
247         $(srcdir)/../archive.c          \
248         $(srcdir)/../corefile.c         \
249         $(srcdir)/../targets.c          \
250         $(srcdir)/../format.c           \
251         $(srcdir)/../linker.c           \
252         $(srcdir)/../simple.c           \
253         $(srcdir)/header.sed            \
254         $(srcdir)/proto.str             \
255         $(srcdir)/../version.h          \
256         $(MKDOC)
257
258 bfd.h: $(BFD_H_DEP)
259         echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
260         for file in $(BFD_H_DEP); do \
261           case $$file in \
262             *-in.h) cat $$file >> $@ ;; \
263             */header.sed) break ;; \
264             *)  echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
265                                 -e 's,$$,.  */,' >> $@ ; \
266                 ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \
267           esac; \
268         done
269         echo "#ifdef __cplusplus" >> $@
270         echo "}" >> $@
271         echo "#endif" >> $@
272         echo "#endif" >> $@
273
274 noinst_TEXINFOS = bfdint.texi
275
276 MOSTLYCLEANFILES = $(MKDOC) *.o
277
278 CLEANFILES = *.p *.ip
279
280 DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
281
282 MAINTAINERCLEANFILES = $(DOCFILES)
283
284 # We want install to imply install-info as per GNU standards, despite the
285 # cygnus option.
286 install: install-info