1 ##Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002
2 ##Free Software Foundation, Inc.
4 # Makefile for GDB documentation.
5 # This file is part of GDB.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 htmldir
= $(prefix)/html
34 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
35 INSTALL_DATA
= @INSTALL_DATA@
37 # main GDB source directory
40 # where to find texinfo; GDB dist should include a recent one
41 TEXIDIR
=${gdbdir}/..
/texinfo
43 # where to find makeinfo, preferably one designed for texinfo-2
46 # Note that texinfo 4.0's makeinfo --html can only generate a
47 # single file, which would be too large, so continue to use
48 # texi2html. -sts 2000-03-28
51 MAKEHTMLFLAGS
= -menu
-split_chapter
53 # where to find texi2roff, ditto
56 # where to find texi2dvi, ditto
59 # Where is the source dir for the READLINE library doc?
60 # Traditionally readline is in .. or .
61 READLINE_DIR
= ${gdbdir}/..
/readline
/doc
63 # The GDB/MI docs come from a sibling directory ../mi
64 GDBMI_DIR
= ${gdbdir}/mi
67 TEXINPUTS
=${TEXIDIR}:.
:$(srcdir):$(READLINE_DIR
):$(GDBMI_DIR
):$$TEXINPUTS
69 # Files which should be generated via 'info' and installed by 'install-info'
70 INFO_DEPS
= gdb.
info gdbint.
info stabs.
info
72 # There may be alternate predefined collections of switches to configure
73 # the GDB manual. Normally this is not done in synch with the software
74 # config system, since this choice tends to be independent; most people
75 # want a doc config of `all' for a generic manual, regardless of sw config.
78 # This list of sed edits will edit the GDB reference card
79 # for what fonts and what papersize to use.
80 # By default (NO edits applied), the refcard uses:
81 # - Computer Modern (CM) fonts
82 # - US letter paper (8.5x11in)
83 # List some of the following files for alternative fonts and paper:
84 # a4rc.sed use A4 paper (297 x 210 mm)
85 # psrc.sed use PostScript fonts (Karl Berry short TeX names)
86 # lpsrc.sed use PostScript fonts (full PostScript names in TeX)
87 # e.g. for A4, Postscript: REFEDITS = a4rc.sed psrc.sed
88 # for A4, CM fonts: REFEDITS = a4rc.sed
89 # for US, PS fonts: REFEDITS = psrc.sed
93 # Don Knuth's TeX formatter
96 # Program to generate Postscript files from DVI files.
99 # Main GDB manual's source files
100 SFILES_INCLUDED
= gdb-cfg.texi \
101 $(srcdir)/annotate.texi \
105 SFILES_LOCAL
= $(srcdir)/gdb.texinfo GDBvn.texi
$(SFILES_INCLUDED
)
107 SFILES_DOC
= $(SFILES_LOCAL
) $(GDBMI_DIR
)/gdbmi.texinfo \
108 $(READLINE_DIR
)/rluser.texinfo
$(READLINE_DIR
)/inc-hist.texinfo
110 #### Host, target, and site specific Makefile fragments come in here.
116 dvi: gdb.
dvi gdbint.
dvi stabs.
dvi refcard.
dvi
117 ps
: gdb.ps gdbint.ps stabs.ps refcard.ps
118 html
: gdb_toc.html gdbint_toc.html stabs_toc.html
119 pdf
: gdb.pdf gdbint.pdf stabs.pdf
120 all-doc
: info dvi ps
# pdf
123 install-info
: $(INFO_DEPS
)
124 $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
$(infodir)
125 @list
='$(INFO_DEPS)'; \
126 for file in
$$list; do \
127 if
test -f
$$file; then d
=.
; else d
=$(srcdir); fi
; \
128 for ifile in
`cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
129 if
test -f
$$d/$$ifile; then \
130 echo
" $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
131 $(INSTALL_DATA
) $$d/$$ifile $(infodir)/$$ifile; \
135 @if
$(SHELL
) -c
'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev
/null
2>&1; then \
136 list
='$(INFO_DEPS)'; \
137 for file in
$$list; do \
138 echo
" install-info --info-dir=$(infodir) $(infodir)/$$file";\
139 install-info
--info-dir
=$(infodir) $(infodir)/$$file ||
:;\
144 for i in
*.html
; do \
145 $(INSTALL_DATA
) $$i $(htmldir
)/$$i ; \
148 STAGESTUFF
= *.
info* gdb-all.texi GDBvn.texi
*.ps
*.
dvi *.pdf
150 # Copy the object files from a particular stage into a subdirectory.
153 -mv
$(STAGESTUFF
) stage1
157 -mv
$(STAGESTUFF
) stage2
161 -mv
$(STAGESTUFF
) stage3
166 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
169 -(cd stage1
; mv
-f
* ..
)
173 -(cd stage2
; mv
-f
* ..
)
177 -(cd stage3
; mv
-f
* ..
)
180 # The "least clean" level of cleaning. Get rid of files which are
181 # automatically generated files that are just intermediate files,
184 rm -f gdb.mm gdb.ms gdb.me links2roff
185 rm -f
*.aux
*.cp
* *.fn
* *.ky
* *.log
*.pg
* *.toc
*.tp
* *.vr
*
186 rm -f sedref.
dvi sedref.
tex tmp.sed
189 rm -f rluser.texinfo inc-hist.texinfo gdb-cfg.texi
192 rm -f Makefile config.status
194 # GDBvn.texi, the dvi files, the info files, and the postscript files,
195 # are all part of the distribution, so it should not be removed by
196 # "clean" or "distclean". Use maintainer-clean to remove them.
198 maintainer-clean
realclean: distclean
199 rm -f GDBvn.texi
*.
info* *.
dvi *.ps
*.html
*.pdf
201 # GDB QUICK REFERENCE (dvi output)
202 refcard.
dvi : refcard.
tex $(REFEDITS
)
204 for f in x
$(REFEDITS
) ; do \
205 test x
$$f = xx
&& continue
; \
206 cat
$(srcdir)/$$f >>tmp.sed
; \
208 sed
-f tmp.sed
$(srcdir)/refcard.
tex >sedref.
tex
209 $(SET_TEXINPUTS
) $(TEX
) sedref.
tex
210 mv sedref.
dvi refcard.
dvi
211 rm -f sedref.log sedref.
tex tmp.sed
213 refcard.ps
: refcard.
dvi
214 $(DVIPS
) -t landscape
-o
$@
$?
216 # File to record current GDB version number (copied from main dir version.in)
217 GDBvn.texi
: ${gdbdir}/version.in
218 echo
"@set GDBVN `head -1 $(srcdir)/../version.in`" > .
/GDBvn.new
219 mv GDBvn.new GDBvn.texi
222 .PRECIOUS
: GDBvn.texi
224 # Choose configuration for GDB manual (normally `all'; normally not tied into
225 # `configure' script because most users prefer generic version of manual,
226 # not one for their binary config---which may not be specifically
228 gdb-cfg.texi
: ${srcdir}/${DOC_CONFIG}-cfg.texi
229 (test "$$LN_S" = "ln -s" && \
230 ln
-s
${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
) || \
231 ln
${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
232 cp
${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
234 # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
235 # If your texinfo or makeinfo don't support these, get a new texinfo release
237 # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
238 # Note that we can *generate* GDBvn.texi, but since we distribute one in the
239 # source directory for the benefit of people who *don't* use this makefile,
240 # VPATH will often tell make not to bother building it, because the one
241 # in the srcdir is up to date. (if not, then make should build one here).
243 # GDB MANUAL: TeX dvi file
244 gdb.
dvi: ${SFILES_DOC}
245 if
[ ! -f .
/GDBvn.texi
]; then \
246 (test "$$LN_S" = "ln -s" && ln
-s
$(srcdir)/GDBvn.texi .
) || \
247 ln
$(srcdir)/GDBvn.texi . || \
248 cp
$(srcdir)/GDBvn.texi .
; else true
; fi
249 $(SET_TEXINPUTS
) $(TEXI2DVI
) $(srcdir)/gdb.texinfo
250 rm -f gdb.aux gdb.cp
* gdb.fn
* gdb.ky
* gdb.log gdb.pg
* gdb.toc \
256 gdb.pdf
: ${SFILES_DOC}
257 if
[ ! -f .
/GDBvn.texi
]; then \
258 (test "$$LN_S" = "ln -s" && ln
-s
$(srcdir)/GDBvn.texi .
) || \
259 ln
$(srcdir)/GDBvn.texi . || \
260 cp
$(srcdir)/GDBvn.texi .
; else true
; fi
261 $(SET_TEXINPUTS
) $(TEXI2DVI
) --pdf
$(srcdir)/gdb.texinfo
262 rm -f gdb.aux gdb.cp
* gdb.fn
* gdb.ky
* gdb.log gdb.pg
* gdb.toc \
265 # GDB MANUAL: info file
266 gdb.
info: ${SFILES_DOC}
267 $(MAKEINFO
) -I
${READLINE_DIR} -I
${GDBMI_DIR} -I
$(srcdir) \
268 -o gdb.
info $(srcdir)/gdb.texinfo
270 # GDB MANUAL: roff translations
271 # Try to use a recent texi2roff. v2 was put on prep in jan91.
272 # If you want an index, see texi2roff doc for postprocessing
273 # and add -i to texi2roff invocations below.
274 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
275 # corresponding -e lines when later texi2roff's are current)
276 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
277 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
278 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
279 # + @alphaenumerate is ridiculously new, turned into @enumerate
281 # texi2roff doesn't have a notion of include dirs, so we have to fake
282 # it out for gdb manual's include files---but only if not configured
284 links2roff
: $(SFILES_INCLUDED
)
285 if
[ ! -f gdb.texinfo
]; then \
286 (test "$$LN_S" = "ln -s" && ln
-s
$(SFILES_INCLUDED
) .
) || \
287 ln
$(SFILES_INCLUDED
) . || \
288 cp
$(SFILES_INCLUDED
) .
; \
292 # "Readline" appendices. Get them also due to lack of includes,
293 # regardless of whether or not configuring in main sourcedir.
294 # @ftable removed due to bug in texi2roff-2; if your texi2roff
295 # is newer, try just ln or cp
296 rluser.texinfo
: ${READLINE_DIR}/rluser.texinfo
297 sed
-e
's/^@ftable/@table/g' \
298 -e
's/^@end ftable/@end table/g' \
299 ${READLINE_DIR}/rluser.texinfo
> .
/rluser.texinfo
301 inc-hist.texinfo
: ${READLINE_DIR}/inc-hist.texinfo
302 (test "$$LN_S" = "ln -s" && \
303 ln
-s
${READLINE_DIR}/inc-hist.texinfo .
) || \
304 ln
${READLINE_DIR}/inc-hist.texinfo . || \
305 cp
${READLINE_DIR}/inc-hist.texinfo .
307 gdbmi.texinfo
: ${GDBMI_DIR}/gdbmi.texinfo
308 (test "$$LN_S" = "ln -s" && \
309 ln
-s
${GDBMI_DIR}/gdbmi.texinfo .
) || \
310 ln
${GDBMI_DIR}/gdbmi.texinfo . || \
311 cp
${GDBMI_DIR}/gdbmi.texinfo .
313 # gdb manual suitable for [gtn]roff -me
314 gdb.me
: $(SFILES_LOCAL
) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
315 sed
-e
'/\\input texinfo/d' \
316 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
317 -e
'/^@ifinfo/,/^@end ifinfo/d' \
321 -e
's/^@alphaenumerate/@enumerate/g' \
322 -e
's/^@end alphaenumerate/@end enumerate/g' \
323 $(srcdir)/gdb.texinfo | \
325 sed
-e
's/---/\\(em/g' \
328 # gdb manual suitable for [gtn]roff -ms
329 gdb.ms
: $(SFILES_LOCAL
) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
330 sed
-e
'/\\input texinfo/d' \
331 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
332 -e
'/^@ifinfo/,/^@end ifinfo/d' \
336 -e
's/^@alphaenumerate/@enumerate/g' \
337 -e
's/^@end alphaenumerate/@end enumerate/g' \
338 $(srcdir)/gdb.texinfo | \
340 sed
-e
's/---/\\(em/g' \
343 # gdb manual suitable for [tn]roff -mm
344 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
345 # try leaving them in
346 gdb.mm
: $(SFILES_LOCAL
) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
347 sed
-e
'/\\input texinfo/d' \
348 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
349 -e
'/^@ifinfo/,/^@end ifinfo/d' \
354 -e
's/^@alphaenumerate/@enumerate/g' \
355 -e
's/^@end alphaenumerate/@end enumerate/g' \
356 $(srcdir)/gdb.texinfo | \
358 sed
-e
's/---/\\(em/g' \
361 # GDB MANUAL: HTML file
363 gdb_toc.html
: ${SFILES_DOC}
364 $(MAKEHTML
) $(MAKEHTMLFLAGS
) -I
${READLINE_DIR} -I
${GDBMI_DIR} -I
$(srcdir) $(srcdir)/gdb.texinfo
366 # GDB INTERNALS MANUAL: TeX dvi file
367 gdbint.
dvi: gdbint.texinfo gdb-cfg.texi fdl.texi
368 $(SET_TEXINPUTS
) $(TEXI2DVI
) $(srcdir)/gdbint.texinfo
369 rm -f gdbint.aux gdbint.cp
* gdbint.fn
* gdbint.ky
* \
370 gdbint.log gdbint.pg
* gdbint.toc gdbint.tp
* gdbint.vr
*
372 gdbint.ps
: gdbint.
dvi
375 gdbint.pdf
: gdbint.texinfo gdb-cfg.texi fdl.texi
376 $(SET_TEXINPUTS
) $(TEXI2DVI
) --pdf
$(srcdir)/gdbint.texinfo
377 rm -f gdbint.aux gdbint.cp
* gdbint.fn
* gdbint.ky
* \
378 gdbint.log gdbint.pg
* gdbint.toc gdbint.tp
* gdbint.vr
*
380 # GDB INTERNALS MANUAL: info file
382 gdbint.
info: gdbint.texinfo fdl.texi
383 $(MAKEINFO
) -I
$(srcdir) -o gdbint.
info $(srcdir)/gdbint.texinfo
385 # GDB INTERNALS MANUAL: HTML file
387 gdbint_toc.html
: gdbint.texinfo gdb-cfg.texi fdl.texi
388 $(MAKEHTML
) $(MAKEHTMLFLAGS
) $(srcdir)/gdbint.texinfo
390 stabs.
info: stabs.texinfo
391 $(MAKEINFO
) -o stabs.
info $(srcdir)/stabs.texinfo
393 # STABS DOCUMENTATION: HTML file
395 stabs_toc.html
: stabs.texinfo
396 $(MAKEHTML
) $(MAKEHTMLFLAGS
) $(srcdir)/stabs.texinfo
398 # STABS DOCUMENTATION: TeX dvi file
399 stabs.
dvi : stabs.texinfo
400 $(SET_TEXINPUTS
) $(TEXI2DVI
) $(srcdir)/stabs.texinfo
401 rm -f stabs.aux stabs.cp
* stabs.fn
* stabs.ky
* \
402 stabs.log stabs.pg
* stabs.toc stabs.tp
* stabs.vr
*
408 $(SET_TEXINPUTS
) $(TEXI2DVI
) --pdf
$(srcdir)/stabs.texinfo
409 rm -f stabs.aux stabs.cp
* stabs.fn
* stabs.ky
* \
410 stabs.log stabs.pg
* stabs.toc stabs.tp
* stabs.vr
*
414 Makefile
: Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
) config.status
415 $(SHELL
) .
/config.status