1 ##Copyright (C) 1991 Free Software Foundation, Inc.
3 # Makefile for GDB documentation.
4 # This file is part of GDB.
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.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
23 idestdir = $(ddestdir)
27 # main GDB source directory
30 # Documentation (gdb.dvi) needs either GNU m4 or SysV m4;
31 # Berkeley/Sun don't have quite enough.
35 # where to find texinfo; GDB dist should include a recent one
36 TEXIDIR=$(srcdir)/${gdbdir}/../texinfo/fsf
38 # where to find makeinfo, preferably one designed for texinfo-2
41 # where to find texi2roff, ditto
44 # Where is the source dir for the READLINE library? Traditionally in .. or .
45 # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
46 READLINE_DIR = $(srcdir)/${gdbdir}/../readline
48 # Main GDB manual's source files
50 $(srcdir)/gdb.texinfo $(srcdir)/pretex.m4 $(srcdir)/none.m4 \
51 $(srcdir)/all.m4 gdbinv-m.m4 gdbinv-s.m4 gdbVN.m4
53 # Which version of GDB manual? default includes everything
58 all-info: gdb.info gdbint.info
59 #all: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi
61 install-info: all-info
62 for i in *.info* ; do \
63 echo Installing $$i... ; \
64 (cp $$i $(idestdir)/info/$$i.n \
65 && mv -f $(idestdir)/info/$$i.n $(idestdir)/info/$$i) \
69 STAGESTUFF = *.info* gdb-all.texi gdbVN.m4
71 # Copy the object files from a particular stage into a subdirectory.
74 -mv $(STAGESTUFF) stage1
78 -mv $(STAGESTUFF) stage2
82 -mv $(STAGESTUFF) stage3
87 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
90 - (cd stage1 ; mv -f * ..)
94 - (cd stage2 ; mv -f * ..)
98 - (cd stage3 ; mv -f * ..)
102 rm -f gdb.dvi rdl-apps.texi gdb-all* gdb.info* gdbVN.m4
103 rm -f gdb-internals gdbint.?? gdbint.??? gdbint.info
104 rm -f refcard.ps refcard.dvi rcfonts.tex refcard.log *~
106 # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
107 refcard.dvi : refcard.tex
108 rm -f rcfonts.tex; cp rc-cm.tex rcfonts.tex
109 TEXINPUTS=.:$$TEXINPUTS tex refcard.tex; rm -f refcard.log
112 # GDB QUICK REFERENCE (PostScript output, common PS fonts)
113 refcard.ps : refcard.tex
114 rm -f rcfonts.tex; cp rc-ps.tex rcfonts.tex
115 TEXINPUTS=.:$$TEXINPUTS tex refcard.tex
116 dvips -t landscape refcard -o; rm -f refcard.dvi refcard.log
119 # Cover file for "Readline" appendices
120 rdl-apps.texi: ${READLINE_DIR}/inc-read.texi \
121 ${READLINE_DIR}/inc-hist.texi
123 echo "@include ${READLINE_DIR}/inc-read.texi" >rdl-apps.texi
124 echo "@include ${READLINE_DIR}/inc-hist.texi" >>rdl-apps.texi
126 # File to record current GDB version number (copied from main dir Makefile.in)
127 gdbVN.m4 : ${gdbdir}/Makefile.in
128 ( VER=`sed <$(srcdir)/${gdbdir}/Makefile.in -n 's/VERSION = //p'` ;\
129 echo "_define__(<_GDB_VN__>,$$VER)" > gdbVN.m4 )
131 # GDB MANUAL: texinfo source, created by preprocessing w/m4
132 # If you want other configs in the makefile, add or modify instructions for
133 # building source here, then change CONFIG (that way you get info, dvi,
134 # roff targets automatically for your config).
135 # Be sure to not create a bad gdb-all.texi if ${M4} is missing or aborts...
136 gdb-all.texi: ${SFILES_DOCDIR}
138 ${M4} $(srcdir)/pretex.m4 $(srcdir)/none.m4 $(srcdir)/all.m4 $(srcdir)/gdb.texinfo >foobus.texinfo
140 mv foobus.texinfo gdb-all.texi
142 # GDB MANUAL: TeX dvi file
143 gdb.dvi : gdb-${CONFIG}.texi rdl-apps.texi
144 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-${CONFIG}.texi
145 texindex gdb-${CONFIG}.??
146 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-${CONFIG}.texi
147 mv gdb-${CONFIG}.dvi gdb.dvi
148 rm -f gdb-${CONFIG}.?? gdb-${CONFIG}.???
150 # GDB MANUAL: info file
151 # We're using texinfo2, and older makeinfo's may not be able to
152 # cope with all the markup. In the meantime, we distribute the info
154 gdb.info: gdb-${CONFIG}.texi
155 $(MAKEINFO) -o gdb.info gdb-${CONFIG}.texi
157 # GDB MANUAL: roff translations
158 # Try to use a recent texi2roff. v2 was put on prep in jan91.
159 # If you want an index, see texi2roff doc for postprocessing
160 # and add -i to texi2roff invocations below.
161 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
162 # correspondint -e lines when later texi2roff's are current)
163 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
164 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
165 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
166 # + @alphaenumerate is ridiculously new, turned into @enumerate
169 # gdb manual suitable for [tn]roff -mm
170 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
171 # try leaving them in
172 gdb.mm: gdb-${CONFIG}.texi
173 sed -e '/\\input texinfo/d' \
174 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
175 -e '/^@ifinfo/,/^@end ifinfo/d' \
180 -e 's/^@alphaenumerate/@enumerate/g' \
181 -e 's/^@end alphaenumerate/@end enumerate/g' \
182 gdb-${CONFIG}.texi | \
184 sed -e 's/---/\\(em/g' \
187 # gdb manual suitable for [gtn]roff -me
188 gdb.me: gdb-${CONFIG}.texi
189 sed -e '/\\input texinfo/d' \
190 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
191 -e '/^@ifinfo/,/^@end ifinfo/d' \
195 -e 's/^@alphaenumerate/@enumerate/g' \
196 -e 's/^@end alphaenumerate/@end enumerate/g' \
197 gdb-${CONFIG}.texi | \
199 sed -e 's/---/\\(em/g' \
202 # gdb manual suitable for [gtn]roff -ms
203 gdb.ms: gdb-${CONFIG}.texi
204 sed -e '/\\input texinfo/d' \
205 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
206 -e '/^@ifinfo/,/^@end ifinfo/d' \
210 -e 's/^@alphaenumerate/@enumerate/g' \
211 -e 's/^@end alphaenumerate/@end enumerate/g' \
212 gdb-${CONFIG}.texi | \
214 sed -e 's/---/\\(em/g' \
217 # GDB INTERNALS MANUAL: TeX dvi file
218 gdbint.dvi : gdbint.texinfo
219 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo
221 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo
222 rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \
223 gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs
225 # GDB INTERNALS MANUAL: info file
226 gdb-internals: gdbint.info
228 gdbint.info: gdbint.texinfo
229 $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
233 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
234 $(SHELL) ./config.status