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