1 ##Copyright (C) 1991, 1992, 1999 Free Software Foundation, Inc.
3 # Makefile for GDB documentation.
4 # This file is part of GDB.
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 htmldir = $(prefix)/html
31 INSTALL_PROGRAM = @INSTALL_PROGRAM@
32 INSTALL_DATA = @INSTALL_DATA@
34 # main GDB source directory
37 # where to find texinfo; GDB dist should include a recent one
38 TEXIDIR=${gdbdir}/../texinfo
40 # where to find makeinfo, preferably one designed for texinfo-2
44 MAKEHTMLFLAGS = -glossary -menu -split_chapter
46 # where to find texi2roff, ditto
49 # Where is the source dir for the READLINE library doc?
50 # Traditionally readline is in .. or .
51 READLINE_DIR = ${gdbdir}/../readline/doc
53 SET_TEXINPUTS = TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$$TEXINPUTS
55 # There may be alternate predefined collections of switches to configure
56 # the GDB manual. Normally this is not done in synch with the software
57 # config system, since this choice tends to be independent; most people
58 # want a doc config of `all' for a generic manual, regardless of sw config.
61 # This list of sed edits will edit the GDB reference card
62 # for what fonts and what papersize to use.
63 # By default (NO edits applied), the refcard uses:
64 # - Computer Modern (CM) fonts
65 # - US letter paper (8.5x11in)
66 # List some of the following files for alternative fonts and paper:
67 # a4rc.sed use A4 paper (297 x 210 mm)
68 # psrc.sed use PostScript fonts (Karl Berry short TeX names)
69 # lpsrc.sed use PostScript fonts (full PostScript names in TeX)
70 # e.g. for A4, Postscript: REFEDITS = a4rc.sed psrc.sed
71 # for A4, CM fonts: REFEDITS = a4rc.sed
72 # for US, PS fonts: REFEDITS = psrc.sed
76 # Don Knuth's TeX formatter
79 # auxiliary program for sorting Texinfo indices
82 # Program to generate Postscript files from DVI files.
85 # Main GDB manual's source files
86 SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/remote.texi
88 SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED)
90 SFILES_DOC = $(SFILES_LOCAL) \
91 $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texi
93 #### Host, target, and site specific Makefile fragments come in here.
98 info: gdb.info gdbint.info stabs.info
99 dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi
100 ps: gdb.ps gdbint.ps stabs.ps refcard.ps
101 html: gdb_toc.html gdbint_toc.html stabs_toc.html
105 for i in *.info* ; do \
106 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
110 for i in *.html ; do \
111 $(INSTALL_DATA) $$i $(htmldir)/$$i ; \
114 STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi
116 # Copy the object files from a particular stage into a subdirectory.
119 -mv $(STAGESTUFF) stage1
123 -mv $(STAGESTUFF) stage2
127 -mv $(STAGESTUFF) stage3
132 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
135 -(cd stage1 ; mv -f * ..)
139 -(cd stage2 ; mv -f * ..)
143 -(cd stage3 ; mv -f * ..)
146 # The "least clean" level of cleaning. Get rid of files which are
147 # automatically generated files that are just intermediate files,
150 rm -f gdb.mm gdb.ms gdb.me links2roff
151 rm -f *.aux *.cp* *.fn* *.ky* *.log *.pg* *.toc *.tp* *.vr*
152 rm -f sedref.dvi sedref.tex tmp.sed
155 rm -f rluser.texinfo inc-hist.texi gdb-cfg.texi
158 rm -f Makefile config.status
160 # GDBvn.texi, the dvi files, the info files, and the postscript files,
161 # are all part of the distribution, so it should not be removed by
162 # "clean" or "distclean". Use maintainer-clean to remove them.
164 maintainer-clean realclean: distclean
165 rm -f GDBvn.texi *.info* *.dvi *.ps *.html
167 # GDB QUICK REFERENCE (dvi output)
168 refcard.dvi : refcard.tex $(REFEDITS)
169 if [ -z "$(REFEDITS)" ]; then \
170 cp $(srcdir)/refcard.tex sedref.tex ; \
173 for f in "$(REFEDITS)" ; do \
174 cat $(srcdir)/$$f >>tmp.sed ; done ; \
175 sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex ; \
177 $(SET_TEXINPUTS) $(TEX) sedref.tex
178 mv sedref.dvi refcard.dvi
179 rm -f sedref.log sedref.tex tmp.sed
181 refcard.ps : refcard.dvi
182 $(DVIPS) -t landscape -o $@ $?
184 # File to record current GDB version number (copied from main dir Makefile.in)
185 GDBvn.texi : ${gdbdir}/Makefile.in
186 echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/^VERSION *= *//p'`" > ./GDBvn.new
187 mv GDBvn.new GDBvn.texi
190 .PRECIOUS: GDBvn.texi
192 # Choose configuration for GDB manual (normally `all'; normally not tied into
193 # `configure' script because most users prefer generic version of manual,
194 # not one for their binary config---which may not be specifically
196 gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
197 ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
198 ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
199 cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
201 # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
202 # If your texinfo or makeinfo don't support these, get a new texinfo release
204 # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
205 # Note that we can *generate* GDBvn.texi, but since we distribute one in the
206 # source directory for the benefit of people who *don't* use this makefile,
207 # VPATH will often tell make not to bother building it, because the one
208 # in the srcdir is up to date. (if not, then make should build one here).
210 # GDB MANUAL: TeX dvi file
211 gdb.dvi: ${SFILES_DOC}
212 if [ ! -f ./GDBvn.texi ]; then \
213 ln -s $(srcdir)/GDBvn.texi . || \
214 ln $(srcdir)/GDBvn.texi . || \
215 cp $(srcdir)/GDBvn.texi . ; else true; fi
216 $(SET_TEXINPUTS) $(TEX) gdb.texinfo
217 $(SET_TEXINPUTS) $(TEX) gdb.texinfo
219 $(SET_TEXINPUTS) $(TEX) gdb.texinfo
220 rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
226 # GDB MANUAL: info file
227 # We're using texinfo2, and older makeinfo's may not be able to
228 # cope with all the markup.
229 gdb.info: ${SFILES_DOC}
230 $(MAKEINFO) -I ${READLINE_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo
232 # GDB MANUAL: roff translations
233 # Try to use a recent texi2roff. v2 was put on prep in jan91.
234 # If you want an index, see texi2roff doc for postprocessing
235 # and add -i to texi2roff invocations below.
236 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
237 # corresponding -e lines when later texi2roff's are current)
238 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
239 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
240 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
241 # + @alphaenumerate is ridiculously new, turned into @enumerate
243 # texi2roff doesn't have a notion of include dirs, so we have to fake
244 # it out for gdb manual's include files---but only if not configured
246 links2roff: $(SFILES_INCLUDED)
247 if [ ! -f gdb.texinfo ]; then \
248 ln -s $(SFILES_INCLUDED) . || \
249 ln $(SFILES_INCLUDED) . || \
250 cp $(SFILES_INCLUDED) . ; \
254 # "Readline" appendices. Get them also due to lack of includes,
255 # regardless of whether or not configuring in main sourcedir.
256 # @ftable removed due to bug in texi2roff-2; if your texi2roff
257 # is newer, try just ln or cp
258 rluser.texinfo: ${READLINE_DIR}/rluser.texinfo
259 sed -e 's/^@ftable/@table/g' \
260 -e 's/^@end ftable/@end table/g' \
261 ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo
263 inc-hist.texi: ${READLINE_DIR}/inc-hist.texi
264 ln -s ${READLINE_DIR}/inc-hist.texi . || \
265 ln ${READLINE_DIR}/inc-hist.texi . || \
266 cp ${READLINE_DIR}/inc-hist.texi .
268 # gdb manual suitable for [gtn]roff -me
269 gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
270 sed -e '/\\input texinfo/d' \
271 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
272 -e '/^@ifinfo/,/^@end ifinfo/d' \
276 -e 's/^@alphaenumerate/@enumerate/g' \
277 -e 's/^@end alphaenumerate/@end enumerate/g' \
278 $(srcdir)/gdb.texinfo | \
280 sed -e 's/---/\\(em/g' \
283 # gdb manual suitable for [gtn]roff -ms
284 gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
285 sed -e '/\\input texinfo/d' \
286 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
287 -e '/^@ifinfo/,/^@end ifinfo/d' \
291 -e 's/^@alphaenumerate/@enumerate/g' \
292 -e 's/^@end alphaenumerate/@end enumerate/g' \
293 $(srcdir)/gdb.texinfo | \
295 sed -e 's/---/\\(em/g' \
298 # gdb manual suitable for [tn]roff -mm
299 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
300 # try leaving them in
301 gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
302 sed -e '/\\input texinfo/d' \
303 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
304 -e '/^@ifinfo/,/^@end ifinfo/d' \
309 -e 's/^@alphaenumerate/@enumerate/g' \
310 -e 's/^@end alphaenumerate/@end enumerate/g' \
311 $(srcdir)/gdb.texinfo | \
313 sed -e 's/---/\\(em/g' \
316 # GDB MANUAL: HTML file
318 gdb_toc.html: ${SFILES_DOC}
319 $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
322 # GDB INTERNALS MANUAL: TeX dvi file
323 gdbint.dvi : gdbint.texinfo
324 $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
325 $(TEXINDEX) gdbint.??
326 $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
327 rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
328 gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
330 gdbint.ps : gdbint.dvi
333 # GDB INTERNALS MANUAL: info file
335 gdbint.info: gdbint.texinfo
336 $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
338 # GDB INTERNALS MANUAL: HTML file
340 gdbint_toc.html: gdbint.texinfo
341 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/gdbint.texinfo
343 stabs.info: stabs.texinfo
344 $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
346 # STABS DOCUMENTATION: HTML file
348 stabs_toc.html: stabs.texinfo
349 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/stabs.texinfo
351 # STABS DOCUMENTATION: TeX dvi file
352 stabs.dvi : stabs.texinfo
353 $(SET_TEXINPUTS) $(TEX) stabs.texinfo
355 $(SET_TEXINPUTS) $(TEX) stabs.texinfo
356 rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
357 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
364 Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) config.status
365 $(SHELL) ./config.status