gas/ChangeLog
[deliverable/binutils-gdb.git] / gdb / doc / Makefile.in
CommitLineData
b6ba6518
KB
1##Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000
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
56# Where is the source dir for the READLINE library doc?
57# Traditionally readline is in .. or .
58READLINE_DIR = ${gdbdir}/../readline/doc
59
7162c0ca
EZ
60# The GDB/MI docs come from a sibling directory ../mi
61GDBMI_DIR = ${gdbdir}/mi
62
63SET_TEXINPUTS = \
64 TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$(GDBMI_DIR):$$TEXINPUTS
c906108c 65
63ac3005
EZ
66# Files which should be generated via 'info' and installed by 'install-info'
67INFO_DEPS = gdb.info gdbint.info stabs.info
68
c906108c
SS
69# There may be alternate predefined collections of switches to configure
70# the GDB manual. Normally this is not done in synch with the software
71# config system, since this choice tends to be independent; most people
72# want a doc config of `all' for a generic manual, regardless of sw config.
73DOC_CONFIG = all
74
75# This list of sed edits will edit the GDB reference card
76# for what fonts and what papersize to use.
77# By default (NO edits applied), the refcard uses:
78# - Computer Modern (CM) fonts
79# - US letter paper (8.5x11in)
80# List some of the following files for alternative fonts and paper:
81# a4rc.sed use A4 paper (297 x 210 mm)
82# psrc.sed use PostScript fonts (Karl Berry short TeX names)
83# lpsrc.sed use PostScript fonts (full PostScript names in TeX)
84# e.g. for A4, Postscript: REFEDITS = a4rc.sed psrc.sed
85# for A4, CM fonts: REFEDITS = a4rc.sed
86# for US, PS fonts: REFEDITS = psrc.sed
87# for default:
88REFEDITS =
89
90# Don Knuth's TeX formatter
91TEX = tex
92
93# auxiliary program for sorting Texinfo indices
94TEXINDEX = texindex
95
96# Program to generate Postscript files from DVI files.
97DVIPS = dvips
98
449f3b6c
AC
99# Program to generate PDF files from tex files.
100PDFTEX = pdftex
101
c906108c 102# Main GDB manual's source files
6d2ebf8b 103SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/annotate.texi
c906108c
SS
104
105SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED)
106
7162c0ca 107SFILES_DOC = $(SFILES_LOCAL) $(GDBMI_DIR)/gdbmi.texinfo \
7be570e7 108 $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texinfo
c906108c
SS
109
110#### Host, target, and site specific Makefile fragments come in here.
111###
112
113all install:
114
63ac3005 115info: $(INFO_DEPS)
c906108c
SS
116dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi
117ps: gdb.ps gdbint.ps stabs.ps refcard.ps
085dd6e6 118html: gdb_toc.html gdbint_toc.html stabs_toc.html
449f3b6c
AC
119pdf: gdb.pdf gdbint.pdf stabs.pdf
120all-doc: info dvi ps # pdf
3555de01 121diststuff: info
c906108c 122
63ac3005 123install-info: $(INFO_DEPS)
9ef47d30 124 $(SHELL) $(srcdir)/../../mkinstalldirs $(infodir)
63ac3005
EZ
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; \
132 else : ; fi; \
133 done; \
134 done
d3229ae3 135 @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
63ac3005 136 list='$(INFO_DEPS)'; \
d3229ae3
EZ
137 for file in $$list; do \
138 echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
139 install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
140 done; \
141 else : ; fi
c906108c 142
085dd6e6
JM
143install-html: html
144 for i in *.html ; do \
145 $(INSTALL_DATA) $$i $(htmldir)/$$i ; \
146 done
147
449f3b6c 148STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi *.pdf
c906108c
SS
149
150# Copy the object files from a particular stage into a subdirectory.
151stage1: force
152 -mkdir stage1
153 -mv $(STAGESTUFF) stage1
154
155stage2: force
156 -mkdir stage2
157 -mv $(STAGESTUFF) stage2
158
159stage3: force
160 -mkdir stage3
161 -mv $(STAGESTUFF) stage3
162
163against=stage2
164
165comparison: force
166 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
167
168de-stage1: force
169 -(cd stage1 ; mv -f * ..)
170 -rmdir stage1
171
172de-stage2: force
173 -(cd stage2 ; mv -f * ..)
174 -rmdir stage2
175
176de-stage3: force
177 -(cd stage3 ; mv -f * ..)
178 -rmdir stage3
179
180# The "least clean" level of cleaning. Get rid of files which are
181# automatically generated files that are just intermediate files,
182#
183mostlyclean:
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
187
188clean: mostlyclean
7be570e7 189 rm -f rluser.texinfo inc-hist.texinfo gdb-cfg.texi
c906108c
SS
190
191distclean: clean
192 rm -f Makefile config.status
193
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.
197
198maintainer-clean realclean: distclean
449f3b6c 199 rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf
c906108c
SS
200
201# GDB QUICK REFERENCE (dvi output)
202refcard.dvi : refcard.tex $(REFEDITS)
dfa249fb
AC
203 echo > tmp.sed
204 for f in x $(REFEDITS) ; do \
205 test x$$f = xx && continue ; \
206 cat $(srcdir)/$$f >>tmp.sed ; \
207 done
208 sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
c906108c
SS
209 $(SET_TEXINPUTS) $(TEX) sedref.tex
210 mv sedref.dvi refcard.dvi
211 rm -f sedref.log sedref.tex tmp.sed
212
213refcard.ps : refcard.dvi
214 $(DVIPS) -t landscape -o $@ $?
215
05a54c4f
AC
216# File to record current GDB version number (copied from main dir version.in)
217GDBvn.texi : ${gdbdir}/version.in
218 echo "@set GDBVN `head -1 $(srcdir)/../version.in`" > ./GDBvn.new
c906108c
SS
219 mv GDBvn.new GDBvn.texi
220
221# Updated atomically
222.PRECIOUS: GDBvn.texi
223
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
227# defined anyways).
228gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
39ec5655
EZ
229 (test "$$LN_S" = "ln -s" && \
230 ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
c906108c
SS
231 ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
232 cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
233
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
236#
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).
242
243# GDB MANUAL: TeX dvi file
244gdb.dvi: ${SFILES_DOC}
245 if [ ! -f ./GDBvn.texi ]; then \
39ec5655 246 (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
c906108c
SS
247 ln $(srcdir)/GDBvn.texi . || \
248 cp $(srcdir)/GDBvn.texi . ; else true; fi
249 $(SET_TEXINPUTS) $(TEX) gdb.texinfo
250 $(SET_TEXINPUTS) $(TEX) gdb.texinfo
251 $(TEXINDEX) gdb.??
252 $(SET_TEXINPUTS) $(TEX) gdb.texinfo
253 rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
254 gdb.tp* gdb.vr*
255
256gdb.ps: gdb.dvi
257 $(DVIPS) -o $@ $?
258
449f3b6c
AC
259gdb.pdf: ${SFILES_DOC}
260 if [ ! -f ./GDBvn.texi ]; then \
261 (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
262 ln $(srcdir)/GDBvn.texi . || \
263 cp $(srcdir)/GDBvn.texi . ; else true; fi
264 $(SET_TEXINPUTS) $(PDFTEX) gdb.texinfo
265 $(SET_TEXINPUTS) $(PDFTEX) gdb.texinfo
266 $(TEXINDEX) gdb.??
267 $(SET_TEXINPUTS) $(PDFTEX) gdb.texinfo
268 rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
269 gdb.tp* gdb.vr*
270
c906108c 271# GDB MANUAL: info file
7162c0ca 272# We're using texinfo 3.12; older makeinfo's may not be able to
c906108c
SS
273# cope with all the markup.
274gdb.info: ${SFILES_DOC}
7162c0ca 275 $(MAKEINFO) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo
c906108c
SS
276
277# GDB MANUAL: roff translations
278# Try to use a recent texi2roff. v2 was put on prep in jan91.
279# If you want an index, see texi2roff doc for postprocessing
280# and add -i to texi2roff invocations below.
281# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
282# corresponding -e lines when later texi2roff's are current)
283# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
284# + @c's deleted explicitly because texi2roff sees texinfo commands in them
285# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
286# + @alphaenumerate is ridiculously new, turned into @enumerate
287
288# texi2roff doesn't have a notion of include dirs, so we have to fake
289# it out for gdb manual's include files---but only if not configured
290# in main sourcedir.
291links2roff: $(SFILES_INCLUDED)
292 if [ ! -f gdb.texinfo ]; then \
39ec5655 293 (test "$$LN_S" = "ln -s" && ln -s $(SFILES_INCLUDED) .) || \
c906108c
SS
294 ln $(SFILES_INCLUDED) . || \
295 cp $(SFILES_INCLUDED) . ; \
296 fi
297 touch links2roff
298
299# "Readline" appendices. Get them also due to lack of includes,
300# regardless of whether or not configuring in main sourcedir.
301# @ftable removed due to bug in texi2roff-2; if your texi2roff
302# is newer, try just ln or cp
303rluser.texinfo: ${READLINE_DIR}/rluser.texinfo
304 sed -e 's/^@ftable/@table/g' \
305 -e 's/^@end ftable/@end table/g' \
306 ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo
307
7be570e7 308inc-hist.texinfo: ${READLINE_DIR}/inc-hist.texinfo
39ec5655
EZ
309 (test "$$LN_S" = "ln -s" && \
310 ln -s ${READLINE_DIR}/inc-hist.texinfo .) || \
7be570e7
JM
311 ln ${READLINE_DIR}/inc-hist.texinfo . || \
312 cp ${READLINE_DIR}/inc-hist.texinfo .
c906108c 313
7162c0ca
EZ
314gdbmi.texinfo: ${GDBMI_DIR}/gdbmi.texinfo
315 (test "$$LN_S" = "ln -s" && \
316 ln -s ${GDBMI_DIR}/gdbmi.texinfo .) || \
317 ln ${GDBMI_DIR}/gdbmi.texinfo . || \
318 cp ${GDBMI_DIR}/gdbmi.texinfo .
319
c906108c 320# gdb manual suitable for [gtn]roff -me
7162c0ca 321gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
c906108c
SS
322 sed -e '/\\input texinfo/d' \
323 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
324 -e '/^@ifinfo/,/^@end ifinfo/d' \
325 -e '/^@c /d' \
326 -e 's/{.*,,/{/' \
327 -e 's/@ / /g' \
328 -e 's/^@alphaenumerate/@enumerate/g' \
329 -e 's/^@end alphaenumerate/@end enumerate/g' \
330 $(srcdir)/gdb.texinfo | \
331 $(TEXI2ROFF) -me | \
332 sed -e 's/---/\\(em/g' \
333 >gdb.me
334
335# gdb manual suitable for [gtn]roff -ms
7162c0ca 336gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
c906108c
SS
337 sed -e '/\\input texinfo/d' \
338 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
339 -e '/^@ifinfo/,/^@end ifinfo/d' \
340 -e '/^@c /d' \
341 -e 's/{.*,,/{/' \
342 -e 's/@ / /g' \
343 -e 's/^@alphaenumerate/@enumerate/g' \
344 -e 's/^@end alphaenumerate/@end enumerate/g' \
345 $(srcdir)/gdb.texinfo | \
346 $(TEXI2ROFF) -ms | \
347 sed -e 's/---/\\(em/g' \
348 >gdb.ms
349
350# gdb manual suitable for [tn]roff -mm
351# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
352# try leaving them in
7162c0ca 353gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
c906108c
SS
354 sed -e '/\\input texinfo/d' \
355 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
356 -e '/^@ifinfo/,/^@end ifinfo/d' \
357 -e '/^@c /d' \
358 -e 's/{.*,,/{/' \
359 -e '/@noindent/d' \
360 -e 's/@ / /g' \
361 -e 's/^@alphaenumerate/@enumerate/g' \
362 -e 's/^@end alphaenumerate/@end enumerate/g' \
363 $(srcdir)/gdb.texinfo | \
364 $(TEXI2ROFF) -mm | \
365 sed -e 's/---/\\(em/g' \
366 >gdb.mm
367
085dd6e6
JM
368# GDB MANUAL: HTML file
369
370gdb_toc.html: ${SFILES_DOC}
7162c0ca 371 $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
085dd6e6 372
c906108c
SS
373# GDB INTERNALS MANUAL: TeX dvi file
374gdbint.dvi : gdbint.texinfo
375 $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
376 $(TEXINDEX) gdbint.??
377 $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
378 rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
379 gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
380
381gdbint.ps : gdbint.dvi
382 $(DVIPS) -o $@ $?
383
449f3b6c
AC
384gdbint.pdf: gdbint.dvi
385 $(SET_TEXINPUTS) $(PDFTEX) gdbint.texinfo
386 $(TEXINDEX) gdbint.??
387 $(SET_TEXINPUTS) $(PDFTEX) gdbint.texinfo
388 rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
389 gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
390
c906108c
SS
391# GDB INTERNALS MANUAL: info file
392
393gdbint.info: gdbint.texinfo
394 $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
395
085dd6e6
JM
396# GDB INTERNALS MANUAL: HTML file
397
398gdbint_toc.html: gdbint.texinfo
399 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/gdbint.texinfo
400
c906108c
SS
401stabs.info: stabs.texinfo
402 $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
403
085dd6e6
JM
404# STABS DOCUMENTATION: HTML file
405
406stabs_toc.html: stabs.texinfo
407 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/stabs.texinfo
408
c906108c
SS
409# STABS DOCUMENTATION: TeX dvi file
410stabs.dvi : stabs.texinfo
411 $(SET_TEXINPUTS) $(TEX) stabs.texinfo
412 $(TEXINDEX) stabs.??
413 $(SET_TEXINPUTS) $(TEX) stabs.texinfo
414 rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
415 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
416
417stabs.ps: stabs.dvi
418 $(DVIPS) -o $@ $?
419
449f3b6c
AC
420stabs.pdf: stabs.dvi
421 $(SET_TEXINPUTS) $(PDFTEX) stabs.texinfo
422 $(TEXINDEX) stabs.??
423 $(SET_TEXINPUTS) $(PDFTEX) stabs.texinfo
424 rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
425 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
426
c906108c
SS
427force:
428
429Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) config.status
430 $(SHELL) ./config.status
This page took 0.149053 seconds and 4 git commands to generate.