1 ##Copyright (C) 1991, 1992 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.
24 infodir = $(prefix)/info
29 INSTALL_PROGRAM
= $(INSTALL
)
30 INSTALL_DATA
= $(INSTALL
)
32 # main GDB source directory
35 # where to find texinfo; GDB dist should include a recent one
36 TEXIDIR
=${gdbdir}/..
/texinfo
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 doc?
45 # Traditionally readline is in .. or .
46 READLINE_DIR
= ${gdbdir}/..
/readline
/doc
48 SET_TEXINPUTS
= TEXINPUTS
=${TEXIDIR}:.
:$(srcdir):$(READLINE_DIR
):$$TEXINPUTS
50 # Don Knuth's TeX formatter
53 # auxiliary program for sorting Texinfo indices
56 # Main GDB manual's source files
57 SFILES_INCLUDED
= $(srcdir)/gdb-config.texi
$(srcdir)/gdbinv-s.texi
59 SFILES_LOCAL
= $(srcdir)/gdb.texinfo GDBvn.texi
$(SFILES_INCLUDED
)
61 SFILES_DOC
= $(SFILES_LOCAL
) \
62 $(READLINE_DIR
)/rluser.texinfo
$(READLINE_DIR
)/inc-hist.texi
64 #### Host, target, and site specific Makefile fragments come in here.
69 info: gdb.
info gdbint.
info stabs.
info
70 dvi: gdb.
dvi refcard.
dvi gdbint.
dvi
71 all-doc
: gdb.
info gdb.
dvi refcard.
dvi gdb-internals gdbint.
dvi
74 -parent
=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
75 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
76 -if
[ -d
$(infodir) ] ; then true
; else mkdir
$(infodir) ; fi
77 for i in
*.
info* ; do \
78 $(INSTALL_DATA
) $$i $(infodir)/$$i ; \
81 STAGESTUFF
= *.
info* gdb-all.texi GDBvn.texi
83 # Copy the object files from a particular stage into a subdirectory.
86 -mv
$(STAGESTUFF
) stage1
90 -mv
$(STAGESTUFF
) stage2
94 -mv
$(STAGESTUFF
) stage3
99 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
102 -(cd stage1
; mv
-f
* ..
)
106 -(cd stage2
; mv
-f
* ..
)
110 -(cd stage3
; mv
-f
* ..
)
114 rm -f gdb.
info* gdbint.
info* stabs.
info*
117 rm -f gdb.
dvi refcard.
dvi gdbint.
dvi stabs.
dvi psref.
dvi
119 mostlyclean: clean-info clean-dvi
120 rm -f gdb.?? gdb.??? gdb.mm gdb.ms gdb.me
122 rm -f refcard.ps lrefcard.ps refcard.log psref.
* *~
123 rm -f gdbint.?? gdbint.??? stabs.?? stabs.???
126 rm -f GDBvn.texi rluser.texinfo inc-hist.texi
129 rm -f Makefile config.status
134 # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
135 refcard.
dvi : $(srcdir)/refcard.
tex
136 $(SET_TEXINPUTS
) $(TEX
) refcard.
tex; rm -f refcard.log
139 # GDB QUICK REFERENCE (PostScript output, common PS fonts)
140 refcard.ps
: $(srcdir)/refcard.
tex $(srcdir)/psrc.sed
141 sed
-f
$(srcdir)/psrc.sed
$(srcdir)/refcard.
tex >psref.
tex
142 $(SET_TEXINPUTS
) $(TEX
) psref.
tex
143 dvips
-t landscape psref
-o
; mv psref.ps refcard.ps
144 rm -f psref.
dvi psref.log psref.
tex
146 # GDB QUICK REFERENCE (PostScript output, common PS fonts w/long names)
147 lrefcard.ps
: $(srcdir)/refcard.
tex $(srcdir)/lpsrc.sed
148 sed
-f
$(srcdir)/lpsrc.sed
$(srcdir)/refcard.
tex >psref.
tex
149 $(SET_TEXINPUTS
) $(TEX
) psref.
tex
150 dvips
-t landscape psref
-o
; mv psref.ps lrefcard.ps
151 rm -f psref.
dvi psref.log psref.
tex
153 # File to record current GDB version number (copied from main dir Makefile.in)
154 GDBvn.texi
: ${gdbdir}/Makefile.in
155 echo
"@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`" > .
/GDBvn.texi
157 # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
158 # If your texinfo or makeinfo don't support these, get a new texinfo release
160 # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
161 # Note that we can *generate* GDBvn.texi, but since we distribute one in the
162 # source directory for the benefit of people who *don't* use this makefile,
163 # VPATH will often tell make not to bother building it, because the one
164 # in the srcdir is up to date. (if not, then make should build one here).
166 # GDB MANUAL: TeX dvi file
167 gdb.
dvi: ${SFILES_DOC}
168 if
[ ! -f .
/GDBvn.texi
]; then \
169 ln
-s
$(srcdir)/GDBvn.texi . || \
170 ln
$(srcdir)/GDBvn.texi . || \
171 cp
$(srcdir)/GDBvn.texi .
; else true
; fi
172 $(SET_TEXINPUTS
) $(TEX
) gdb.texinfo
173 $(SET_TEXINPUTS
) $(TEX
) gdb.texinfo
175 $(SET_TEXINPUTS
) $(TEX
) gdb.texinfo
176 rm -f gdb.?? gdb.log gdb.aux gdb.toc gdb.??s
178 # GDB MANUAL: info file
179 # We're using texinfo2, and older makeinfo's may not be able to
180 # cope with all the markup.
181 gdb.
info: ${SFILES_DOC}
182 $(MAKEINFO
) -I
${READLINE_DIR} -I
$(srcdir) -o .
/gdb.
info gdb.texinfo
184 # GDB MANUAL: roff translations
185 # Try to use a recent texi2roff. v2 was put on prep in jan91.
186 # If you want an index, see texi2roff doc for postprocessing
187 # and add -i to texi2roff invocations below.
188 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
189 # corresponding -e lines when later texi2roff's are current)
190 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
191 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
192 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
193 # + @alphaenumerate is ridiculously new, turned into @enumerate
195 # texi2roff doesn't have a notion of include dirs, so we have to fake
196 # it out for gdb manual's include files---but only if not configured
198 links2roff
: $(SFILES_INCLUDED
)
199 if
[ ! -f gdb-config.texi
]; then \
200 ln
-s
$(SFILES_INCLUDED
) . || \
201 ln
$(SFILES_INCLUDED
) . || \
202 cp
$(SFILES_INCLUDED
) .
; \
206 # "Readline" appendices. Get them also due to lack of includes,
207 # regardless of whether or not configuring in main sourcedir.
208 # @ftable removed due to bug in texi2roff-2; if your texi2roff
209 # is newer, try just ln or cp
210 rluser.texinfo
: ${READLINE_DIR}/rluser.texinfo
211 sed
-e
's/^@ftable/@table/g' \
212 -e
's/^@end ftable/@end table/g' \
213 ${READLINE_DIR}/rluser.texinfo
> .
/rluser.texinfo
215 inc-hist.texi
: ${READLINE_DIR}/inc-hist.texi
216 ln
-s
${READLINE_DIR}/inc-hist.texi . || \
217 ln
${READLINE_DIR}/inc-hist.texi . || \
218 cp
${READLINE_DIR}/inc-hist.texi .
220 # gdb manual suitable for [gtn]roff -me
221 gdb.me
: $(SFILES_LOCAL
) links2roff rluser.texinfo inc-hist.texi
222 sed
-e
'/\\input texinfo/d' \
223 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
224 -e
'/^@ifinfo/,/^@end ifinfo/d' \
228 -e
's/^@alphaenumerate/@enumerate/g' \
229 -e
's/^@end alphaenumerate/@end enumerate/g' \
230 $(srcdir)/gdb.texinfo | \
232 sed
-e
's/---/\\(em/g' \
235 # gdb manual suitable for [gtn]roff -ms
236 gdb.ms
: $(SFILES_LOCAL
) links2roff rluser.texinfo inc-hist.texi
237 sed
-e
'/\\input texinfo/d' \
238 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
239 -e
'/^@ifinfo/,/^@end ifinfo/d' \
243 -e
's/^@alphaenumerate/@enumerate/g' \
244 -e
's/^@end alphaenumerate/@end enumerate/g' \
245 $(srcdir)/gdb.texinfo | \
247 sed
-e
's/---/\\(em/g' \
250 # gdb manual suitable for [tn]roff -mm
251 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
252 # try leaving them in
253 gdb.mm
: $(SFILES_LOCAL
) links2roff rluser.texinfo inc-hist.texi
254 sed
-e
'/\\input texinfo/d' \
255 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
256 -e
'/^@ifinfo/,/^@end ifinfo/d' \
261 -e
's/^@alphaenumerate/@enumerate/g' \
262 -e
's/^@end alphaenumerate/@end enumerate/g' \
263 $(srcdir)/gdb.texinfo | \
265 sed
-e
's/---/\\(em/g' \
268 # GDB INTERNALS MANUAL: TeX dvi file
269 gdbint.
dvi : gdbint.texinfo
270 $(SET_TEXINPUTS
) $(TEX
) gdbint.texinfo
271 $(TEXINDEX
) gdbint.??
272 $(SET_TEXINPUTS
) $(TEX
) gdbint.texinfo
273 rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \
274 gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs
276 # GDB INTERNALS MANUAL: info file
277 gdb-internals
: gdbint.
info
279 gdbint.
info: gdbint.texinfo
280 $(MAKEINFO
) -o gdbint.
info $(srcdir)/gdbint.texinfo
282 stabs.
info: stabs.texinfo
283 $(MAKEINFO
) -o stabs.
info $(srcdir)/stabs.texinfo
285 # STABS DOCUMENTATION: TeX dvi file
286 stabs.
dvi : stabs.texinfo
287 $(SET_TEXINPUTS
) $(TEX
) stabs.texinfo
289 $(SET_TEXINPUTS
) $(TEX
) stabs.texinfo
290 rm -f stabs.?? stabs.aux stabs.cps stabs.fns stabs.kys \
291 stabs.log stabs.pgs stabs.toc stabs.tps stabs.vrs
294 dvips
-o stabs.ps stabs
298 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
299 $(SHELL
) .
/config.status