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