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