* libtool.m4 (LD): Append -melf* option to LD on IRIX with GNU ld.
[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
b0787093
AC
99# Main GDB manual
100GDB_DOC_SOURCE_INCLUDES = \
aab4e0ec
AC
101 $(srcdir)/annotate.texi \
102 $(srcdir)/fdl.texi \
b0787093
AC
103 $(srcdir)/gpl.texi \
104 $(GDBMI_DIR)/gdbmi.texinfo \
105 $(READLINE_DIR)/rluser.texinfo \
106 $(READLINE_DIR)/inc-hist.texinfo
107GDB_DOC_BUILD_INCLUDES = \
108 gdb-cfg.texi \
109 GDBvn.texi
110GDB_DOC_FILES = \
111 $(srcdir)/gdb.texinfo \
112 $(GDB_DOC_SOURCE_INCLUDES) \
113 $(GDB_DOC_BUILD_INCLUDES)
114
115# Internals Manual
116GDBINT_DOC_SOURCE_INCLUDES = \
117 $(srcdir)/fdl.texi
118GDBINT_DOC_BUILD_INCLUDES = \
119 gdb-cfg.texi \
120 GDBvn.texi
121GDBINT_DOC_FILES = \
122 $(srcdir)/gdbint.texinfo \
123 $(GDBINT_DOC_SOURCE_INCLUDES) \
124 $(GDBINT_DOC_BUILD_INCLUDES)
125
126# Stabs manual: All files
127STABS_DOC_SOURCE_INCLUDES =
128STABS_DOC_BUILD_INCLUDES =
129STABS_DOC_FILES = \
130 $(srcdir)/stabs.texinfo \
131 $(STABS_DOC_SOURCE_INCLUDES) \
132 $(STABS_DOC_BUILD_INCLUDES)
c906108c
SS
133
134#### Host, target, and site specific Makefile fragments come in here.
135###
136
35db0260 137all:
c906108c 138
63ac3005 139info: $(INFO_DEPS)
c906108c
SS
140dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi
141ps: gdb.ps gdbint.ps stabs.ps refcard.ps
085dd6e6 142html: gdb_toc.html gdbint_toc.html stabs_toc.html
449f3b6c
AC
143pdf: gdb.pdf gdbint.pdf stabs.pdf
144all-doc: info dvi ps # pdf
3555de01 145diststuff: info
c906108c 146
63ac3005 147install-info: $(INFO_DEPS)
9ef47d30 148 $(SHELL) $(srcdir)/../../mkinstalldirs $(infodir)
63ac3005
EZ
149 @list='$(INFO_DEPS)'; \
150 for file in $$list; do \
151 if test -f $$file; then d=.; else d=$(srcdir); fi; \
152 for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
153 if test -f $$d/$$ifile; then \
154 echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
155 $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
156 else : ; fi; \
157 done; \
158 done
c166cdc7 159 $(POST_INSTALL)
d3229ae3 160 @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
63ac3005 161 list='$(INFO_DEPS)'; \
d3229ae3
EZ
162 for file in $$list; do \
163 echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
164 install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
165 done; \
166 else : ; fi
c906108c 167
c166cdc7
EZ
168uninstall-info:
169 $(PRE_UNINSTALL)
170 @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
171 ii=yes; \
172 else ii=; fi; \
173 list='$(INFO_DEPS)'; \
174 for file in $$list; do \
175 test -z "$$ii" \
176 || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
177 done
178 $(NORMAL_UNINSTALL)
179 list='$(INFO_DEPS)'; \
180 for file in $$list; do \
181 (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
182 done
183
085dd6e6
JM
184install-html: html
185 for i in *.html ; do \
186 $(INSTALL_DATA) $$i $(htmldir)/$$i ; \
187 done
188
449f3b6c 189STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi *.pdf
c906108c
SS
190
191# Copy the object files from a particular stage into a subdirectory.
192stage1: force
193 -mkdir stage1
194 -mv $(STAGESTUFF) stage1
195
196stage2: force
197 -mkdir stage2
198 -mv $(STAGESTUFF) stage2
199
200stage3: force
201 -mkdir stage3
202 -mv $(STAGESTUFF) stage3
203
204against=stage2
205
206comparison: force
207 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
208
209de-stage1: force
210 -(cd stage1 ; mv -f * ..)
211 -rmdir stage1
212
213de-stage2: force
214 -(cd stage2 ; mv -f * ..)
215 -rmdir stage2
216
217de-stage3: force
218 -(cd stage3 ; mv -f * ..)
219 -rmdir stage3
220
c906108c
SS
221# GDB QUICK REFERENCE (dvi output)
222refcard.dvi : refcard.tex $(REFEDITS)
dfa249fb
AC
223 echo > tmp.sed
224 for f in x $(REFEDITS) ; do \
225 test x$$f = xx && continue ; \
226 cat $(srcdir)/$$f >>tmp.sed ; \
227 done
228 sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
c906108c
SS
229 $(SET_TEXINPUTS) $(TEX) sedref.tex
230 mv sedref.dvi refcard.dvi
231 rm -f sedref.log sedref.tex tmp.sed
232
233refcard.ps : refcard.dvi
234 $(DVIPS) -t landscape -o $@ $?
235
05a54c4f
AC
236# File to record current GDB version number (copied from main dir version.in)
237GDBvn.texi : ${gdbdir}/version.in
9ba8d803 238 echo "@set GDBVN `sed q $(srcdir)/../version.in`" > ./GDBvn.new
c906108c
SS
239 mv GDBvn.new GDBvn.texi
240
241# Updated atomically
242.PRECIOUS: GDBvn.texi
243
244# Choose configuration for GDB manual (normally `all'; normally not tied into
245# `configure' script because most users prefer generic version of manual,
246# not one for their binary config---which may not be specifically
247# defined anyways).
248gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
39ec5655
EZ
249 (test "$$LN_S" = "ln -s" && \
250 ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
c906108c
SS
251 ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
252 cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
253
254# GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
255# If your texinfo or makeinfo don't support these, get a new texinfo release
256#
257# The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
258# Note that we can *generate* GDBvn.texi, but since we distribute one in the
259# source directory for the benefit of people who *don't* use this makefile,
260# VPATH will often tell make not to bother building it, because the one
261# in the srcdir is up to date. (if not, then make should build one here).
262
46d8b1c3
AC
263# Clean these up before each run. Avoids a catch 22 with not being
264# able to re-generate these files (to fix a corruption) because these
265# files contain a corruption.
b0787093
AC
266GDB_TEX_TMPS = gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
267 gdb.tp* gdb.vr*
268
c906108c 269# GDB MANUAL: TeX dvi file
b0787093 270gdb.dvi: ${GDB_DOC_FILES}
c906108c 271 if [ ! -f ./GDBvn.texi ]; then \
39ec5655 272 (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
c906108c
SS
273 ln $(srcdir)/GDBvn.texi . || \
274 cp $(srcdir)/GDBvn.texi . ; else true; fi
b0787093 275 rm -f $(GDB_TEX_TMPS)
be298bcc 276 $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/gdb.texinfo
c906108c
SS
277
278gdb.ps: gdb.dvi
279 $(DVIPS) -o $@ $?
280
b0787093 281gdb.pdf: ${GDB_DOC_FILES}
449f3b6c
AC
282 if [ ! -f ./GDBvn.texi ]; then \
283 (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
284 ln $(srcdir)/GDBvn.texi . || \
285 cp $(srcdir)/GDBvn.texi . ; else true; fi
b0787093 286 rm -f $(GDB_TEX_TMPS)
be298bcc 287 $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/gdb.texinfo
449f3b6c 288
c906108c 289# GDB MANUAL: info file
b0787093 290gdb.info: ${GDB_DOC_FILES}
a7b40f07
AC
291 $(MAKEINFO) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) \
292 -o gdb.info $(srcdir)/gdb.texinfo
c906108c
SS
293
294# GDB MANUAL: roff translations
295# Try to use a recent texi2roff. v2 was put on prep in jan91.
296# If you want an index, see texi2roff doc for postprocessing
297# and add -i to texi2roff invocations below.
298# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
299# corresponding -e lines when later texi2roff's are current)
300# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
301# + @c's deleted explicitly because texi2roff sees texinfo commands in them
302# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
303# + @alphaenumerate is ridiculously new, turned into @enumerate
304
305# texi2roff doesn't have a notion of include dirs, so we have to fake
306# it out for gdb manual's include files---but only if not configured
307# in main sourcedir.
b0787093 308links2roff: $(GDB_DOC_SOURCE_INCLUDES)
c906108c 309 if [ ! -f gdb.texinfo ]; then \
b0787093
AC
310 (test "$$LN_S" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \
311 ln $(GDB_DOC_SOURCE_INCLUDES) . || \
312 cp $(GDB_DOC_SOURCE_INCLUDES) . ; \
c906108c
SS
313 fi
314 touch links2roff
315
c906108c 316# gdb manual suitable for [gtn]roff -me
b0787093 317gdb.me: $(GDB_DOC_FILES) links2roff
c906108c
SS
318 sed -e '/\\input texinfo/d' \
319 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
320 -e '/^@ifinfo/,/^@end ifinfo/d' \
321 -e '/^@c /d' \
322 -e 's/{.*,,/{/' \
323 -e 's/@ / /g' \
324 -e 's/^@alphaenumerate/@enumerate/g' \
325 -e 's/^@end alphaenumerate/@end enumerate/g' \
326 $(srcdir)/gdb.texinfo | \
327 $(TEXI2ROFF) -me | \
328 sed -e 's/---/\\(em/g' \
329 >gdb.me
330
331# gdb manual suitable for [gtn]roff -ms
b0787093 332gdb.ms: $(GDB_DOC_FILES) links2roff
c906108c
SS
333 sed -e '/\\input texinfo/d' \
334 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
335 -e '/^@ifinfo/,/^@end ifinfo/d' \
336 -e '/^@c /d' \
337 -e 's/{.*,,/{/' \
338 -e 's/@ / /g' \
339 -e 's/^@alphaenumerate/@enumerate/g' \
340 -e 's/^@end alphaenumerate/@end enumerate/g' \
341 $(srcdir)/gdb.texinfo | \
342 $(TEXI2ROFF) -ms | \
343 sed -e 's/---/\\(em/g' \
344 >gdb.ms
345
346# gdb manual suitable for [tn]roff -mm
347# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
348# try leaving them in
b0787093 349gdb.mm: $(GDB_DOC_FILES) links2roff
c906108c
SS
350 sed -e '/\\input texinfo/d' \
351 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
352 -e '/^@ifinfo/,/^@end ifinfo/d' \
353 -e '/^@c /d' \
354 -e 's/{.*,,/{/' \
355 -e '/@noindent/d' \
356 -e 's/@ / /g' \
357 -e 's/^@alphaenumerate/@enumerate/g' \
358 -e 's/^@end alphaenumerate/@end enumerate/g' \
359 $(srcdir)/gdb.texinfo | \
360 $(TEXI2ROFF) -mm | \
361 sed -e 's/---/\\(em/g' \
362 >gdb.mm
363
085dd6e6
JM
364# GDB MANUAL: HTML file
365
b0787093 366gdb_toc.html: ${GDB_DOC_FILES}
7162c0ca 367 $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
085dd6e6 368
46d8b1c3
AC
369# Clean these up before each run. Avoids a catch 22 with not being
370# able to re-generate these files (to fix a corruption) because these
371# files contain a corruption.
b0787093
AC
372GDBINT_TEX_TMPS = gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
373 gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
374
c906108c 375# GDB INTERNALS MANUAL: TeX dvi file
b0787093
AC
376gdbint.dvi: $(GDBINT_DOC_FILES)
377 rm -f $(GDBINT_TEX_TMPS)
be298bcc 378 $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/gdbint.texinfo
c906108c
SS
379
380gdbint.ps : gdbint.dvi
381 $(DVIPS) -o $@ $?
382
b0787093
AC
383gdbint.pdf: $(GDBINT_DOC_FILES)
384 rm -f $(GDBINT_TEX_TMPS)
be298bcc 385 $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/gdbint.texinfo
449f3b6c 386
c906108c
SS
387# GDB INTERNALS MANUAL: info file
388
b0787093 389gdbint.info: $(GDBINT_DOC_FILES)
aab4e0ec 390 $(MAKEINFO) -I $(srcdir) -o gdbint.info $(srcdir)/gdbint.texinfo
c906108c 391
085dd6e6
JM
392# GDB INTERNALS MANUAL: HTML file
393
b0787093 394gdbint_toc.html: $(GDBINT_DOC_FILES)
085dd6e6
JM
395 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/gdbint.texinfo
396
b0787093 397stabs.info: $(STABS_DOC_FILES)
c906108c
SS
398 $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
399
085dd6e6
JM
400# STABS DOCUMENTATION: HTML file
401
b0787093 402stabs_toc.html: $(STABS_DOC_FILES)
085dd6e6
JM
403 $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/stabs.texinfo
404
46d8b1c3
AC
405# Clean these up before each run. Avoids a catch 22 with not being
406# able to re-generate these files (to fix a corruption) because these
407# files contain a corruption.
b0787093
AC
408STABS_TEX_TMPS = stabs.aux stabs.cp* stabs.fn* stabs.ky* \
409 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
410
c906108c 411# STABS DOCUMENTATION: TeX dvi file
b0787093
AC
412stabs.dvi : $(STABS_DOC_FILES)
413 rm -f $(STABS_TEX_TMPS)
be298bcc 414 $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/stabs.texinfo
c906108c
SS
415
416stabs.ps: stabs.dvi
417 $(DVIPS) -o $@ $?
418
b0787093
AC
419stabs.pdf: $(STABS_DOC_FILES)
420 rm -f $(STABS_TEX_TMPS)
be298bcc 421 $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/stabs.texinfo
449f3b6c 422
c906108c
SS
423force:
424
425Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) config.status
426 $(SHELL) ./config.status
46d8b1c3
AC
427
428
429# The "least clean" level of cleaning. Get rid of files which are
430# automatically generated files that are just intermediate files,
431
432mostlyclean:
433 rm -f gdb.mm gdb.ms gdb.me links2roff
434 rm -f $(GDB_TEX_TMPS)
435 rm -f $(GDBINT_TEX_TMPS)
436 rm -f $(STABS_TEX_TMPS)
437 rm -f sedref.dvi sedref.tex tmp.sed
438
439clean: mostlyclean
440 rm -f gdb-cfg.texi
441
442distclean: clean
443 rm -f Makefile config.status
444
445# GDBvn.texi, the dvi files, the info files, and the postscript files,
446# are all part of the distribution, so it should not be removed by
447# "clean" or "distclean". Use maintainer-clean to remove them.
448
449maintainer-clean realclean: distclean
450 rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf
451
35db0260 452install: install-info
c166cdc7
EZ
453
454uninstall: uninstall-info
This page took 0.276469 seconds and 4 git commands to generate.