1 ##Copyright (C) 1991, 1992 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.
24 infodir = $(prefix)/info
29 INSTALL_PROGRAM
= $(INSTALL
)
30 INSTALL_DATA
= $(INSTALL
)
32 # main GDB source directory
35 # where to find texinfo; GDB dist should include a recent one
36 TEXIDIR
=${gdbdir}/..
/texinfo
38 # where to find makeinfo, preferably one designed for texinfo-2
41 # where to find texi2roff, ditto
44 # Where is the source dir for the READLINE library doc?
45 # Traditionally readline is in .. or .
46 READLINE_DIR
= ${gdbdir}/..
/readline
/doc
48 SET_TEXINPUTS
= TEXINPUTS
=${TEXIDIR}:.
:$(srcdir):$(READLINE_DIR
):$$TEXINPUTS
50 # There may be alternate predefined collections of switches to configure
51 # the GDB manual. Normally this is not done in synch with the software
52 # config system, since this choice tends to be independent; most people
53 # want a doc config of `all' for a generic manual, regardless of sw config.
56 # This list of sed edits will edit the GDB reference card
57 # for what fonts and what papersize to use.
58 # By default (NO edits applied), the refcard uses:
59 # - Computer Modern (CM) fonts
60 # - US letter paper (8.5x11in)
61 # List some of the following files for alternative fonts and paper:
62 # a4rc.sed use A4 paper (297 x 210 mm)
63 # psrc.sed use PostScript fonts (Karl Berry short TeX names)
64 # lpsrc.sed use PostScript fonts (full PostScript names in TeX)
65 # e.g. for A4, Postscript: REFEDITS = a4rc.sed psrc.sed
66 # for A4, CM fonts: REFEDITS = a4rc.sed
67 # for US, PS fonts: REFEDITS = psrc.sed
71 # Don Knuth's TeX formatter
74 # auxiliary program for sorting Texinfo indices
77 # Main GDB manual's source files
78 SFILES_INCLUDED
= gdb-cfg.texi
$(srcdir)/remote.texi
80 SFILES_LOCAL
= $(srcdir)/gdb.texinfo GDBvn.texi
$(SFILES_INCLUDED
)
82 SFILES_DOC
= $(SFILES_LOCAL
) \
83 $(READLINE_DIR
)/rluser.texinfo
$(READLINE_DIR
)/inc-hist.texi
85 #### Host, target, and site specific Makefile fragments come in here.
90 info: gdb.
info gdbint.
info stabs.
info
91 dvi: gdb.
dvi refcard.
dvi gdbint.
dvi
92 all-doc
: gdb.
info gdb.
dvi refcard.
dvi gdb-internals gdbint.
dvi
95 for i in
*.
info* ; do \
96 $(INSTALL_DATA
) $$i $(infodir)/$$i ; \
99 STAGESTUFF
= *.
info* gdb-all.texi GDBvn.texi
101 # Copy the object files from a particular stage into a subdirectory.
104 -mv
$(STAGESTUFF
) stage1
108 -mv
$(STAGESTUFF
) stage2
112 -mv
$(STAGESTUFF
) stage3
117 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
120 -(cd stage1
; mv
-f
* ..
)
124 -(cd stage2
; mv
-f
* ..
)
128 -(cd stage3
; mv
-f
* ..
)
132 rm -f gdb.
info* gdbint.
info* stabs.
info*
135 rm -f gdb.
dvi gdbint.
dvi stabs.
dvi sedref.
dvi
137 mostlyclean: clean-info clean-dvi
138 rm -f gdb.?? gdb.??? gdb.mm gdb.ms gdb.me
140 rm -f refcard.ps lrefcard.ps refcard.log sedref.
* *~
141 rm -f gdbint.?? gdbint.??? stabs.?? stabs.???
144 rm -f rluser.texinfo inc-hist.texi gdb-cfg.texi
147 rm -f Makefile config.status
149 # GDBvn.texi and refcard.dvi are distributed, so they should not be
150 # removed by "clean" or "distclean".
151 maintainer-clean
realclean: distclean clean-dvi clean-info
152 rm -f GDBvn.texi refcard.
dvi
154 # GDB QUICK REFERENCE (dvi output)
155 refcard.
dvi : refcard.
tex $(REFEDITS
)
156 if
[ -z
"$(REFEDITS)" ]; then \
157 cp
$(srcdir)/refcard.
tex sedref.
tex ; \
160 for f in
"$(REFEDITS)" ; do \
161 cat
$(srcdir)/$$f >>tmp.sed
; done
; \
162 sed
-f tmp.sed
$(srcdir)/refcard.
tex >sedref.
tex ; \
164 $(SET_TEXINPUTS
) $(TEX
) sedref.
tex
165 mv sedref.
dvi refcard.
dvi
166 rm -f sedref.log sedref.
tex tmp.sed
168 refcard.ps
: refcard.
dvi
169 dvips
-t landscape refcard.
dvi -o
171 # File to record current GDB version number (copied from main dir Makefile.in)
172 GDBvn.texi
: ${gdbdir}/Makefile.in
173 echo
"@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`" > .
/GDBvn.new
174 mv GDBvn.new GDBvn.texi
177 .PRECIOUS
: GDBvn.texi
179 # Choose configuration for GDB manual (normally `all'; normally not tied into
180 # `configure' script because most users prefer generic version of manual,
181 # not one for their binary config---which may not be specifically
183 gdb-cfg.texi
: ${srcdir}/${DOC_CONFIG}-cfg.texi
184 ln
-s
${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
185 ln
${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
186 cp
${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
188 # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
189 # If your texinfo or makeinfo don't support these, get a new texinfo release
191 # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
192 # Note that we can *generate* GDBvn.texi, but since we distribute one in the
193 # source directory for the benefit of people who *don't* use this makefile,
194 # VPATH will often tell make not to bother building it, because the one
195 # in the srcdir is up to date. (if not, then make should build one here).
197 # GDB MANUAL: TeX dvi file
198 gdb.
dvi: ${SFILES_DOC}
199 if
[ ! -f .
/GDBvn.texi
]; then \
200 ln
-s
$(srcdir)/GDBvn.texi . || \
201 ln
$(srcdir)/GDBvn.texi . || \
202 cp
$(srcdir)/GDBvn.texi .
; else true
; fi
203 $(SET_TEXINPUTS
) $(TEX
) gdb.texinfo
204 $(SET_TEXINPUTS
) $(TEX
) gdb.texinfo
206 $(SET_TEXINPUTS
) $(TEX
) gdb.texinfo
207 rm -f gdb.?? gdb.log gdb.aux gdb.toc gdb.??s
209 # GDB MANUAL: info file
210 # We're using texinfo2, and older makeinfo's may not be able to
211 # cope with all the markup.
212 gdb.
info: ${SFILES_DOC}
213 $(MAKEINFO
) -I
${READLINE_DIR} -I
$(srcdir) -o .
/gdb.
info gdb.texinfo
215 # GDB MANUAL: roff translations
216 # Try to use a recent texi2roff. v2 was put on prep in jan91.
217 # If you want an index, see texi2roff doc for postprocessing
218 # and add -i to texi2roff invocations below.
219 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
220 # corresponding -e lines when later texi2roff's are current)
221 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
222 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
223 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
224 # + @alphaenumerate is ridiculously new, turned into @enumerate
226 # texi2roff doesn't have a notion of include dirs, so we have to fake
227 # it out for gdb manual's include files---but only if not configured
229 links2roff
: $(SFILES_INCLUDED
)
230 if
[ ! -f gdb.texinfo
]; then \
231 ln
-s
$(SFILES_INCLUDED
) . || \
232 ln
$(SFILES_INCLUDED
) . || \
233 cp
$(SFILES_INCLUDED
) .
; \
237 # "Readline" appendices. Get them also due to lack of includes,
238 # regardless of whether or not configuring in main sourcedir.
239 # @ftable removed due to bug in texi2roff-2; if your texi2roff
240 # is newer, try just ln or cp
241 rluser.texinfo
: ${READLINE_DIR}/rluser.texinfo
242 sed
-e
's/^@ftable/@table/g' \
243 -e
's/^@end ftable/@end table/g' \
244 ${READLINE_DIR}/rluser.texinfo
> .
/rluser.texinfo
246 inc-hist.texi
: ${READLINE_DIR}/inc-hist.texi
247 ln
-s
${READLINE_DIR}/inc-hist.texi . || \
248 ln
${READLINE_DIR}/inc-hist.texi . || \
249 cp
${READLINE_DIR}/inc-hist.texi .
251 # gdb manual suitable for [gtn]roff -me
252 gdb.me
: $(SFILES_LOCAL
) links2roff rluser.texinfo inc-hist.texi
253 sed
-e
'/\\input texinfo/d' \
254 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
255 -e
'/^@ifinfo/,/^@end ifinfo/d' \
259 -e
's/^@alphaenumerate/@enumerate/g' \
260 -e
's/^@end alphaenumerate/@end enumerate/g' \
261 $(srcdir)/gdb.texinfo | \
263 sed
-e
's/---/\\(em/g' \
266 # gdb manual suitable for [gtn]roff -ms
267 gdb.ms
: $(SFILES_LOCAL
) links2roff rluser.texinfo inc-hist.texi
268 sed
-e
'/\\input texinfo/d' \
269 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
270 -e
'/^@ifinfo/,/^@end ifinfo/d' \
274 -e
's/^@alphaenumerate/@enumerate/g' \
275 -e
's/^@end alphaenumerate/@end enumerate/g' \
276 $(srcdir)/gdb.texinfo | \
278 sed
-e
's/---/\\(em/g' \
281 # gdb manual suitable for [tn]roff -mm
282 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
283 # try leaving them in
284 gdb.mm
: $(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' \
292 -e
's/^@alphaenumerate/@enumerate/g' \
293 -e
's/^@end alphaenumerate/@end enumerate/g' \
294 $(srcdir)/gdb.texinfo | \
296 sed
-e
's/---/\\(em/g' \
299 # start-sanitize-gdbtk
300 # GDB GUI MANUAL: TeX dvi file
301 gdbgui.
dvi : gdbgui.texinfo
${SFILES_DOC}
302 $(SET_TEXINPUTS
) $(TEX
) gdbgui.texinfo
303 $(TEXINDEX
) gdbgui.??
304 $(SET_TEXINPUTS
) $(TEX
) gdbgui.texinfo
305 rm -f gdbgui.?? gdbgui.aux gdbgui.cps gdbgui.fns gdbgui.kys \
306 gdbgui.log gdbgui.pgs gdbgui.toc gdbgui.tps gdbgui.vrs
308 # GDB GUI MANUAL: info file
311 gdbgui.
info: gdbgui.texinfo
${SFILES_DOC}
312 $(MAKEINFO
) -o gdbgui.
info $(srcdir)/gdbgui.texinfo
315 # GDB INTERNALS MANUAL: TeX dvi file
316 gdbint.
dvi : gdbint.texinfo
317 $(SET_TEXINPUTS
) $(TEX
) gdbint.texinfo
318 $(TEXINDEX
) gdbint.??
319 $(SET_TEXINPUTS
) $(TEX
) gdbint.texinfo
320 rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \
321 gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs
323 # GDB INTERNALS MANUAL: info file
324 gdb-internals
: gdbint.
info
326 gdbint.
info: gdbint.texinfo
327 $(MAKEINFO
) -o gdbint.
info $(srcdir)/gdbint.texinfo
329 stabs.
info: stabs.texinfo
330 $(MAKEINFO
) -o stabs.
info $(srcdir)/stabs.texinfo
332 # STABS DOCUMENTATION: TeX dvi file
333 stabs.
dvi : stabs.texinfo
334 $(SET_TEXINPUTS
) $(TEX
) stabs.texinfo
336 $(SET_TEXINPUTS
) $(TEX
) stabs.texinfo
337 rm -f stabs.?? stabs.aux stabs.cps stabs.fns stabs.kys \
338 stabs.log stabs.pgs stabs.toc stabs.tps stabs.vrs
341 dvips
-o stabs.ps stabs
345 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
346 $(SHELL
) .
/config.status