* gdb.texinfo: Fix typos and markup. From Dmitry Sivachenko
[deliverable/binutils-gdb.git] / gdb / doc / Makefile.in
CommitLineData
be298bcc 1##Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002
b6ba6518 2##Free Software Foundation, Inc.
c906108c
SS
3
4# Makefile for GDB documentation.
5# This file is part of GDB.
6
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.
11#
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.
16#
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.
20
21srcdir = @srcdir@
22VPATH = @srcdir@
23
24prefix = @prefix@
25
26infodir = @infodir@
085dd6e6 27htmldir = $(prefix)/html
c906108c
SS
28
29SHELL = @SHELL@
30
39ec5655
EZ
31LN_S = @LN_S@
32
c906108c
SS
33INSTALL = @INSTALL@
34INSTALL_PROGRAM = @INSTALL_PROGRAM@
35INSTALL_DATA = @INSTALL_DATA@
36
37# main GDB source directory
38gdbdir = $(srcdir)/..
39
40# where to find texinfo; GDB dist should include a recent one
41TEXIDIR=${gdbdir}/../texinfo
42
43# where to find makeinfo, preferably one designed for texinfo-2
44MAKEINFO=makeinfo
45
6d2ebf8b
SS
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
49
085dd6e6 50MAKEHTML = texi2html
f4846649 51MAKEHTMLFLAGS = -menu -split_chapter
085dd6e6 52
c906108c
SS
53# where to find texi2roff, ditto
54TEXI2ROFF=texi2roff
55
be298bcc
AC
56# where to find texi2dvi, ditto
57TEXI2DVI=texi2dvi
58
c906108c
SS
59# Where is the source dir for the READLINE library doc?
60# Traditionally readline is in .. or .
61READLINE_DIR = ${gdbdir}/../readline/doc
62
7162c0ca
EZ
63# The GDB/MI docs come from a sibling directory ../mi
64GDBMI_DIR = ${gdbdir}/mi
65
66SET_TEXINPUTS = \
67 TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$(GDBMI_DIR):$$TEXINPUTS
c906108c 68
63ac3005
EZ
69# Files which should be generated via 'info' and installed by 'install-info'
70INFO_DEPS = gdb.info gdbint.info stabs.info
71
c906108c
SS
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.
76DOC_CONFIG = all
77
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
90# for default:
91REFEDITS =
92
93# Don Knuth's TeX formatter
94TEX = tex
95
c906108c
SS
96# Program to generate Postscript files from DVI files.
97DVIPS = dvips
98
99# Main GDB manual's source files
6826cf00 100SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/annotate.texi $(srcdir)/fdl.texi
c906108c
SS
101
102SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED)
103
7162c0ca 104SFILES_DOC = $(SFILES_LOCAL) $(GDBMI_DIR)/gdbmi.texinfo \
7be570e7 105 $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texinfo
c906108c
SS
106
107#### Host, target, and site specific Makefile fragments come in here.
108###
109
110all install:
111
63ac3005 112info: $(INFO_DEPS)
c906108c
SS
113dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi
114ps: gdb.ps gdbint.ps stabs.ps refcard.ps
085dd6e6 115html: gdb_toc.html gdbint_toc.html stabs_toc.html
449f3b6c
AC
116pdf: gdb.pdf gdbint.pdf stabs.pdf
117all-doc: info dvi ps # pdf
3555de01 118diststuff: info
c906108c 119
63ac3005 120install-info: $(INFO_DEPS)
9ef47d30 121 $(SHELL) $(srcdir)/../../mkinstalldirs $(infodir)
63ac3005
EZ
122 @list='$(INFO_DEPS)'; \
123 for file in $$list; do \
124 if test -f $$file; then d=.; else d=$(srcdir); fi; \
125 for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
126 if test -f $$d/$$ifile; then \
127 echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
128 $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
129 else : ; fi; \
130 done; \
131 done
d3229ae3 132 @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
63ac3005 133 list='$(INFO_DEPS)'; \
d3229ae3
EZ
134 for file in $$list; do \
135 echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
136 install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
137 done; \
138 else : ; fi
c906108c 139
085dd6e6
JM
140install-html: html
141 for i in *.html ; do \
142 $(INSTALL_DATA) $$i $(htmldir)/$$i ; \
143 done
144
449f3b6c 145STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi *.pdf
c906108c
SS
146
147# Copy the object files from a particular stage into a subdirectory.
148stage1: force
149 -mkdir stage1
150 -mv $(STAGESTUFF) stage1
151
152stage2: force
153 -mkdir stage2
154 -mv $(STAGESTUFF) stage2
155
156stage3: force
157 -mkdir stage3
158 -mv $(STAGESTUFF) stage3
159
160against=stage2
161
162comparison: force
163 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
164
165de-stage1: force
166 -(cd stage1 ; mv -f * ..)
167 -rmdir stage1
168
169de-stage2: force
170 -(cd stage2 ; mv -f * ..)
171 -rmdir stage2
172
173de-stage3: force
174 -(cd stage3 ; mv -f * ..)
175 -rmdir stage3
176
177# The "least clean" level of cleaning. Get rid of files which are
178# automatically generated files that are just intermediate files,
179#
180mostlyclean:
181 rm -f gdb.mm gdb.ms gdb.me links2roff
182 rm -f *.aux *.cp* *.fn* *.ky* *.log *.pg* *.toc *.tp* *.vr*
183 rm -f sedref.dvi sedref.tex tmp.sed
184
185clean: mostlyclean
7be570e7 186 rm -f rluser.texinfo inc-hist.texinfo gdb-cfg.texi
c906108c
SS
187
188distclean: clean
189 rm -f Makefile config.status
190
191# GDBvn.texi, the dvi files, the info files, and the postscript files,
192# are all part of the distribution, so it should not be removed by
193# "clean" or "distclean". Use maintainer-clean to remove them.
194
195maintainer-clean realclean: distclean
449f3b6c 196 rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf
c906108c
SS
197
198# GDB QUICK REFERENCE (dvi output)
199refcard.dvi : refcard.tex $(REFEDITS)
dfa249fb
AC
200 echo > tmp.sed
201 for f in x $(REFEDITS) ; do \
202 test x$$f = xx && continue ; \
203 cat $(srcdir)/$$f >>tmp.sed ; \
204 done
205 sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
c906108c
SS
206 $(SET_TEXINPUTS) $(TEX) sedref.tex
207 mv sedref.dvi refcard.dvi
208 rm -f sedref.log sedref.tex tmp.sed
209
210refcard.ps : refcard.dvi
211 $(DVIPS) -t landscape -o $@ $?
212
05a54c4f
AC
213# File to record current GDB version number (copied from main dir version.in)
214GDBvn.texi : ${gdbdir}/version.in
215 echo "@set GDBVN `head -1 $(srcdir)/../version.in`" > ./GDBvn.new
c906108c
SS
216 mv GDBvn.new GDBvn.texi
217
218# Updated atomically
219.PRECIOUS: GDBvn.texi
220
221# Choose configuration for GDB manual (normally `all'; normally not tied into
222# `configure' script because most users prefer generic version of manual,
223# not one for their binary config---which may not be specifically
224# defined anyways).
225gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
39ec5655
EZ
226 (test "$$LN_S" = "ln -s" && \
227 ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
c906108c
SS
228 ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
229 cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
230
231# GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
232# If your texinfo or makeinfo don't support these, get a new texinfo release
233#
234# The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
235# Note that we can *generate* GDBvn.texi, but since we distribute one in the
236# source directory for the benefit of people who *don't* use this makefile,
237# VPATH will often tell make not to bother building it, because the one
238# in the srcdir is up to date. (if not, then make should build one here).
239
240# GDB MANUAL: TeX dvi file
241gdb.dvi: ${SFILES_DOC}
242 if [ ! -f ./GDBvn.texi ]; then \
39ec5655 243 (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
c906108c
SS
244 ln $(srcdir)/GDBvn.texi . || \
245 cp $(srcdir)/GDBvn.texi . ; else true; fi
be298bcc 246 $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/gdb.texinfo
c906108c
SS
247 rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
248 gdb.tp* gdb.vr*
249
250gdb.ps: gdb.dvi
251 $(DVIPS) -o $@ $?
252
449f3b6c
AC
253gdb.pdf: ${SFILES_DOC}
254 if [ ! -f ./GDBvn.texi ]; then \
255 (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
256 ln $(srcdir)/GDBvn.texi . || \
257 cp $(srcdir)/GDBvn.texi . ; else true; fi
be298bcc 258 $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/gdb.texinfo
449f3b6c
AC
259 rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
260 gdb.tp* gdb.vr*
261
c906108c 262# GDB MANUAL: info file
7162c0ca 263# We're using texinfo 3.12; older makeinfo's may not be able to
c906108c
SS
264# cope with all the markup.
265gdb.info: ${SFILES_DOC}
7162c0ca 266 $(MAKEINFO) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo
c906108c
SS
267
268# GDB MANUAL: roff translations
269# Try to use a recent texi2roff. v2 was put on prep in jan91.
270# If you want an index, see texi2roff doc for postprocessing
271# and add -i to texi2roff invocations below.
272# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
273# corresponding -e lines when later texi2roff's are current)
274# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
275# + @c's deleted explicitly because texi2roff sees texinfo commands in them
276# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
277# + @alphaenumerate is ridiculously new, turned into @enumerate
278
279# texi2roff doesn't have a notion of include dirs, so we have to fake
280# it out for gdb manual's include files---but only if not configured
281# in main sourcedir.
282links2roff: $(SFILES_INCLUDED)
283 if [ ! -f gdb.texinfo ]; then \
39ec5655 284 (test "$$LN_S" = "ln -s" && ln -s $(SFILES_INCLUDED) .) || \
c906108c
SS
285 ln $(SFILES_INCLUDED) . || \
286 cp $(SFILES_INCLUDED) . ; \
287 fi
288 touch links2roff
289
290# "Readline" appendices. Get them also due to lack of includes,
291# regardless of whether or not configuring in main sourcedir.
292# @ftable removed due to bug in texi2roff-2; if your texi2roff
293# is newer, try just ln or cp
294rluser.texinfo: ${READLINE_DIR}/rluser.texinfo
295 sed -e 's/^@ftable/@table/g' \
296 -e 's/^@end ftable/@end table/g' \
297 ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo
298
7be570e7 299inc-hist.texinfo: ${READLINE_DIR}/inc-hist.texinfo
39ec5655
EZ
300 (test "$$LN_S" = "ln -s" && \
301 ln -s ${READLINE_DIR}/inc-hist.texinfo .) || \
7be570e7
JM
302 ln ${READLINE_DIR}/inc-hist.texinfo . || \
303 cp ${READLINE_DIR}/inc-hist.texinfo .
c906108c 304
7162c0ca
EZ
305gdbmi.texinfo: ${GDBMI_DIR}/gdbmi.texinfo
306 (test "$$LN_S" = "ln -s" && \
307 ln -s ${GDBMI_DIR}/gdbmi.texinfo .) || \
308 ln ${GDBMI_DIR}/gdbmi.texinfo . || \
309 cp ${GDBMI_DIR}/gdbmi.texinfo .
310
c906108c 311# gdb manual suitable for [gtn]roff -me
7162c0ca 312gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
c906108c
SS
313 sed -e '/\\input texinfo/d' \
314 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
315 -e '/^@ifinfo/,/^@end ifinfo/d' \
316 -e '/^@c /d' \
317 -e 's/{.*,,/{/' \
318 -e 's/@ / /g' \
319 -e 's/^@alphaenumerate/@enumerate/g' \
320 -e 's/^@end alphaenumerate/@end enumerate/g' \
321 $(srcdir)/gdb.texinfo | \
322 $(TEXI2ROFF) -me | \
323 sed -e 's/---/\\(em/g' \
324 >gdb.me
325
326# gdb manual suitable for [gtn]roff -ms
7162c0ca 327gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
c906108c
SS
328 sed -e '/\\input texinfo/d' \
329 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
330 -e '/^@ifinfo/,/^@end ifinfo/d' \
331 -e '/^@c /d' \
332 -e 's/{.*,,/{/' \
333 -e 's/@ / /g' \
334 -e 's/^@alphaenumerate/@enumerate/g' \
335 -e 's/^@end alphaenumerate/@end enumerate/g' \
336 $(srcdir)/gdb.texinfo | \
337 $(TEXI2ROFF) -ms | \
338 sed -e 's/---/\\(em/g' \
339 >gdb.ms
340
341# gdb manual suitable for [tn]roff -mm
342# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
343# try leaving them in
7162c0ca 344gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
c906108c
SS
345 sed -e '/\\input texinfo/d' \
346 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
347 -e '/^@ifinfo/,/^@end ifinfo/d' \
348 -e '/^@c /d' \
349 -e 's/{.*,,/{/' \
350 -e '/@noindent/d' \
351 -e 's/@ / /g' \
352 -e 's/^@alphaenumerate/@enumerate/g' \
353 -e 's/^@end alphaenumerate/@end enumerate/g' \
354 $(srcdir)/gdb.texinfo | \
355 $(TEXI2ROFF) -mm | \
356 sed -e 's/---/\\(em/g' \
357 >gdb.mm
358
085dd6e6
JM
359# GDB MANUAL: HTML file
360
361gdb_toc.html: ${SFILES_DOC}
7162c0ca 362 $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
085dd6e6 363
c906108c 364# GDB INTERNALS MANUAL: TeX dvi file
be298bcc
AC
365gdbint.dvi: gdbint.texinfo gdb-cfg.texi
366 $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/gdbint.texinfo
c906108c
SS
367 rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
368 gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
369
370gdbint.ps : gdbint.dvi
371 $(DVIPS) -o $@ $?
372
be298bcc
AC
373gdbint.pdf: gdbint.dvi gdb-cfg.texi
374 $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/gdbint.texinfo
449f3b6c
AC
375 rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
376 gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
377
c906108c
SS
378# GDB INTERNALS MANUAL: info file
379
380gdbint.info: gdbint.texinfo
381 $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
382
085dd6e6
JM
383# GDB INTERNALS MANUAL: HTML file
384
385gdbint_toc.html: gdbint.texinfo
386 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/gdbint.texinfo
387
c906108c
SS
388stabs.info: stabs.texinfo
389 $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
390
085dd6e6
JM
391# STABS DOCUMENTATION: HTML file
392
393stabs_toc.html: stabs.texinfo
394 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/stabs.texinfo
395
c906108c
SS
396# STABS DOCUMENTATION: TeX dvi file
397stabs.dvi : stabs.texinfo
be298bcc 398 $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/stabs.texinfo
c906108c
SS
399 rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
400 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
401
402stabs.ps: stabs.dvi
403 $(DVIPS) -o $@ $?
404
449f3b6c 405stabs.pdf: stabs.dvi
be298bcc 406 $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/stabs.texinfo
449f3b6c
AC
407 rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
408 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
409
c906108c
SS
410force:
411
412Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) config.status
413 $(SHELL) ./config.status
This page took 0.150955 seconds and 4 git commands to generate.