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