]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/doc/Makefile.in
Run TeX *three* times to get better index, xrefs.
[thirdparty/binutils-gdb.git] / gdb / doc / Makefile.in
1 ##Copyright (C) 1991, 1992 Free Software Foundation, Inc.
2
3 # Makefile for GDB documentation.
4 # This file is part of GDB.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 srcdir = .
21
22 prefix = /usr/local
23
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 libdir = $(exec_prefix)/lib
27
28 datadir = $(prefix)/lib
29 mandir = $(prefix)/man
30 man1dir = $(mandir)/man1
31 man2dir = $(mandir)/man2
32 man3dir = $(mandir)/man3
33 man4dir = $(mandir)/man4
34 man5dir = $(mandir)/man5
35 man6dir = $(mandir)/man6
36 man7dir = $(mandir)/man7
37 man8dir = $(mandir)/man8
38 man9dir = $(mandir)/man9
39 infodir = $(prefix)/info
40 includedir = $(prefix)/include
41 docdir = $(datadir)/doc
42
43 SHELL = /bin/sh
44
45 INSTALL = install -c
46 INSTALL_PROGRAM = $(INSTALL)
47 INSTALL_DATA = $(INSTALL)
48
49 AR = ar
50 AR_FLAGS = qv
51 BISON = bison
52 RANLIB = ranlib
53
54 # main GDB source directory
55 gdbdir = ..
56
57 # Documentation (gdb.dvi) needs either GNU m4 or SysV m4;
58 # Berkeley/Sun don't have quite enough.
59 #M4=/usr/5bin/m4
60 M4=gm4
61
62 # where to find texinfo; GDB dist should include a recent one
63 TEXIDIR=$(srcdir)/${gdbdir}/../texinfo/fsf
64
65 # where to find makeinfo, preferably one designed for texinfo-2
66 MAKEINFO=makeinfo
67
68 # where to find texi2roff, ditto
69 TEXI2ROFF=texi2roff
70
71 # Where is the source dir for the READLINE library? Traditionally in .. or .
72 # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
73 READLINE_DIR = $(srcdir)/${gdbdir}/../readline
74
75 # Main GDB manual's source files
76 SFILES_DOCDIR = \
77 $(srcdir)/gdb.texinfo $(srcdir)/pretex.m4 $(srcdir)/none.m4 \
78 $(srcdir)/all.m4 gdbinv-m.m4 gdbinv-s.m4 gdbVN.m4
79
80 # Which version of GDB manual? default includes everything
81 CONFIG=all
82
83 #### Host, target, and site specific Makefile fragments come in here.
84 ###
85
86 all install:
87
88 info: gdb.info gdbint.info
89 all-doc: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi
90 clean-info:
91 -rm -f *.info*
92
93 install-info: info
94 for i in *.info* ; do \
95 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
96 done
97
98 STAGESTUFF = *.info* gdb-all.texi gdbVN.m4
99
100 # Copy the object files from a particular stage into a subdirectory.
101 stage1: force
102 -mkdir stage1
103 -mv $(STAGESTUFF) stage1
104
105 stage2: force
106 -mkdir stage2
107 -mv $(STAGESTUFF) stage2
108
109 stage3: force
110 -mkdir stage3
111 -mv $(STAGESTUFF) stage3
112
113 against=stage2
114
115 comparison: force
116 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
117
118 de-stage1: force
119 -(cd stage1 ; mv -f * ..)
120 -rmdir stage1
121
122 de-stage2: force
123 -(cd stage2 ; mv -f * ..)
124 -rmdir stage2
125
126 de-stage3: force
127 -(cd stage3 ; mv -f * ..)
128 -rmdir stage3
129
130 clean:
131 rm -f gdb.dvi rluser.texinfo inc-hist.texi gdb-all* gdb.info* gdbVN.m4
132 rm -f gdb-internals gdbint.?? gdbint.??? gdbint.info
133 rm -f refcard.ps refcard.dvi refcard.log *~
134
135 # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
136 refcard.dvi : $(srcdir)/refcard.tex
137 TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex refcard.tex; rm -f refcard.log
138 rm -f rcfonts.tex
139
140 # GDB QUICK REFERENCE (PostScript output, common PS fonts)
141 refcard.ps : $(srcdir)/refcard.tex $(srcdir)/psrc.sed
142 sed -f $(srcdir)/psrc.sed refcard.tex >psref.tex
143 TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex psref.tex
144 dvips -t landscape psref -o; mv psref.ps refcard.ps
145 rm -f psref.dvi psref.log
146
147 # GDB QUICK REFERENCE (PostScript output, common PS fonts w/long names)
148 lrefcard.ps : $(srcdir)/refcard.tex $(srcdir)/lpsrc.sed
149 sed -f $(srcdir)/lpsrc.sed refcard.tex >psref.tex
150 TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex psref.tex
151 dvips -t landscape psref -o; mv psref.ps lrefcard.ps
152 rm -f psref.dvi psref.log
153
154 # "Readline" appendices. Get them here so both TeX and texi2roff can find.
155 rluser.texinfo: ${READLINE_DIR}/doc/rluser.texinfo
156 ln -s ${READLINE_DIR}/doc/rluser.texinfo . || \
157 ln ${READLINE_DIR}/doc/rluser.texinfo . || \
158 cp ${READLINE_DIR}/doc/rluser.texinfo .
159
160 inc-hist.texi: ${READLINE_DIR}/doc/inc-hist.texi
161 ln -s ${READLINE_DIR}/doc/inc-hist.texi . || \
162 ln ${READLINE_DIR}/doc/inc-hist.texi . || \
163 cp ${READLINE_DIR}/doc/inc-hist.texi .
164
165 # File to record current GDB version number (copied from main dir Makefile.in)
166 gdbVN.m4 : $(srcdir)/${gdbdir}/Makefile.in
167 echo "_define__(<_GDB_VN__>,`sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`)" > ./gdbVN.m4
168
169 # GDB MANUAL: texinfo source, created by preprocessing w/m4
170 # If you want other configs in the makefile, add or modify instructions for
171 # building source here, then change CONFIG (that way you get info, dvi,
172 # roff targets automatically for your config).
173 # Be sure to not create a bad gdb-all.texi if ${M4} is missing or aborts...
174 # The nonsense with gdbVN.m4 is to get this to run with both Sun and GNU make.
175 # Note that we can *generate* gdbVN.m4, but since we distribute one in the
176 # source directory for the benefit of people who *don't* use this makefile,
177 # VPATH will often tell make not to bother building it, because the one
178 # in the srcdir is up to date. (if not, then make should build one here).
179
180 gdb-all.texi: ${SFILES_DOCDIR}
181 if [ ! -f ./gdbVN.m4 ]; then \
182 ln -s $(srcdir)/gdbVN.m4 . || \
183 ln $(srcdir)/gdbVN.m4 . || \
184 cp $(srcdir)/gdbVN.m4 . ; else true; fi
185 rm -f foobus.texinfo
186 ${M4} $(srcdir)/pretex.m4 $(srcdir)/none.m4 $(srcdir)/all.m4 \
187 gdbVN.m4 $(srcdir)/gdb.texinfo >foobus.texinfo
188 rm -f gdb-all.texi
189 mv foobus.texinfo ./gdb-all.texi
190
191 # GDB MANUAL: TeX dvi file
192 gdb.dvi : gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi
193 TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi
194 TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi
195 texindex gdb-${CONFIG}.??
196 TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi
197 mv gdb-${CONFIG}.dvi ./gdb.dvi
198 rm -f gdb-${CONFIG}.?? gdb-${CONFIG}.???
199
200 # GDB MANUAL: info file
201 # We're using texinfo2, and older makeinfo's may not be able to
202 # cope with all the markup. In the meantime, we distribute the info
203 # files
204 gdb.info: gdb-${CONFIG}.texi
205 $(MAKEINFO) -o ./gdb.info $(srcdir)/gdb-${CONFIG}.texi
206
207 # GDB MANUAL: roff translations
208 # Try to use a recent texi2roff. v2 was put on prep in jan91.
209 # If you want an index, see texi2roff doc for postprocessing
210 # and add -i to texi2roff invocations below.
211 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
212 # corresponding -e lines when later texi2roff's are current)
213 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
214 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
215 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
216 # + @alphaenumerate is ridiculously new, turned into @enumerate
217
218
219 # gdb manual suitable for [tn]roff -mm
220 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
221 # try leaving them in
222 # ditto special treatment of @ftable in rluser.texinfo
223 gdb.mm: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi
224 rm -f ./rluser.texinfo
225 sed -e 's/^@ftable/@table/g' \
226 -e 's/^@end ftable/@end table/g' \
227 ${READLINE_DIR}/doc/rluser.texinfo > ./rluser.texinfo
228 sed -e '/\\input texinfo/d' \
229 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
230 -e '/^@ifinfo/,/^@end ifinfo/d' \
231 -e '/^@c/d' \
232 -e 's/{.*,,/{/' \
233 -e '/@noindent/d' \
234 -e 's/@ / /g' \
235 -e 's/^@alphaenumerate/@enumerate/g' \
236 -e 's/^@end alphaenumerate/@end enumerate/g' \
237 gdb-${CONFIG}.texi | \
238 $(TEXI2ROFF) -mm | \
239 sed -e 's/---/\\(em/g' \
240 >gdb.mm
241 rm ./rluser.texinfo
242
243 # gdb manual suitable for [gtn]roff -me
244 gdb.me: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi
245 rm -f ./rluser.texinfo
246 sed -e 's/^@ftable/@table/g' \
247 -e 's/^@end ftable/@end table/g' \
248 ${READLINE_DIR}/doc/rluser.texinfo > ./rluser.texinfo
249 sed -e '/\\input texinfo/d' \
250 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
251 -e '/^@ifinfo/,/^@end ifinfo/d' \
252 -e '/^@c/d' \
253 -e 's/{.*,,/{/' \
254 -e 's/@ / /g' \
255 -e 's/^@alphaenumerate/@enumerate/g' \
256 -e 's/^@end alphaenumerate/@end enumerate/g' \
257 gdb-${CONFIG}.texi | \
258 $(TEXI2ROFF) -me | \
259 sed -e 's/---/\\(em/g' \
260 >gdb.me
261 rm ./rluser.texinfo
262
263 # gdb manual suitable for [gtn]roff -ms
264 gdb.ms: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi
265 rm -f ./rluser.texinfo
266 sed -e 's/^@ftable/@table/g' \
267 -e 's/^@end ftable/@end table/g' \
268 ${READLINE_DIR}/doc/rluser.texinfo > ./rluser.texinfo
269 sed -e '/\\input texinfo/d' \
270 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
271 -e '/^@ifinfo/,/^@end ifinfo/d' \
272 -e '/^@c/d' \
273 -e 's/{.*,,/{/' \
274 -e 's/@ / /g' \
275 -e 's/^@alphaenumerate/@enumerate/g' \
276 -e 's/^@end alphaenumerate/@end enumerate/g' \
277 gdb-${CONFIG}.texi | \
278 $(TEXI2ROFF) -ms | \
279 sed -e 's/---/\\(em/g' \
280 >gdb.ms
281 rm ./rluser.texinfo
282
283 # GDB INTERNALS MANUAL: TeX dvi file
284 gdbint.dvi : gdbint.texinfo
285 TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdbint.texinfo
286 texindex gdbint.??
287 TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdbint.texinfo
288 rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \
289 gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs
290
291 # GDB INTERNALS MANUAL: info file
292 gdb-internals: gdbint.info
293
294 gdbint.info: gdbint.texinfo
295 $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
296
297 force:
298
299 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
300 $(SHELL) ./config.status