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