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