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