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