Update/correct copyright notices.
[external/binutils.git] / gdb / doc / Makefile.in
1 ##Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000
2 ##Free Software Foundation, Inc.
3
4 # Makefile for GDB documentation.
5 # This file is part of GDB.
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
21 srcdir = @srcdir@
22 VPATH = @srcdir@
23
24 prefix = @prefix@
25
26 infodir = @infodir@
27 htmldir = $(prefix)/html
28
29 SHELL = @SHELL@
30
31 LN_S = @LN_S@
32
33 INSTALL = @INSTALL@
34 INSTALL_PROGRAM = @INSTALL_PROGRAM@
35 INSTALL_DATA = @INSTALL_DATA@
36
37 # main GDB source directory
38 gdbdir = $(srcdir)/..
39
40 # where to find texinfo; GDB dist should include a recent one
41 TEXIDIR=${gdbdir}/../texinfo
42
43 # where to find makeinfo, preferably one designed for texinfo-2
44 MAKEINFO=makeinfo
45
46 # Note that texinfo 4.0's makeinfo --html can only generate a
47 # single file, which would be too large, so continue to use
48 # texi2html. -sts 2000-03-28
49
50 MAKEHTML = texi2html
51 MAKEHTMLFLAGS = -glossary -menu -split_chapter
52
53 # where to find texi2roff, ditto
54 TEXI2ROFF=texi2roff
55
56 # Where is the source dir for the READLINE library doc?  
57 # Traditionally readline is in .. or .
58 READLINE_DIR = ${gdbdir}/../readline/doc
59
60 # The GDB/MI docs come from a sibling directory ../mi
61 GDBMI_DIR = ${gdbdir}/mi
62
63 SET_TEXINPUTS = \
64    TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$(GDBMI_DIR):$$TEXINPUTS
65
66 # Files which should be generated via 'info' and installed by 'install-info'
67 INFO_DEPS = gdb.info gdbint.info stabs.info
68
69 # There may be alternate predefined collections of switches to configure
70 # the GDB manual.  Normally this is not done in synch with the software
71 # config system, since this choice tends to be independent; most people
72 # want a doc config of `all' for a generic manual, regardless of sw config.
73 DOC_CONFIG = all
74
75 # This list of sed edits will edit the GDB reference card
76 # for what fonts and what papersize to use.
77 # By default (NO edits applied), the refcard uses:
78 #    - Computer Modern (CM) fonts
79 #    - US letter paper (8.5x11in)
80 # List some of the following files for alternative fonts and paper:
81 #  a4rc.sed     use A4 paper (297 x 210 mm)
82 #  psrc.sed     use PostScript fonts (Karl Berry short TeX names)
83 # lpsrc.sed     use PostScript fonts (full PostScript names in TeX)
84 # e.g. for A4, Postscript:  REFEDITS = a4rc.sed psrc.sed
85 #      for A4, CM fonts:    REFEDITS = a4rc.sed
86 #      for US, PS fonts:    REFEDITS = psrc.sed
87 #      for default:
88 REFEDITS =
89
90 # Don Knuth's TeX formatter
91 TEX = tex
92
93 # auxiliary program for sorting Texinfo indices
94 TEXINDEX = texindex
95
96 # Program to generate Postscript files from DVI files.
97 DVIPS = dvips
98
99 # Program to generate PDF files from tex files.
100 PDFTEX = pdftex
101
102 # Main GDB manual's source files
103 SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/annotate.texi
104
105 SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED)
106
107 SFILES_DOC = $(SFILES_LOCAL) $(GDBMI_DIR)/gdbmi.texinfo \
108                 $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texinfo
109
110 #### Host, target, and site specific Makefile fragments come in here.
111 ###
112
113 all install:
114
115 info: $(INFO_DEPS)
116 dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi
117 ps: gdb.ps gdbint.ps stabs.ps refcard.ps
118 html: gdb_toc.html gdbint_toc.html stabs_toc.html
119 pdf: gdb.pdf gdbint.pdf stabs.pdf
120 all-doc: info dvi ps # pdf
121 diststuff: info
122
123 install-info: $(INFO_DEPS)
124         $(SHELL) $(srcdir)/../../mkinstalldirs $(infodir)
125         @list='$(INFO_DEPS)'; \
126         for file in $$list; do \
127           if test -f $$file; then d=.; else d=$(srcdir); fi; \
128           for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
129             if test -f $$d/$$ifile; then \
130               echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
131               $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
132             else : ; fi; \
133           done; \
134         done
135         @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
136           list='$(INFO_DEPS)'; \
137           for file in $$list; do \
138             echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
139             install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
140           done; \
141         else : ; fi
142
143 install-html: html
144         for i in *.html ; do \
145                 $(INSTALL_DATA) $$i $(htmldir)/$$i ; \
146         done
147
148 STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi *.pdf
149
150 # Copy the object files from a particular stage into a subdirectory.
151 stage1: force
152         -mkdir stage1
153         -mv $(STAGESTUFF) stage1
154
155 stage2: force
156         -mkdir stage2
157         -mv $(STAGESTUFF) stage2
158
159 stage3: force
160         -mkdir stage3
161         -mv $(STAGESTUFF) stage3
162
163 against=stage2
164
165 comparison: force
166         for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
167
168 de-stage1: force
169         -(cd stage1 ; mv -f * ..)
170         -rmdir stage1
171
172 de-stage2: force
173         -(cd stage2 ; mv -f * ..)
174         -rmdir stage2
175
176 de-stage3: force
177         -(cd stage3 ; mv -f * ..)
178         -rmdir stage3
179
180 # The "least clean" level of cleaning.  Get rid of files which are
181 # automatically generated files that are just intermediate files,
182
183 mostlyclean:
184         rm -f gdb.mm gdb.ms gdb.me links2roff
185         rm -f *.aux *.cp* *.fn* *.ky* *.log *.pg* *.toc *.tp* *.vr*
186         rm -f sedref.dvi sedref.tex tmp.sed
187
188 clean: mostlyclean
189         rm -f rluser.texinfo inc-hist.texinfo gdb-cfg.texi
190
191 distclean: clean
192         rm -f Makefile config.status
193
194 # GDBvn.texi, the dvi files, the info files, and the postscript files, 
195 # are all part of the distribution, so it should not be removed by
196 # "clean" or "distclean".  Use maintainer-clean to remove them.
197
198 maintainer-clean realclean: distclean
199         rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf
200
201 # GDB QUICK REFERENCE (dvi output)
202 refcard.dvi : refcard.tex $(REFEDITS)
203         if [ -z "$(REFEDITS)" ]; then \
204                 cp $(srcdir)/refcard.tex sedref.tex ; \
205         else \
206                 echo > tmp.sed ; \
207                 for f in $(REFEDITS) ; do \
208                         cat $(srcdir)/$$f >>tmp.sed ; done ; \
209                 sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex ; \
210         fi
211         $(SET_TEXINPUTS) $(TEX) sedref.tex
212         mv sedref.dvi refcard.dvi
213         rm -f sedref.log sedref.tex tmp.sed
214
215 refcard.ps : refcard.dvi
216         $(DVIPS) -t landscape -o $@ $?
217
218 # File to record current GDB version number (copied from main dir Makefile.in)
219 GDBvn.texi : ${gdbdir}/Makefile.in
220         echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/^VERSION *= *//p'`" > ./GDBvn.new
221         mv GDBvn.new GDBvn.texi
222
223 # Updated atomically
224 .PRECIOUS: GDBvn.texi
225
226 # Choose configuration for GDB manual (normally `all'; normally not tied into
227 # `configure' script because most users prefer generic version of manual,
228 # not one for their binary config---which may not be specifically
229 # defined anyways).
230 gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
231         (test "$$LN_S" = "ln -s" && \
232           ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
233         ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
234         cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
235
236 # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
237 # If your texinfo or makeinfo don't support these, get a new texinfo release
238 #
239 # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
240 #   Note that we can *generate* GDBvn.texi, but since we distribute one in the
241 #   source directory for the benefit of people who *don't* use this makefile,
242 #   VPATH will often tell make not to bother building it, because the one
243 #   in the srcdir is up to date.  (if not, then make should build one here).
244
245 # GDB MANUAL: TeX dvi file
246 gdb.dvi: ${SFILES_DOC}
247         if [ ! -f ./GDBvn.texi ]; then \
248                 (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
249                 ln $(srcdir)/GDBvn.texi . || \
250                 cp $(srcdir)/GDBvn.texi . ; else true; fi
251         $(SET_TEXINPUTS) $(TEX) gdb.texinfo
252         $(SET_TEXINPUTS) $(TEX) gdb.texinfo
253         $(TEXINDEX) gdb.??
254         $(SET_TEXINPUTS) $(TEX) gdb.texinfo
255         rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
256                 gdb.tp* gdb.vr*
257
258 gdb.ps: gdb.dvi
259         $(DVIPS) -o $@ $?
260
261 gdb.pdf: ${SFILES_DOC}
262         if [ ! -f ./GDBvn.texi ]; then \
263                 (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
264                 ln $(srcdir)/GDBvn.texi . || \
265                 cp $(srcdir)/GDBvn.texi . ; else true; fi
266         $(SET_TEXINPUTS) $(PDFTEX) gdb.texinfo
267         $(SET_TEXINPUTS) $(PDFTEX) gdb.texinfo
268         $(TEXINDEX) gdb.??
269         $(SET_TEXINPUTS) $(PDFTEX) gdb.texinfo
270         rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
271                 gdb.tp* gdb.vr*
272
273 # GDB MANUAL: info file
274 # We're using texinfo 3.12; older makeinfo's may not be able to
275 # cope with all the markup.  
276 gdb.info: ${SFILES_DOC}
277         $(MAKEINFO) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo
278
279 # GDB MANUAL: roff translations
280 # Try to use a recent texi2roff.  v2 was put on prep in jan91.
281 # If you want an index, see texi2roff doc for postprocessing 
282 # and add -i to texi2roff invocations below.
283 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
284 #    corresponding -e lines when later texi2roff's are current)
285 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
286 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
287 # + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
288 # + @alphaenumerate is ridiculously new, turned into @enumerate
289
290 # texi2roff doesn't have a notion of include dirs, so we have to fake 
291 # it out for gdb manual's include files---but only if not configured
292 # in main sourcedir.
293 links2roff: $(SFILES_INCLUDED)
294         if [ ! -f gdb.texinfo ]; then \
295                 (test "$$LN_S" = "ln -s" && ln -s $(SFILES_INCLUDED) .) || \
296                 ln $(SFILES_INCLUDED)    . || \
297                 cp $(SFILES_INCLUDED)    . ; \
298         fi
299         touch links2roff
300
301 #  "Readline" appendices.  Get them also due to lack of includes, 
302 # regardless of whether or not configuring in main sourcedir.
303 # @ftable removed due to bug in texi2roff-2; if your texi2roff
304 # is newer, try just ln or cp
305 rluser.texinfo: ${READLINE_DIR}/rluser.texinfo
306                 sed -e 's/^@ftable/@table/g' \
307                 -e 's/^@end ftable/@end table/g' \
308                 ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo
309
310 inc-hist.texinfo: ${READLINE_DIR}/inc-hist.texinfo
311         (test "$$LN_S" = "ln -s" && \
312          ln -s ${READLINE_DIR}/inc-hist.texinfo .) || \
313         ln ${READLINE_DIR}/inc-hist.texinfo . || \
314         cp ${READLINE_DIR}/inc-hist.texinfo .
315
316 gdbmi.texinfo: ${GDBMI_DIR}/gdbmi.texinfo
317         (test "$$LN_S" = "ln -s" && \
318          ln -s ${GDBMI_DIR}/gdbmi.texinfo .) || \
319         ln ${GDBMI_DIR}/gdbmi.texinfo . || \
320         cp ${GDBMI_DIR}/gdbmi.texinfo .
321
322 # gdb manual suitable for [gtn]roff -me
323 gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
324         sed -e '/\\input texinfo/d' \
325                 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
326                 -e '/^@ifinfo/,/^@end ifinfo/d' \
327                 -e '/^@c /d' \
328                 -e 's/{.*,,/{/' \
329                 -e 's/@ / /g' \
330                 -e 's/^@alphaenumerate/@enumerate/g' \
331                 -e 's/^@end alphaenumerate/@end enumerate/g' \
332                 $(srcdir)/gdb.texinfo | \
333         $(TEXI2ROFF) -me | \
334         sed -e 's/---/\\(em/g' \
335         >gdb.me 
336
337 # gdb manual suitable for [gtn]roff -ms
338 gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
339         sed -e '/\\input texinfo/d' \
340                 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
341                 -e '/^@ifinfo/,/^@end ifinfo/d' \
342                 -e '/^@c /d' \
343                 -e 's/{.*,,/{/' \
344                 -e 's/@ / /g' \
345                 -e 's/^@alphaenumerate/@enumerate/g' \
346                 -e 's/^@end alphaenumerate/@end enumerate/g' \
347                 $(srcdir)/gdb.texinfo | \
348         $(TEXI2ROFF) -ms | \
349         sed -e 's/---/\\(em/g' \
350         >gdb.ms 
351
352 # gdb manual suitable for [tn]roff -mm
353 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, 
354 #   try leaving them in
355 gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
356         sed -e '/\\input texinfo/d' \
357                 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
358                 -e '/^@ifinfo/,/^@end ifinfo/d' \
359                 -e '/^@c /d' \
360                 -e 's/{.*,,/{/' \
361                 -e '/@noindent/d' \
362                 -e 's/@ / /g' \
363                 -e 's/^@alphaenumerate/@enumerate/g' \
364                 -e 's/^@end alphaenumerate/@end enumerate/g' \
365                 $(srcdir)/gdb.texinfo | \
366         $(TEXI2ROFF) -mm | \
367         sed -e 's/---/\\(em/g' \
368         >gdb.mm 
369
370 # GDB MANUAL: HTML file
371
372 gdb_toc.html: ${SFILES_DOC}
373         $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
374
375 # GDB GUI MANUAL: TeX dvi file
376 gdbgui.dvi : gdbgui.texinfo ${SFILES_DOC}
377         $(SET_TEXINPUTS) $(TEX) gdbgui.texinfo
378         $(TEXINDEX) gdbgui.??
379         $(SET_TEXINPUTS) $(TEX) gdbgui.texinfo
380         rm -f gdbgui.aux gdbgui.cp* gdbgui.fn* gdbgui.ky* \
381                 gdbgui.log gdbgui.pg* gdbgui.toc gdbgui.tp* gdbgui.vr*
382
383 # GDB GUI MANUAL: info file
384 gdb-gui: gdbgui.info
385
386 gdbgui.info: gdbgui.texinfo ${SFILES_DOC}
387         $(MAKEINFO) -o gdbgui.info $(srcdir)/gdbgui.texinfo
388
389 # GDB INTERNALS MANUAL: TeX dvi file
390 gdbint.dvi : gdbint.texinfo
391         $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
392         $(TEXINDEX) gdbint.??
393         $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
394         rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
395                 gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
396
397 gdbint.ps : gdbint.dvi
398         $(DVIPS) -o $@ $?
399
400 gdbint.pdf: gdbint.dvi
401         $(SET_TEXINPUTS) $(PDFTEX) gdbint.texinfo
402         $(TEXINDEX) gdbint.??
403         $(SET_TEXINPUTS) $(PDFTEX) gdbint.texinfo
404         rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
405                 gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
406
407 # GDB INTERNALS MANUAL: info file
408
409 gdbint.info: gdbint.texinfo
410         $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
411
412 # GDB INTERNALS MANUAL: HTML file
413
414 gdbint_toc.html: gdbint.texinfo
415         $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/gdbint.texinfo
416
417 stabs.info: stabs.texinfo
418         $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
419
420 # STABS DOCUMENTATION: HTML file
421
422 stabs_toc.html: stabs.texinfo
423         $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/stabs.texinfo
424
425 # STABS DOCUMENTATION: TeX dvi file
426 stabs.dvi : stabs.texinfo
427         $(SET_TEXINPUTS) $(TEX) stabs.texinfo
428         $(TEXINDEX) stabs.??
429         $(SET_TEXINPUTS) $(TEX) stabs.texinfo
430         rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
431                 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
432
433 stabs.ps: stabs.dvi
434         $(DVIPS) -o $@ $?
435
436 stabs.pdf: stabs.dvi
437         $(SET_TEXINPUTS) $(PDFTEX) stabs.texinfo
438         $(TEXINDEX) stabs.??
439         $(SET_TEXINPUTS) $(PDFTEX) stabs.texinfo
440         rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
441                 stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
442
443 force:
444
445 Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) config.status
446         $(SHELL) ./config.status