Add support for FreeBSD/i386 ELF.
[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
d3229ae3
EZ
120 @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
121 list='gdb.info gdbint.info stabs.info'; \
122 for file in $$list; do \
123 echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
124 install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
125 done; \
126 else : ; fi
c906108c 127
085dd6e6
JM
128install-html: html
129 for i in *.html ; do \
130 $(INSTALL_DATA) $$i $(htmldir)/$$i ; \
131 done
132
c906108c
SS
133STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi
134
135# Copy the object files from a particular stage into a subdirectory.
136stage1: force
137 -mkdir stage1
138 -mv $(STAGESTUFF) stage1
139
140stage2: force
141 -mkdir stage2
142 -mv $(STAGESTUFF) stage2
143
144stage3: force
145 -mkdir stage3
146 -mv $(STAGESTUFF) stage3
147
148against=stage2
149
150comparison: force
151 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
152
153de-stage1: force
154 -(cd stage1 ; mv -f * ..)
155 -rmdir stage1
156
157de-stage2: force
158 -(cd stage2 ; mv -f * ..)
159 -rmdir stage2
160
161de-stage3: force
162 -(cd stage3 ; mv -f * ..)
163 -rmdir stage3
164
165# The "least clean" level of cleaning. Get rid of files which are
166# automatically generated files that are just intermediate files,
167#
168mostlyclean:
169 rm -f gdb.mm gdb.ms gdb.me links2roff
170 rm -f *.aux *.cp* *.fn* *.ky* *.log *.pg* *.toc *.tp* *.vr*
171 rm -f sedref.dvi sedref.tex tmp.sed
172
173clean: mostlyclean
7be570e7 174 rm -f rluser.texinfo inc-hist.texinfo gdb-cfg.texi
c906108c
SS
175
176distclean: clean
177 rm -f Makefile config.status
178
179# GDBvn.texi, the dvi files, the info files, and the postscript files,
180# are all part of the distribution, so it should not be removed by
181# "clean" or "distclean". Use maintainer-clean to remove them.
182
183maintainer-clean realclean: distclean
085dd6e6 184 rm -f GDBvn.texi *.info* *.dvi *.ps *.html
c906108c
SS
185
186# GDB QUICK REFERENCE (dvi output)
187refcard.dvi : refcard.tex $(REFEDITS)
188 if [ -z "$(REFEDITS)" ]; then \
189 cp $(srcdir)/refcard.tex sedref.tex ; \
190 else \
191 echo > tmp.sed ; \
c741b251 192 for f in $(REFEDITS) ; do \
c906108c
SS
193 cat $(srcdir)/$$f >>tmp.sed ; done ; \
194 sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex ; \
195 fi
196 $(SET_TEXINPUTS) $(TEX) sedref.tex
197 mv sedref.dvi refcard.dvi
198 rm -f sedref.log sedref.tex tmp.sed
199
200refcard.ps : refcard.dvi
201 $(DVIPS) -t landscape -o $@ $?
202
203# File to record current GDB version number (copied from main dir Makefile.in)
204GDBvn.texi : ${gdbdir}/Makefile.in
205 echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/^VERSION *= *//p'`" > ./GDBvn.new
206 mv GDBvn.new GDBvn.texi
207
208# Updated atomically
209.PRECIOUS: GDBvn.texi
210
211# Choose configuration for GDB manual (normally `all'; normally not tied into
212# `configure' script because most users prefer generic version of manual,
213# not one for their binary config---which may not be specifically
214# defined anyways).
215gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
39ec5655
EZ
216 (test "$$LN_S" = "ln -s" && \
217 ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
c906108c
SS
218 ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
219 cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
220
221# GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
222# If your texinfo or makeinfo don't support these, get a new texinfo release
223#
224# The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
225# Note that we can *generate* GDBvn.texi, but since we distribute one in the
226# source directory for the benefit of people who *don't* use this makefile,
227# VPATH will often tell make not to bother building it, because the one
228# in the srcdir is up to date. (if not, then make should build one here).
229
230# GDB MANUAL: TeX dvi file
231gdb.dvi: ${SFILES_DOC}
232 if [ ! -f ./GDBvn.texi ]; then \
39ec5655 233 (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
c906108c
SS
234 ln $(srcdir)/GDBvn.texi . || \
235 cp $(srcdir)/GDBvn.texi . ; else true; fi
236 $(SET_TEXINPUTS) $(TEX) gdb.texinfo
237 $(SET_TEXINPUTS) $(TEX) gdb.texinfo
238 $(TEXINDEX) gdb.??
239 $(SET_TEXINPUTS) $(TEX) gdb.texinfo
240 rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
241 gdb.tp* gdb.vr*
242
243gdb.ps: gdb.dvi
244 $(DVIPS) -o $@ $?
245
246# GDB MANUAL: info file
7162c0ca 247# We're using texinfo 3.12; older makeinfo's may not be able to
c906108c
SS
248# cope with all the markup.
249gdb.info: ${SFILES_DOC}
7162c0ca 250 $(MAKEINFO) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo
c906108c
SS
251
252# GDB MANUAL: roff translations
253# Try to use a recent texi2roff. v2 was put on prep in jan91.
254# If you want an index, see texi2roff doc for postprocessing
255# and add -i to texi2roff invocations below.
256# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
257# corresponding -e lines when later texi2roff's are current)
258# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
259# + @c's deleted explicitly because texi2roff sees texinfo commands in them
260# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
261# + @alphaenumerate is ridiculously new, turned into @enumerate
262
263# texi2roff doesn't have a notion of include dirs, so we have to fake
264# it out for gdb manual's include files---but only if not configured
265# in main sourcedir.
266links2roff: $(SFILES_INCLUDED)
267 if [ ! -f gdb.texinfo ]; then \
39ec5655 268 (test "$$LN_S" = "ln -s" && ln -s $(SFILES_INCLUDED) .) || \
c906108c
SS
269 ln $(SFILES_INCLUDED) . || \
270 cp $(SFILES_INCLUDED) . ; \
271 fi
272 touch links2roff
273
274# "Readline" appendices. Get them also due to lack of includes,
275# regardless of whether or not configuring in main sourcedir.
276# @ftable removed due to bug in texi2roff-2; if your texi2roff
277# is newer, try just ln or cp
278rluser.texinfo: ${READLINE_DIR}/rluser.texinfo
279 sed -e 's/^@ftable/@table/g' \
280 -e 's/^@end ftable/@end table/g' \
281 ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo
282
7be570e7 283inc-hist.texinfo: ${READLINE_DIR}/inc-hist.texinfo
39ec5655
EZ
284 (test "$$LN_S" = "ln -s" && \
285 ln -s ${READLINE_DIR}/inc-hist.texinfo .) || \
7be570e7
JM
286 ln ${READLINE_DIR}/inc-hist.texinfo . || \
287 cp ${READLINE_DIR}/inc-hist.texinfo .
c906108c 288
7162c0ca
EZ
289gdbmi.texinfo: ${GDBMI_DIR}/gdbmi.texinfo
290 (test "$$LN_S" = "ln -s" && \
291 ln -s ${GDBMI_DIR}/gdbmi.texinfo .) || \
292 ln ${GDBMI_DIR}/gdbmi.texinfo . || \
293 cp ${GDBMI_DIR}/gdbmi.texinfo .
294
c906108c 295# gdb manual suitable for [gtn]roff -me
7162c0ca 296gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
c906108c
SS
297 sed -e '/\\input texinfo/d' \
298 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
299 -e '/^@ifinfo/,/^@end ifinfo/d' \
300 -e '/^@c /d' \
301 -e 's/{.*,,/{/' \
302 -e 's/@ / /g' \
303 -e 's/^@alphaenumerate/@enumerate/g' \
304 -e 's/^@end alphaenumerate/@end enumerate/g' \
305 $(srcdir)/gdb.texinfo | \
306 $(TEXI2ROFF) -me | \
307 sed -e 's/---/\\(em/g' \
308 >gdb.me
309
310# gdb manual suitable for [gtn]roff -ms
7162c0ca 311gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
c906108c
SS
312 sed -e '/\\input texinfo/d' \
313 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
314 -e '/^@ifinfo/,/^@end ifinfo/d' \
315 -e '/^@c /d' \
316 -e 's/{.*,,/{/' \
317 -e 's/@ / /g' \
318 -e 's/^@alphaenumerate/@enumerate/g' \
319 -e 's/^@end alphaenumerate/@end enumerate/g' \
320 $(srcdir)/gdb.texinfo | \
321 $(TEXI2ROFF) -ms | \
322 sed -e 's/---/\\(em/g' \
323 >gdb.ms
324
325# gdb manual suitable for [tn]roff -mm
326# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
327# try leaving them in
7162c0ca 328gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
c906108c
SS
329 sed -e '/\\input texinfo/d' \
330 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
331 -e '/^@ifinfo/,/^@end ifinfo/d' \
332 -e '/^@c /d' \
333 -e 's/{.*,,/{/' \
334 -e '/@noindent/d' \
335 -e 's/@ / /g' \
336 -e 's/^@alphaenumerate/@enumerate/g' \
337 -e 's/^@end alphaenumerate/@end enumerate/g' \
338 $(srcdir)/gdb.texinfo | \
339 $(TEXI2ROFF) -mm | \
340 sed -e 's/---/\\(em/g' \
341 >gdb.mm
342
085dd6e6
JM
343# GDB MANUAL: HTML file
344
345gdb_toc.html: ${SFILES_DOC}
7162c0ca 346 $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
085dd6e6 347
3fc11d3e
JM
348# GDB GUI MANUAL: TeX dvi file
349gdbgui.dvi : gdbgui.texinfo ${SFILES_DOC}
350 $(SET_TEXINPUTS) $(TEX) gdbgui.texinfo
351 $(TEXINDEX) gdbgui.??
352 $(SET_TEXINPUTS) $(TEX) gdbgui.texinfo
353 rm -f gdbgui.aux gdbgui.cp* gdbgui.fn* gdbgui.ky* \
354 gdbgui.log gdbgui.pg* gdbgui.toc gdbgui.tp* gdbgui.vr*
355
356# GDB GUI MANUAL: info file
357gdb-gui: gdbgui.info
358
359gdbgui.info: gdbgui.texinfo ${SFILES_DOC}
360 $(MAKEINFO) -o gdbgui.info $(srcdir)/gdbgui.texinfo
c906108c
SS
361
362# GDB INTERNALS MANUAL: TeX dvi file
363gdbint.dvi : gdbint.texinfo
364 $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
365 $(TEXINDEX) gdbint.??
366 $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
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
373# GDB INTERNALS MANUAL: info file
374
375gdbint.info: gdbint.texinfo
376 $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
377
085dd6e6
JM
378# GDB INTERNALS MANUAL: HTML file
379
380gdbint_toc.html: gdbint.texinfo
381 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/gdbint.texinfo
382
c906108c
SS
383stabs.info: stabs.texinfo
384 $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
385
085dd6e6
JM
386# STABS DOCUMENTATION: HTML file
387
388stabs_toc.html: stabs.texinfo
389 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/stabs.texinfo
390
c906108c
SS
391# STABS DOCUMENTATION: TeX dvi file
392stabs.dvi : stabs.texinfo
393 $(SET_TEXINPUTS) $(TEX) stabs.texinfo
394 $(TEXINDEX) stabs.??
395 $(SET_TEXINPUTS) $(TEX) stabs.texinfo
396 rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
397 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
398
399stabs.ps: stabs.dvi
400 $(DVIPS) -o $@ $?
401
402force:
403
404Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) config.status
405 $(SHELL) ./config.status
This page took 0.066475 seconds and 4 git commands to generate.