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