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