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