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