]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/doc/Makefile.in
[gdb/testsuite] New test: gdb.base/errno.exp
[thirdparty/binutils-gdb.git] / gdb / doc / Makefile.in
CommitLineData
1d506c26 1##Copyright (C) 1991-2024 Free Software Foundation, Inc.
c906108c
SS
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
a1715244 8# the Free Software Foundation; either version 3 of the License, or
c906108c 9# (at your option) any later version.
a1715244 10#
c906108c
SS
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.
a1715244 15#
c906108c 16# You should have received a copy of the GNU General Public License
a1715244 17# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c
SS
18
19srcdir = @srcdir@
20VPATH = @srcdir@
21
22prefix = @prefix@
23
24infodir = @infodir@
26e251b6
JM
25datarootdir = @datarootdir@
26docdir = @docdir@
96c1bcb3 27dvidir = @dvidir@
89a34d1b
JM
28pdfdir = @pdfdir@
29htmldir = @htmldir@
43662968
JK
30mandir = @mandir@
31man1dir = $(mandir)/man1
32man5dir = $(mandir)/man5
c906108c 33
90debf20
MM
34transform = @program_transform_name@
35
824083f3
AB
36include $(srcdir)/../silent-rules.mk
37
c906108c
SS
38SHELL = @SHELL@
39
39ec5655
EZ
40LN_S = @LN_S@
41
c906108c
SS
42INSTALL = @INSTALL@
43INSTALL_PROGRAM = @INSTALL_PROGRAM@
44INSTALL_DATA = @INSTALL_DATA@
45
43662968 46SYSTEM_GDBINIT = @SYSTEM_GDBINIT@
ed2a2229 47SYSTEM_GDBINIT_DIR = @SYSTEM_GDBINIT_DIR@
43662968 48
9453113a
DJ
49mkinstalldirs = $(SHELL) $(srcdir)/../../mkinstalldirs
50
c906108c
SS
51# main GDB source directory
52gdbdir = $(srcdir)/..
53
54# where to find texinfo; GDB dist should include a recent one
55TEXIDIR=${gdbdir}/../texinfo
56
57# where to find makeinfo, preferably one designed for texinfo-2
5048e516
JK
58MAKEINFO = @MAKEINFO@
59MAKEINFOFLAGS = @MAKEINFOFLAGS@
60MAKEINFO_EXTRA_FLAGS = @MAKEINFO_EXTRA_FLAGS@
61MAKEINFO_CMD = $(MAKEINFO) $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
c906108c 62
5048e516 63MAKEHTML = $(MAKEINFO_CMD) --html
2b831889 64MAKEHTMLFLAGS =
085dd6e6 65
c906108c
SS
66# where to find texi2roff, ditto
67TEXI2ROFF=texi2roff
68
be298bcc
AC
69# where to find texi2dvi, ditto
70TEXI2DVI=texi2dvi
71
e20bd8f4
SB
72# Package to install the docs under
73PACKAGE = @PACKAGE@
74
c16158bc
JM
75# Package version and bug-reporting URL.
76PKGVERSION = @PKGVERSION@
77BUGURL_TEXI = @REPORT_BUGS_TEXI@
78
c906108c
SS
79# Where is the source dir for the READLINE library doc?
80# Traditionally readline is in .. or .
6999161a 81READLINE_DIR = ${gdbdir}/../readline/readline/doc
39037522 82READLINE_TEXI_INCFLAG = @READLINE_TEXI_INCFLAG@
c906108c 83
7162c0ca
EZ
84# The GDB/MI docs come from a sibling directory ../mi
85GDBMI_DIR = ${gdbdir}/mi
86
87SET_TEXINPUTS = \
88 TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$(GDBMI_DIR):$$TEXINPUTS
c906108c 89
63ac3005 90# Files which should be generated via 'info' and installed by 'install-info'
0a7cfe2c 91INFO_DEPS = gdb.info stabs.info annotate.info
63ac3005 92
96c1bcb3
CL
93# Files which should be generated via 'dvi' and installed by 'install-dvi'
94DVIFILES = gdb.dvi stabs.dvi refcard.dvi annotate.dvi
9453113a 95# Files which should be generated via 'pdf' and installed by 'install-pdf'
0a7cfe2c 96PDFFILES = gdb.pdf stabs.pdf refcard.pdf annotate.pdf
2b831889 97# Files which should be generated via 'html' and installed by 'install-html'
0a7cfe2c
SS
98HTMLFILES = gdb/index.html stabs/index.html annotate/index.html
99HTMLFILES_INSTALL = gdb stabs annotate
9453113a 100
c906108c
SS
101# There may be alternate predefined collections of switches to configure
102# the GDB manual. Normally this is not done in synch with the software
103# config system, since this choice tends to be independent; most people
104# want a doc config of `all' for a generic manual, regardless of sw config.
105DOC_CONFIG = all
106
107# This list of sed edits will edit the GDB reference card
108# for what fonts and what papersize to use.
109# By default (NO edits applied), the refcard uses:
110# - Computer Modern (CM) fonts
111# - US letter paper (8.5x11in)
112# List some of the following files for alternative fonts and paper:
113# a4rc.sed use A4 paper (297 x 210 mm)
114# psrc.sed use PostScript fonts (Karl Berry short TeX names)
115# lpsrc.sed use PostScript fonts (full PostScript names in TeX)
116# e.g. for A4, Postscript: REFEDITS = a4rc.sed psrc.sed
117# for A4, CM fonts: REFEDITS = a4rc.sed
118# for US, PS fonts: REFEDITS = psrc.sed
119# for default:
120REFEDITS =
121
122# Don Knuth's TeX formatter
123TEX = tex
9453113a 124PDFTEX = pdftex
c906108c 125
c906108c
SS
126# Program to generate Postscript files from DVI files.
127DVIPS = dvips
128
14d0e681
KS
129# Readline includes.
130READLINE_SYSTEM_DOC_INCLUDES =
131READLINE_INTREE_DOC_INCLUDES = $(READLINE_DIR)/rluser.texi $(READLINE_DIR)/hsuser.texi
132READLINE_DOC_SOURCE_INCLUDES = @READLINE_DOC_SOURCE_INCLUDES@
133
b0787093 134# Main GDB manual
39037522
TT
135# Note that this unconditionally includes the readline texi files,
136# even when --with-system-readline is used. This is harmless because
137# these are only used as dependencies.
b0787093 138GDB_DOC_SOURCE_INCLUDES = \
aab4e0ec 139 $(srcdir)/fdl.texi \
b0787093 140 $(srcdir)/gpl.texi \
f418dd93 141 $(srcdir)/agentexpr.texi \
14d0e681 142 $(READLINE_DOC_SOURCE_INCLUDES)
b0787093
AC
143GDB_DOC_BUILD_INCLUDES = \
144 gdb-cfg.texi \
145 GDBvn.texi
146GDB_DOC_FILES = \
147 $(srcdir)/gdb.texinfo \
ed3ef339 148 $(srcdir)/guile.texi \
329baa95 149 $(srcdir)/python.texi \
b0787093
AC
150 $(GDB_DOC_SOURCE_INCLUDES) \
151 $(GDB_DOC_BUILD_INCLUDES)
152
b0787093 153# Stabs manual: All files
e5249f67
AC
154STABS_DOC_SOURCE_INCLUDES = \
155 $(srcdir)/fdl.texi
a3b5281e
DE
156STABS_DOC_BUILD_INCLUDES = \
157 gdb-cfg.texi \
158 GDBvn.texi
b0787093
AC
159STABS_DOC_FILES = \
160 $(srcdir)/stabs.texinfo \
161 $(STABS_DOC_SOURCE_INCLUDES) \
162 $(STABS_DOC_BUILD_INCLUDES)
c906108c 163
e6f672d2
AC
164# Annotate migration document
165ANNOTATE_DOC_SOURCE_INCLUDES = \
166 $(srcdir)/fdl.texi
167ANNOTATE_DOC_BUILD_INCLUDES = \
23db03a6
JZ
168 gdb-cfg.texi \
169 GDBvn.texi
e6f672d2
AC
170ANNOTATE_DOC_FILES = \
171 $(srcdir)/annotate.texinfo \
172 $(ANNOTATE_DOC_SOURCE_INCLUDES) \
173 $(ANNOTATE_DOC_BUILD_INCLUDES)
174
43662968
JK
175# Options to extract the man page from gdb.texinfo
176MANCONF = -Dman
177
178TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl \
179 $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
180
181POD2MAN1 = pod2man --center="GNU Development Tools" \
01208463 182 --release="gdb-`sed q version.subst`" --section=1
43662968 183POD2MAN5 = pod2man --center="GNU Development Tools" \
01208463 184 --release="gdb-`sed q version.subst`" --section=5
43662968
JK
185
186# List of man pages generated from gdb.texi
ba643918 187MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
43662968
JK
188MAN5S = gdbinit.5
189MANS = $(MAN1S) $(MAN5S)
190
824083f3
AB
191# The pod files that are generated as a side effect of creating the
192# man pages.
ad666bec
AB
193POD_FILE_TMPS = $(patsubst %.1,%.pod,$(MAN1S)) \
194 $(patsubst %.5,%.pod,$(MAN5S))
824083f3 195
b292c783 196HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
4b136f6f 197HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
b292c783 198
c906108c
SS
199###
200
48ab418e 201all: info
c906108c 202
63ac3005 203info: $(INFO_DEPS)
96c1bcb3 204dvi: $(DVIFILES)
0a7cfe2c 205ps: gdb.ps stabs.ps refcard.ps annotate.ps
2b831889 206html: $(HTMLFILES)
9453113a 207pdf: $(PDFFILES)
43662968 208man: $(MANS)
1e0a5178
SS
209
210DOXYGEN = doxygen
211doxyedit = sed -e 's,@srcdir\@,$(srcdir),g'
212
213doxy: doxy/index.html \
214 doxy/gdb-api/index.html \
215 doxy/gdb-xref/index.html \
216 doxy/gdbserver/index.html
217
218doxy/index.html: $(srcdir)/doxy-index.in
219 -mkdir -p doxy
220 cp $(srcdir)/doxy-index.in doxy/index.html
221
222doxy/gdb-api/index.html: Doxyfile-gdb-api Doxyfile-base
223 -mkdir -p doxy
224 $(DOXYGEN) Doxyfile-gdb-api
225
226doxy/gdb-xref/index.html: Doxyfile-gdb-xref Doxyfile-base
227 -mkdir -p doxy
228 $(DOXYGEN) Doxyfile-gdb-xref
229
230doxy/gdbserver/index.html: Doxyfile-gdbserver Doxyfile-base
231 -mkdir -p doxy
232 $(DOXYGEN) Doxyfile-gdbserver
233
234Doxyfile-base: $(srcdir)/Doxyfile-base.in
235 $(doxyedit) $(srcdir)/Doxyfile-base.in >Doxyfile-base
236
237Doxyfile-gdb-api: $(srcdir)/Doxyfile-gdb-api.in
238 $(doxyedit) $(srcdir)/Doxyfile-gdb-api.in >Doxyfile-gdb-api
239
240Doxyfile-gdb-xref: $(srcdir)/Doxyfile-gdb-xref.in
241 $(doxyedit) $(srcdir)/Doxyfile-gdb-xref.in >Doxyfile-gdb-xref
242
243Doxyfile-gdbserver: $(srcdir)/Doxyfile-gdbserver.in
244 $(doxyedit) $(srcdir)/Doxyfile-gdbserver.in >Doxyfile-gdbserver
245
96c1bcb3 246all-doc: info dvi ps pdf
43662968 247diststuff: info man
c906108c 248
63ac3005 249install-info: $(INFO_DEPS)
c938e9b0 250 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(infodir)
63ac3005
EZ
251 @list='$(INFO_DEPS)'; \
252 for file in $$list; do \
253 if test -f $$file; then d=.; else d=$(srcdir); fi; \
254 for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
255 if test -f $$d/$$ifile; then \
c938e9b0
L
256 echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
257 $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
63ac3005
EZ
258 else : ; fi; \
259 done; \
260 done
c166cdc7 261 $(POST_INSTALL)
d3229ae3 262 @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
63ac3005 263 list='$(INFO_DEPS)'; \
d3229ae3 264 for file in $$list; do \
5843504f
EZ
265 echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
266 install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
d3229ae3
EZ
267 done; \
268 else : ; fi
c906108c 269
c166cdc7
EZ
270uninstall-info:
271 $(PRE_UNINSTALL)
272 @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
273 ii=yes; \
274 else ii=; fi; \
275 list='$(INFO_DEPS)'; \
276 for file in $$list; do \
277 test -z "$$ii" \
278 || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
279 done
280 $(NORMAL_UNINSTALL)
281 list='$(INFO_DEPS)'; \
282 for file in $$list; do \
283 (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
284 done
285
2b831889
JM
286html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
287
288install-html: $(HTMLFILES)
289 @$(NORMAL_INSTALL)
290 test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
291 @list='$(HTMLFILES_INSTALL)'; for p in $$list; do \
292 if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
293 f=$(html__strip_dir) \
294 if test -d "$$d$$p"; then \
295 echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
296 $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
297 echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
298 $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
299 else \
300 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
301 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
302 fi; \
085dd6e6
JM
303 done
304
96c1bcb3
CL
305dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
306
307install-dvi: $(DVIFILES)
308 @$(NORMAL_INSTALL)
309 test -z "$(dvidir)" || $(mkinstalldirs) "$(DESTDIR)$(dvidir)"
310 @list='$(DVIFILES)'; for p in $$list; do \
311 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
312 f=$(dvi__strip_dir) \
313 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/$$f'"; \
314 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/$$f"; \
315 done
316
9453113a
DJ
317pdf__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
318
319install-pdf: $(PDFFILES)
320 @$(NORMAL_INSTALL)
321 test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)"
322 @list='$(PDFFILES)'; for p in $$list; do \
323 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
324 f=$(pdf__strip_dir) \
325 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \
326 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \
327 done
328
43662968
JK
329install-man: install-man1 install-man5
330
331install-man1: $(MAN1S)
332 test -z "$(man1dir)" || $(mkinstalldirs) "$(DESTDIR)$(man1dir)"
0ed630cb 333 @list='$(MAN1S)'; for p in $$list; do \
b292c783
JK
334 if test "x$(HAVE_NATIVE_GCORE_TARGET)$(HAVE_NATIVE_GCORE_HOST)" = x \
335 -a "$$p" = gcore.1; then \
336 continue; \
337 fi; \
43662968 338 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
90debf20 339 f=`echo $$p | sed -e 's|^.*/||' -e '$(transform)'`; \
43662968
JK
340 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(man1dir)/$$f'"; \
341 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(man1dir)/$$f"; \
342 done
343
344install-man5: $(MAN5S)
345 test -z "$(man5dir)" || $(mkinstalldirs) "$(DESTDIR)$(man5dir)"
0ed630cb 346 @list='$(MAN5S)'; for p in $$list; do \
43662968 347 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
90debf20 348 f=`echo $$p | sed -e 's|^.*/||' -e '$(transform)'`; \
43662968
JK
349 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(man5dir)/$$f'"; \
350 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(man5dir)/$$f"; \
351 done
352
353uninstall-man: uninstall-man1 uninstall-man5
354
355uninstall-man1:
356 @test -n "$(man1dir)" || exit 0; \
b292c783
JK
357 files=`{ l2='$(MAN1S)'; for i in $$l2; do \
358 if test "x$(HAVE_NATIVE_GCORE_TARGET)$(HAVE_NATIVE_GCORE_HOST)" = x \
359 -a "$$i" = gcore.1; then \
360 continue; \
361 fi; \
362 echo "$$i"; \
363 done | \
43662968
JK
364 sed -n '/\.1[a-z]*$$/p'; \
365 } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
366 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
367 test -z "$$files" || { \
368 echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
369 cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
370
371uninstall-man5:
372 @test -n "$(man5dir)" || exit 0; \
0ed630cb 373 files=`{ l2='$(MAN5S)'; for i in $$l2; do echo "$$i"; done | \
43662968
JK
374 sed -n '/\.5[a-z]*$$/p'; \
375 } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
376 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
377 test -z "$$files" || { \
378 echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \
379 cd "$(DESTDIR)$(man5dir)" && rm -f $$files; }
380
381STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi *.pdf *.1 *.5
c906108c
SS
382
383# Copy the object files from a particular stage into a subdirectory.
384stage1: force
385 -mkdir stage1
386 -mv $(STAGESTUFF) stage1
387
388stage2: force
389 -mkdir stage2
390 -mv $(STAGESTUFF) stage2
391
392stage3: force
393 -mkdir stage3
394 -mv $(STAGESTUFF) stage3
395
396against=stage2
397
398comparison: force
399 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
400
401de-stage1: force
402 -(cd stage1 ; mv -f * ..)
403 -rmdir stage1
404
405de-stage2: force
406 -(cd stage2 ; mv -f * ..)
407 -rmdir stage2
408
409de-stage3: force
410 -(cd stage3 ; mv -f * ..)
411 -rmdir stage3
412
c906108c
SS
413# GDB QUICK REFERENCE (dvi output)
414refcard.dvi : refcard.tex $(REFEDITS)
824083f3
AB
415 $(SILENCE) echo > tmp.sed
416 $(SILENCE) for f in x $(REFEDITS) ; do \
dfa249fb
AC
417 test x$$f = xx && continue ; \
418 cat $(srcdir)/$$f >>tmp.sed ; \
419 done
824083f3
AB
420 $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
421 $(ECHO_TEX) $(SET_TEXINPUTS) $(TEX) sedref.tex
422 $(SILENCE) mv sedref.dvi refcard.dvi
423 $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
c906108c
SS
424
425refcard.ps : refcard.dvi
824083f3 426 $(ECHO_DVIPS) $(DVIPS) $(SILENT_Q_FLAG) -t landscape -o $@ $?
c906108c 427
9453113a 428refcard.pdf : refcard.tex $(REFEDITS)
824083f3
AB
429 $(SILENCE) echo > tmp.sed
430 $(SILENCE) for f in x $(REFEDITS) ; do \
9453113a
DJ
431 test x$$f = xx && continue ; \
432 cat $(srcdir)/$$f >>tmp.sed ; \
433 done
824083f3
AB
434 $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
435 $(ECHO_PDFTEX) $(SET_TEXINPUTS) $(PDFTEX) sedref.tex
436 $(SILENCE) mv sedref.pdf refcard.pdf
437 $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
9453113a 438
01208463
TT
439# File to record current GDB version number.
440GDBvn.texi : version.subst
824083f3
AB
441 $(ECHO_GEN)
442 $(SILENCE) echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
443 $(SILENCE) if [ -n "$(PKGVERSION)" ]; then \
c16158bc
JM
444 echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \
445 fi
824083f3
AB
446 $(SILENCE) echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
447 $(SILENCE) if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
c16158bc
JM
448 echo "@set BUGURL_DEFAULT" >> ./GDBvn.new; \
449 fi
824083f3 450 $(SILENCE) if test -z "$(READLINE_TEXI_INCFLAG)"; then \
39037522
TT
451 echo "@set SYSTEM_READLINE" >> ./GDBvn.new; \
452 fi
824083f3 453 $(SILENCE) if [ -n "$(SYSTEM_GDBINIT)" ]; then \
850f4ee5
CW
454 escaped_system_gdbinit=`echo $(SYSTEM_GDBINIT) | sed 's/@/@@/g'`; \
455 echo "@set SYSTEM_GDBINIT $$escaped_system_gdbinit" >> ./GDBvn.new; \
43662968 456 fi
824083f3 457 $(SILENCE) if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
850f4ee5
CW
458 escaped_system_gdbinit_dir=`echo $(SYSTEM_GDBINIT_DIR) | sed 's/@/@@/g'`; \
459 echo "@set SYSTEM_GDBINIT_DIR $$escaped_system_gdbinit_dir" >> ./GDBvn.new; \
ed2a2229 460 fi
824083f3 461 $(SILENCE) mv GDBvn.new GDBvn.texi
c906108c 462
d6c2da54 463version.subst: $(gdbdir)/version.in $(gdbdir)/../bfd/version.h
824083f3 464 $(ECHO_GEN) date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(gdbdir)/../bfd/version.h`; \
d6c2da54 465 sed -e "s/DATE/$$date/" < $(gdbdir)/version.in > version.subst
01208463 466
c906108c
SS
467# Updated atomically
468.PRECIOUS: GDBvn.texi
469
470# Choose configuration for GDB manual (normally `all'; normally not tied into
471# `configure' script because most users prefer generic version of manual,
472# not one for their binary config---which may not be specifically
473# defined anyways).
474gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
824083f3 475 $(ECHO_GEN) (test "$(LN_S)" = "ln -s" && \
39ec5655 476 ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
c906108c
SS
477 ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
478 cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
479
480# GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
481# If your texinfo or makeinfo don't support these, get a new texinfo release
482#
483# The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
484# Note that we can *generate* GDBvn.texi, but since we distribute one in the
485# source directory for the benefit of people who *don't* use this makefile,
486# VPATH will often tell make not to bother building it, because the one
487# in the srcdir is up to date. (if not, then make should build one here).
488
46d8b1c3
AC
489# Clean these up before each run. Avoids a catch 22 with not being
490# able to re-generate these files (to fix a corruption) because these
491# files contain a corruption.
b0787093
AC
492GDB_TEX_TMPS = gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
493 gdb.tp* gdb.vr*
494
c906108c 495# GDB MANUAL: TeX dvi file
b0787093 496gdb.dvi: ${GDB_DOC_FILES}
824083f3 497 $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
44e2be90 498 (test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
c906108c
SS
499 ln $(srcdir)/GDBvn.texi . || \
500 cp $(srcdir)/GDBvn.texi . ; else true; fi
824083f3
AB
501 $(SILENCE) rm -f $(GDB_TEX_TMPS)
502 $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) $(READLINE_TEXI_INCFLAG) \
503 -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
c906108c
SS
504
505gdb.ps: gdb.dvi
824083f3 506 $(ECHO_DVIPS) $(DVIPS) $(SILENT_Q_FLAG) -o $@ $?
c906108c 507
b0787093 508gdb.pdf: ${GDB_DOC_FILES}
824083f3 509 $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
44e2be90 510 (test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
449f3b6c
AC
511 ln $(srcdir)/GDBvn.texi . || \
512 cp $(srcdir)/GDBvn.texi . ; else true; fi
824083f3
AB
513 $(SILENCE) rm -f $(GDB_TEX_TMPS)
514 $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) --pdf \
515 $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
26e251b6 516 $(srcdir)/gdb.texinfo
449f3b6c 517
c906108c 518# GDB MANUAL: info file
b0787093 519gdb.info: ${GDB_DOC_FILES}
824083f3 520 $(ECHO_MAKEINFO) $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
a7b40f07 521 -o gdb.info $(srcdir)/gdb.texinfo
c906108c
SS
522
523# GDB MANUAL: roff translations
524# Try to use a recent texi2roff. v2 was put on prep in jan91.
525# If you want an index, see texi2roff doc for postprocessing
526# and add -i to texi2roff invocations below.
527# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
528# corresponding -e lines when later texi2roff's are current)
529# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
530# + @c's deleted explicitly because texi2roff sees texinfo commands in them
531# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
532# + @alphaenumerate is ridiculously new, turned into @enumerate
533
534# texi2roff doesn't have a notion of include dirs, so we have to fake
535# it out for gdb manual's include files---but only if not configured
536# in main sourcedir.
b0787093 537links2roff: $(GDB_DOC_SOURCE_INCLUDES)
824083f3 538 $(ECHO_GEN) if [ ! -f gdb.texinfo ]; then \
44e2be90 539 (test "$(LN_S)" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \
b0787093
AC
540 ln $(GDB_DOC_SOURCE_INCLUDES) . || \
541 cp $(GDB_DOC_SOURCE_INCLUDES) . ; \
c906108c 542 fi
824083f3 543 $(SILENCE) touch links2roff
c906108c 544
c906108c 545# gdb manual suitable for [gtn]roff -me
b0787093 546gdb.me: $(GDB_DOC_FILES) links2roff
824083f3 547 $(ECHO_GEN) sed -e '/\\input texinfo/d' \
c906108c
SS
548 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
549 -e '/^@ifinfo/,/^@end ifinfo/d' \
550 -e '/^@c /d' \
551 -e 's/{.*,,/{/' \
552 -e 's/@ / /g' \
553 -e 's/^@alphaenumerate/@enumerate/g' \
554 -e 's/^@end alphaenumerate/@end enumerate/g' \
555 $(srcdir)/gdb.texinfo | \
556 $(TEXI2ROFF) -me | \
557 sed -e 's/---/\\(em/g' \
558 >gdb.me
559
560# gdb manual suitable for [gtn]roff -ms
b0787093 561gdb.ms: $(GDB_DOC_FILES) links2roff
824083f3 562 $(ECHO_GEN) sed -e '/\\input texinfo/d' \
c906108c
SS
563 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
564 -e '/^@ifinfo/,/^@end ifinfo/d' \
565 -e '/^@c /d' \
566 -e 's/{.*,,/{/' \
567 -e 's/@ / /g' \
568 -e 's/^@alphaenumerate/@enumerate/g' \
569 -e 's/^@end alphaenumerate/@end enumerate/g' \
570 $(srcdir)/gdb.texinfo | \
571 $(TEXI2ROFF) -ms | \
572 sed -e 's/---/\\(em/g' \
573 >gdb.ms
574
575# gdb manual suitable for [tn]roff -mm
576# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
577# try leaving them in
b0787093 578gdb.mm: $(GDB_DOC_FILES) links2roff
824083f3 579 $(ECHO_GEN) sed -e '/\\input texinfo/d' \
c906108c
SS
580 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
581 -e '/^@ifinfo/,/^@end ifinfo/d' \
582 -e '/^@c /d' \
583 -e 's/{.*,,/{/' \
584 -e '/@noindent/d' \
585 -e 's/@ / /g' \
586 -e 's/^@alphaenumerate/@enumerate/g' \
587 -e 's/^@end alphaenumerate/@end enumerate/g' \
588 $(srcdir)/gdb.texinfo | \
589 $(TEXI2ROFF) -mm | \
590 sed -e 's/---/\\(em/g' \
591 >gdb.mm
592
085dd6e6
JM
593# GDB MANUAL: HTML file
594
2b831889 595gdb/index.html: ${GDB_DOC_FILES}
824083f3 596 $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
7bd836d5
SM
597 -o gdb \
598 $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
599 $(srcdir)/gdb.texinfo
085dd6e6 600
b0787093 601stabs.info: $(STABS_DOC_FILES)
824083f3 602 $(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
c906108c 603
085dd6e6
JM
604# STABS DOCUMENTATION: HTML file
605
2b831889 606stabs/index.html: $(STABS_DOC_FILES)
824083f3 607 $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
7bd836d5
SM
608 -o stabs \
609 -I $(srcdir) \
610 $(srcdir)/stabs.texinfo
085dd6e6 611
46d8b1c3
AC
612# Clean these up before each run. Avoids a catch 22 with not being
613# able to re-generate these files (to fix a corruption) because these
614# files contain a corruption.
b0787093
AC
615STABS_TEX_TMPS = stabs.aux stabs.cp* stabs.fn* stabs.ky* \
616 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
617
c906108c 618# STABS DOCUMENTATION: TeX dvi file
b0787093 619stabs.dvi : $(STABS_DOC_FILES)
824083f3
AB
620 $(SILENCE) rm -f $(STABS_TEX_TMPS)
621 $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) -I $(srcdir) \
622 $(srcdir)/stabs.texinfo
c906108c
SS
623
624stabs.ps: stabs.dvi
824083f3 625 $(ECHO_DVIPS) $(DVIPS) $(SILENT_Q_FLAG) -o $@ $?
c906108c 626
b0787093 627stabs.pdf: $(STABS_DOC_FILES)
824083f3
AB
628 $(SILENCE) rm -f $(STABS_TEX_TMPS)
629 $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) --pdf -I $(srcdir) \
630 $(srcdir)/stabs.texinfo
449f3b6c 631
e6f672d2
AC
632# Clean these up before each run. Avoids a catch 22 with not being
633# able to re-generate these files (to fix a corruption) because these
634# files contain a corruption.
635ANNOTATE_TEX_TMPS = annotate.aux annotate.cp* annotate.fn* annotate.ky* \
636 annotate.log annotate.pg* annotate.toc annotate.tp* annotate.vr*
637
638# ANNOTATE DOCUMENTATION: TeX dvi file
639annotate.dvi : $(ANNOTATE_DOC_FILES)
824083f3
AB
640 $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
641 $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) -I $(srcdir) \
642 $(srcdir)/annotate.texinfo
e6f672d2
AC
643
644annotate.ps: annotate.dvi
824083f3 645 $(ECHO_DVIPS) $(DVIPS) $(SILENT_Q_FLAG) -o $@ $?
e6f672d2
AC
646
647annotate.pdf: $(ANNOTATE_DOC_FILES)
824083f3
AB
648 $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
649 $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) --pdf -I $(srcdir) \
650 $(srcdir)/annotate.texinfo
e6f672d2
AC
651
652annotate.info: $(ANNOTATE_DOC_FILES)
824083f3 653 $(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
e6f672d2 654
2b831889 655annotate/index.html: $(ANNOTATE_DOC_FILES)
824083f3 656 $(ECHO_MAKEHTML) $(MAKEHTML) $(MAKEHTMLFLAGS) \
7bd836d5
SM
657 -o annotate \
658 -I $(srcdir) \
659 $(srcdir)/annotate.texinfo
e6f672d2 660
40acbd34
AB
661# Man pages. The TEXI2POD and TEXI2MAN steps are performed within a
662# single recipe to support how we distribute GDB releases. A release
663# includes the .1 and .5 man pages in the source tree, but not the
664# .pod files.
665#
666# When building and installing a release of GDB it should not be
667# necessary to rebuild the .1 or .5 man page files, nor should it be
668# necessary to rebuild the .pod files.
669#
670# If we split the .pod creation from the creation of the .1 and .5
671# pages, then the .pod files must become a dependency, this will
672# trigger an attempt to rebuild these files while building and
673# installing a release of GDB, which is something we don't want.
674$(MAN1S) : %.1 : $(GDB_DOC_FILES)
675 $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod
824083f3 676 $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
ba643918 677 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
40acbd34 678 $(SILENCE) rm -f $*.pod
ba643918 679
40acbd34
AB
680$(MAN5S) : %.5 : $(GDB_DOC_FILES)
681 $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod
824083f3 682 $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
43662968 683 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
40acbd34 684 $(SILENCE) rm -f $*.pod
43662968 685
c906108c
SS
686force:
687
5ae98d25 688Makefile: Makefile.in $(host_makefile_frag) ../config.status
824083f3 689 $(ECHO_GEN) cd .. && $(SHELL) ./config.status $(SILENT_FLAG) doc/Makefile
46d8b1c3
AC
690
691
692# The "least clean" level of cleaning. Get rid of files which are
693# automatically generated files that are just intermediate files,
694
695mostlyclean:
696 rm -f gdb.mm gdb.ms gdb.me links2roff
697 rm -f $(GDB_TEX_TMPS)
46d8b1c3 698 rm -f $(STABS_TEX_TMPS)
e6f672d2 699 rm -f $(ANNOTATE_TEX_TMPS)
824083f3
AB
700 rm -f sedref.dvi sedref.tex tmp.sed sedref.log
701 rm -f $(POD_FILE_TMPS)
46d8b1c3
AC
702
703clean: mostlyclean
ab954e4a 704 rm -f gdb-cfg.texi
46d8b1c3
AC
705
706distclean: clean
5ae98d25 707 rm -f Makefile
46d8b1c3
AC
708
709# GDBvn.texi, the dvi files, the info files, and the postscript files,
710# are all part of the distribution, so it should not be removed by
711# "clean" or "distclean". Use maintainer-clean to remove them.
712
713maintainer-clean realclean: distclean
ab954e4a 714 rm -f GDBvn.texi version.subst *.info* *.dvi *.ps *.html *.pdf $(MANS)
46d8b1c3 715
43662968 716install: install-info install-man
c166cdc7 717
43662968 718uninstall: uninstall-info uninstall-man
ad02e4fe
SM
719
720# Disable implicit make rules.
721include $(srcdir)/../disable-implicit-rules.mk