1 ##Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003,
2 ##2007, 2008, 2009 Free Software Foundation, Inc.
4 # Makefile for GDB documentation.
5 # This file is part of GDB.
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 3 of the License, or
10 # (at your option) any later version.
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.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 datarootdir
= @datarootdir@
36 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
37 INSTALL_DATA
= @INSTALL_DATA@
39 mkinstalldirs
= $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
41 # main GDB source directory
44 # where to find texinfo; GDB dist should include a recent one
45 TEXIDIR
=${gdbdir}/..
/texinfo
47 # where to find makeinfo, preferably one designed for texinfo-2
50 MAKEHTML
= $(MAKEINFO
) --html
53 # where to find texi2roff, ditto
56 # where to find texi2dvi, ditto
59 # Package version and bug-reporting URL.
60 PKGVERSION
= @PKGVERSION@
61 BUGURL_TEXI
= @REPORT_BUGS_TEXI@
63 # Where is the source dir for the READLINE library doc?
64 # Traditionally readline is in .. or .
65 READLINE_DIR
= ${gdbdir}/..
/readline
/doc
67 # The GDB/MI docs come from a sibling directory ../mi
68 GDBMI_DIR
= ${gdbdir}/mi
71 TEXINPUTS
=${TEXIDIR}:.
:$(srcdir):$(READLINE_DIR
):$(GDBMI_DIR
):$$TEXINPUTS
73 # Files which should be generated via 'info' and installed by 'install-info'
74 INFO_DEPS
= gdb.
info gdbint.
info stabs.
info annotate.
info
76 # Files which should be generated via 'pdf' and installed by 'install-pdf'
77 PDFFILES
= gdb.pdf gdbint.pdf stabs.pdf refcard.pdf annotate.pdf
78 # Files which should be generated via 'html' and installed by 'install-html'
79 HTMLFILES
= gdb
/index.html gdbint
/index.html stabs
/index.html annotate
/index.html
80 HTMLFILES_INSTALL
= gdb gdbint stabs annotate
82 # There may be alternate predefined collections of switches to configure
83 # the GDB manual. Normally this is not done in synch with the software
84 # config system, since this choice tends to be independent; most people
85 # want a doc config of `all' for a generic manual, regardless of sw config.
88 # This list of sed edits will edit the GDB reference card
89 # for what fonts and what papersize to use.
90 # By default (NO edits applied), the refcard uses:
91 # - Computer Modern (CM) fonts
92 # - US letter paper (8.5x11in)
93 # List some of the following files for alternative fonts and paper:
94 # a4rc.sed use A4 paper (297 x 210 mm)
95 # psrc.sed use PostScript fonts (Karl Berry short TeX names)
96 # lpsrc.sed use PostScript fonts (full PostScript names in TeX)
97 # e.g. for A4, Postscript: REFEDITS = a4rc.sed psrc.sed
98 # for A4, CM fonts: REFEDITS = a4rc.sed
99 # for US, PS fonts: REFEDITS = psrc.sed
103 # Don Knuth's TeX formatter
107 # Program to generate Postscript files from DVI files.
111 GDB_DOC_SOURCE_INCLUDES
= \
114 $(srcdir)/agentexpr.texi \
115 $(READLINE_DIR
)/rluser.texi \
116 $(READLINE_DIR
)/inc-hist.texinfo
117 GDB_DOC_BUILD_INCLUDES
= \
121 $(srcdir)/gdb.texinfo \
122 $(GDB_DOC_SOURCE_INCLUDES
) \
123 $(GDB_DOC_BUILD_INCLUDES
)
126 GDBINT_DOC_SOURCE_INCLUDES
= \
128 $(srcdir)/observer.texi
129 GDBINT_DOC_BUILD_INCLUDES
= \
133 $(srcdir)/gdbint.texinfo \
134 $(GDBINT_DOC_SOURCE_INCLUDES
) \
135 $(GDBINT_DOC_BUILD_INCLUDES
)
137 # Stabs manual: All files
138 STABS_DOC_SOURCE_INCLUDES
= \
140 STABS_DOC_BUILD_INCLUDES
=
142 $(srcdir)/stabs.texinfo \
143 $(STABS_DOC_SOURCE_INCLUDES
) \
144 $(STABS_DOC_BUILD_INCLUDES
)
146 # Annotate migration document
147 ANNOTATE_DOC_SOURCE_INCLUDES
= \
149 ANNOTATE_DOC_BUILD_INCLUDES
= \
151 ANNOTATE_DOC_FILES
= \
152 $(srcdir)/annotate.texinfo \
153 $(ANNOTATE_DOC_SOURCE_INCLUDES
) \
154 $(ANNOTATE_DOC_BUILD_INCLUDES
)
156 #### Host, target, and site specific Makefile fragments come in here.
162 dvi: gdb.
dvi gdbint.
dvi stabs.
dvi refcard.
dvi annotate.
dvi
163 ps
: gdb.ps gdbint.ps stabs.ps refcard.ps annotate.ps
166 all-doc
: info dvi ps
# pdf
169 install-info
: $(INFO_DEPS
)
170 $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
$(DESTDIR
)$(infodir)
171 @list
='$(INFO_DEPS)'; \
172 for file in
$$list; do \
173 if
test -f
$$file; then d
=.
; else d
=$(srcdir); fi
; \
174 for ifile in
`cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
175 if
test -f
$$d/$$ifile; then \
176 echo
" $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
177 $(INSTALL_DATA
) $$d/$$ifile $(DESTDIR
)$(infodir)/$$ifile; \
182 @if
$(SHELL
) -c
'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev
/null
2>&1; then \
183 list
='$(INFO_DEPS)'; \
184 for file in
$$list; do \
185 echo
" install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
186 install-info
--info-dir
=$(DESTDIR
)$(infodir) $(DESTDIR
)$(infodir)/$$file ||
:;\
192 @if
$(SHELL
) -c
'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev
/null
2>&1; then \
195 list
='$(INFO_DEPS)'; \
196 for file in
$$list; do \
198 || install-info
--info-dir
=$(DESTDIR
)$(infodir) --remove
$$file; \
201 list
='$(INFO_DEPS)'; \
202 for file in
$$list; do \
203 (cd
$(DESTDIR
)$(infodir) && rm -f
$$file $$file-[0-9] $$file-[0-9][0-9]); \
206 html__strip_dir
= `echo $$p | sed -e 's|^.*/||'`;
208 install-html
: $(HTMLFILES
)
210 test -z
"$(htmldir)" ||
$(mkinstalldirs
) "$(DESTDIR)$(htmldir)"
211 @list
='$(HTMLFILES_INSTALL)'; for p in
$$list; do \
212 if
test -f
"$$p" ||
test -d
"$$p"; then d
=""; else d
="$(srcdir)/"; fi
; \
213 f
=$(html__strip_dir
) \
214 if
test -d
"$$d$$p"; then \
215 echo
" $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
216 $(mkinstalldirs
) "$(DESTDIR)$(htmldir)/$$f" || exit
1; \
217 echo
" $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
218 $(INSTALL_DATA
) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
220 echo
" $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
221 $(INSTALL_DATA
) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
225 pdf__strip_dir
= `echo $$p | sed -e 's|^.*/||'`;
227 install-pdf
: $(PDFFILES
)
229 test -z
"$(pdfdir)" ||
$(mkinstalldirs
) "$(DESTDIR)$(pdfdir)"
230 @list
='$(PDFFILES)'; for p in
$$list; do \
231 if
test -f
"$$p"; then d
=; else d
="$(srcdir)/"; fi
; \
232 f
=$(pdf__strip_dir
) \
233 echo
" $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \
234 $(INSTALL_DATA
) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \
237 STAGESTUFF
= *.
info* gdb-all.texi GDBvn.texi
*.ps
*.
dvi *.pdf
239 # Copy the object files from a particular stage into a subdirectory.
242 -mv
$(STAGESTUFF
) stage1
246 -mv
$(STAGESTUFF
) stage2
250 -mv
$(STAGESTUFF
) stage3
255 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
258 -(cd stage1
; mv
-f
* ..
)
262 -(cd stage2
; mv
-f
* ..
)
266 -(cd stage3
; mv
-f
* ..
)
269 # GDB QUICK REFERENCE (dvi output)
270 refcard.
dvi : refcard.
tex $(REFEDITS
)
272 for f in x
$(REFEDITS
) ; do \
273 test x
$$f = xx
&& continue
; \
274 cat
$(srcdir)/$$f >>tmp.sed
; \
276 sed
-f tmp.sed
$(srcdir)/refcard.
tex >sedref.
tex
277 $(SET_TEXINPUTS
) $(TEX
) sedref.
tex
278 mv sedref.
dvi refcard.
dvi
279 rm -f sedref.log sedref.
tex tmp.sed
281 refcard.ps
: refcard.
dvi
282 $(DVIPS
) -t landscape
-o
$@
$?
284 refcard.pdf
: refcard.
tex $(REFEDITS
)
286 for f in x
$(REFEDITS
) ; do \
287 test x
$$f = xx
&& continue
; \
288 cat
$(srcdir)/$$f >>tmp.sed
; \
290 sed
-f tmp.sed
$(srcdir)/refcard.
tex >sedref.
tex
291 $(SET_TEXINPUTS
) $(PDFTEX
) sedref.
tex
292 mv sedref.pdf refcard.pdf
293 rm -f sedref.log sedref.
tex tmp.sed
295 # File to record current GDB version number (copied from main dir version.in)
296 GDBvn.texi
: ${gdbdir}/version.in
297 echo
"@set GDBVN `sed q $(srcdir)/../version.in`" > .
/GDBvn.new
298 if
[ -n
"$(PKGVERSION)" ]; then \
299 echo
"@set VERSION_PACKAGE $(PKGVERSION)" >> .
/GDBvn.new
; \
301 echo
"@set BUGURL $(BUGURL_TEXI)" >> .
/GDBvn.new
302 if
[ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
303 echo
"@set BUGURL_DEFAULT" >> .
/GDBvn.new
; \
305 mv GDBvn.new GDBvn.texi
308 .PRECIOUS
: GDBvn.texi
310 # Choose configuration for GDB manual (normally `all'; normally not tied into
311 # `configure' script because most users prefer generic version of manual,
312 # not one for their binary config---which may not be specifically
314 gdb-cfg.texi
: ${srcdir}/${DOC_CONFIG}-cfg.texi
315 (test "$(LN_S)" = "ln -s" && \
316 ln
-s
${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
) || \
317 ln
${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
318 cp
${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
320 # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
321 # If your texinfo or makeinfo don't support these, get a new texinfo release
323 # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
324 # Note that we can *generate* GDBvn.texi, but since we distribute one in the
325 # source directory for the benefit of people who *don't* use this makefile,
326 # VPATH will often tell make not to bother building it, because the one
327 # in the srcdir is up to date. (if not, then make should build one here).
329 # Clean these up before each run. Avoids a catch 22 with not being
330 # able to re-generate these files (to fix a corruption) because these
331 # files contain a corruption.
332 GDB_TEX_TMPS
= gdb.aux gdb.cp
* gdb.fn
* gdb.ky
* gdb.log gdb.pg
* gdb.toc \
335 # GDB MANUAL: TeX dvi file
336 gdb.
dvi: ${GDB_DOC_FILES}
337 if
[ ! -f .
/GDBvn.texi
]; then \
338 (test "$(LN_S)" = "ln -s" && ln
-s
$(srcdir)/GDBvn.texi .
) || \
339 ln
$(srcdir)/GDBvn.texi . || \
340 cp
$(srcdir)/GDBvn.texi .
; else true
; fi
341 rm -f
$(GDB_TEX_TMPS
)
342 $(TEXI2DVI
) -I
${READLINE_DIR} -I
${GDBMI_DIR} -I
$(srcdir) \
343 $(srcdir)/gdb.texinfo
348 gdb.pdf
: ${GDB_DOC_FILES}
349 if
[ ! -f .
/GDBvn.texi
]; then \
350 (test "$(LN_S)" = "ln -s" && ln
-s
$(srcdir)/GDBvn.texi .
) || \
351 ln
$(srcdir)/GDBvn.texi . || \
352 cp
$(srcdir)/GDBvn.texi .
; else true
; fi
353 rm -f
$(GDB_TEX_TMPS
)
354 $(TEXI2DVI
) --pdf
-I
${READLINE_DIR} -I
${GDBMI_DIR} -I
$(srcdir) \
355 $(srcdir)/gdb.texinfo
357 # GDB MANUAL: info file
358 gdb.
info: ${GDB_DOC_FILES}
359 $(MAKEINFO
) -I
${READLINE_DIR} -I
${GDBMI_DIR} -I
$(srcdir) \
360 -o gdb.
info $(srcdir)/gdb.texinfo
362 # GDB MANUAL: roff translations
363 # Try to use a recent texi2roff. v2 was put on prep in jan91.
364 # If you want an index, see texi2roff doc for postprocessing
365 # and add -i to texi2roff invocations below.
366 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
367 # corresponding -e lines when later texi2roff's are current)
368 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
369 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
370 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
371 # + @alphaenumerate is ridiculously new, turned into @enumerate
373 # texi2roff doesn't have a notion of include dirs, so we have to fake
374 # it out for gdb manual's include files---but only if not configured
376 links2roff
: $(GDB_DOC_SOURCE_INCLUDES
)
377 if
[ ! -f gdb.texinfo
]; then \
378 (test "$(LN_S)" = "ln -s" && ln
-s
$(GDB_DOC_SOURCE_INCLUDES
) .
) || \
379 ln
$(GDB_DOC_SOURCE_INCLUDES
) . || \
380 cp
$(GDB_DOC_SOURCE_INCLUDES
) .
; \
384 # gdb manual suitable for [gtn]roff -me
385 gdb.me
: $(GDB_DOC_FILES
) links2roff
386 sed
-e
'/\\input texinfo/d' \
387 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
388 -e
'/^@ifinfo/,/^@end ifinfo/d' \
392 -e
's/^@alphaenumerate/@enumerate/g' \
393 -e
's/^@end alphaenumerate/@end enumerate/g' \
394 $(srcdir)/gdb.texinfo | \
396 sed
-e
's/---/\\(em/g' \
399 # gdb manual suitable for [gtn]roff -ms
400 gdb.ms
: $(GDB_DOC_FILES
) links2roff
401 sed
-e
'/\\input texinfo/d' \
402 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
403 -e
'/^@ifinfo/,/^@end ifinfo/d' \
407 -e
's/^@alphaenumerate/@enumerate/g' \
408 -e
's/^@end alphaenumerate/@end enumerate/g' \
409 $(srcdir)/gdb.texinfo | \
411 sed
-e
's/---/\\(em/g' \
414 # gdb manual suitable for [tn]roff -mm
415 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
416 # try leaving them in
417 gdb.mm
: $(GDB_DOC_FILES
) links2roff
418 sed
-e
'/\\input texinfo/d' \
419 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
420 -e
'/^@ifinfo/,/^@end ifinfo/d' \
425 -e
's/^@alphaenumerate/@enumerate/g' \
426 -e
's/^@end alphaenumerate/@end enumerate/g' \
427 $(srcdir)/gdb.texinfo | \
429 sed
-e
's/---/\\(em/g' \
432 # GDB MANUAL: HTML file
434 gdb
/index.html
: ${GDB_DOC_FILES}
435 $(MAKEHTML
) $(MAKEHTMLFLAGS
) -I
${READLINE_DIR} -I
${GDBMI_DIR} -I
$(srcdir) $(srcdir)/gdb.texinfo
437 # Clean these up before each run. Avoids a catch 22 with not being
438 # able to re-generate these files (to fix a corruption) because these
439 # files contain a corruption.
440 GDBINT_TEX_TMPS
= gdbint.aux gdbint.cp
* gdbint.fn
* gdbint.ky
* \
441 gdbint.log gdbint.pg
* gdbint.toc gdbint.tp
* gdbint.vr
*
443 # GDB INTERNALS MANUAL: TeX dvi file
444 gdbint.
dvi: $(GDBINT_DOC_FILES
)
445 rm -f
$(GDBINT_TEX_TMPS
)
446 $(TEXI2DVI
) -I
$(srcdir) $(srcdir)/gdbint.texinfo
448 gdbint.ps
: gdbint.
dvi
451 gdbint.pdf
: $(GDBINT_DOC_FILES
)
452 rm -f
$(GDBINT_TEX_TMPS
)
453 $(TEXI2DVI
) --pdf
-I
$(srcdir) $(srcdir)/gdbint.texinfo
455 # GDB INTERNALS MANUAL: info file
457 gdbint.
info: $(GDBINT_DOC_FILES
)
458 $(MAKEINFO
) -I
$(srcdir) -o gdbint.
info $(srcdir)/gdbint.texinfo
460 # GDB INTERNALS MANUAL: HTML file
462 gdbint
/index.html
: $(GDBINT_DOC_FILES
)
463 $(MAKEHTML
) $(MAKEHTMLFLAGS
) -I
$(srcdir) $(srcdir)/gdbint.texinfo
465 stabs.
info: $(STABS_DOC_FILES
)
466 $(MAKEINFO
) -I
$(srcdir) -o stabs.
info $(srcdir)/stabs.texinfo
468 # STABS DOCUMENTATION: HTML file
470 stabs
/index.html
: $(STABS_DOC_FILES
)
471 $(MAKEHTML
) $(MAKEHTMLFLAGS
) -I
$(srcdir) $(srcdir)/stabs.texinfo
473 # Clean these up before each run. Avoids a catch 22 with not being
474 # able to re-generate these files (to fix a corruption) because these
475 # files contain a corruption.
476 STABS_TEX_TMPS
= stabs.aux stabs.cp
* stabs.fn
* stabs.ky
* \
477 stabs.log stabs.pg
* stabs.toc stabs.tp
* stabs.vr
*
479 # STABS DOCUMENTATION: TeX dvi file
480 stabs.
dvi : $(STABS_DOC_FILES
)
481 rm -f
$(STABS_TEX_TMPS
)
482 $(TEXI2DVI
) -I
$(srcdir) $(srcdir)/stabs.texinfo
487 stabs.pdf
: $(STABS_DOC_FILES
)
488 rm -f
$(STABS_TEX_TMPS
)
489 $(TEXI2DVI
) --pdf
-I
$(srcdir) $(srcdir)/stabs.texinfo
491 # Clean these up before each run. Avoids a catch 22 with not being
492 # able to re-generate these files (to fix a corruption) because these
493 # files contain a corruption.
494 ANNOTATE_TEX_TMPS
= annotate.aux annotate.cp
* annotate.fn
* annotate.ky
* \
495 annotate.log annotate.pg
* annotate.toc annotate.tp
* annotate.vr
*
497 # ANNOTATE DOCUMENTATION: TeX dvi file
498 annotate.
dvi : $(ANNOTATE_DOC_FILES
)
499 rm -f
$(ANNOTATE_TEX_TMPS
)
500 $(TEXI2DVI
) -I
$(srcdir) $(srcdir)/annotate.texinfo
502 annotate.ps
: annotate.
dvi
505 annotate.pdf
: $(ANNOTATE_DOC_FILES
)
506 rm -f
$(ANNOTATE_TEX_TMPS
)
507 $(TEXI2DVI
) --pdf
-I
$(srcdir) $(srcdir)/annotate.texinfo
509 annotate.
info: $(ANNOTATE_DOC_FILES
)
510 $(MAKEINFO
) -I
$(srcdir) -o annotate.
info $(srcdir)/annotate.texinfo
512 annotate
/index.html
: $(ANNOTATE_DOC_FILES
)
513 $(MAKEHTML
) $(MAKEHTMLFLAGS
) -I
$(srcdir) $(srcdir)/annotate.texinfo
517 Makefile
: Makefile.in
$(host_makefile_frag
) config.status
518 $(SHELL
) .
/config.status
521 # The "least clean" level of cleaning. Get rid of files which are
522 # automatically generated files that are just intermediate files,
525 rm -f gdb.mm gdb.ms gdb.me links2roff
526 rm -f
$(GDB_TEX_TMPS
)
527 rm -f
$(GDBINT_TEX_TMPS
)
528 rm -f
$(STABS_TEX_TMPS
)
529 rm -f
$(ANNOTATE_TEX_TMPS
)
530 rm -f sedref.
dvi sedref.
tex tmp.sed
536 rm -f Makefile config.status config.log
538 # GDBvn.texi, the dvi files, the info files, and the postscript files,
539 # are all part of the distribution, so it should not be removed by
540 # "clean" or "distclean". Use maintainer-clean to remove them.
542 maintainer-clean
realclean: distclean
543 rm -f GDBvn.texi
*.
info* *.
dvi *.ps
*.html
*.pdf
545 install: install-info
547 uninstall: uninstall-info