Commit | Line | Data |
---|---|---|
787c6bfe | 1 | ##Copyright (C) 1991, 1992 Free Software Foundation, Inc. |
1eb988b9 RP |
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., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | ||
dc341d8b RP |
20 | srcdir = . |
21 | ||
570e1733 RP |
22 | prefix = /usr/local |
23 | ||
787c6bfe | 24 | infodir = $(prefix)/info |
dc341d8b RP |
25 | |
26 | SHELL = /bin/sh | |
27 | ||
570e1733 RP |
28 | INSTALL = install -c |
29 | INSTALL_PROGRAM = $(INSTALL) | |
30 | INSTALL_DATA = $(INSTALL) | |
31 | ||
1eb988b9 | 32 | # main GDB source directory |
18fae2a8 | 33 | gdbdir = $(srcdir)/.. |
1eb988b9 RP |
34 | |
35 | # where to find texinfo; GDB dist should include a recent one | |
18fae2a8 | 36 | TEXIDIR=${gdbdir}/../texinfo |
1eb988b9 RP |
37 | |
38 | # where to find makeinfo, preferably one designed for texinfo-2 | |
39 | MAKEINFO=makeinfo | |
40 | ||
92b73793 RP |
41 | # where to find texi2roff, ditto |
42 | TEXI2ROFF=texi2roff | |
43 | ||
18fae2a8 RP |
44 | # Where is the source dir for the READLINE library doc? |
45 | # Traditionally readline is in .. or . | |
46 | READLINE_DIR = ${gdbdir}/../readline/doc | |
47 | ||
48 | SET_TEXINPUTS = TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$$TEXINPUTS | |
49 | ||
1d7c3357 RP |
50 | DOC_CONFIG = all |
51 | ||
18fae2a8 RP |
52 | # Don Knuth's TeX formatter |
53 | TEX = tex | |
54 | ||
55 | # auxiliary program for sorting Texinfo indices | |
56 | TEXINDEX = texindex | |
1eb988b9 RP |
57 | |
58 | # Main GDB manual's source files | |
c15024ee | 59 | SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/gdbinv-s.texi |
18fae2a8 RP |
60 | |
61 | SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED) | |
1eb988b9 | 62 | |
18fae2a8 RP |
63 | SFILES_DOC = $(SFILES_LOCAL) \ |
64 | $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texi | |
92b73793 | 65 | |
4f98572e RP |
66 | #### Host, target, and site specific Makefile fragments come in here. |
67 | ### | |
68 | ||
e92ee469 RP |
69 | all install: |
70 | ||
612dbd4c | 71 | info: gdb.info gdbint.info stabs.info |
6a962504 | 72 | dvi: gdb.dvi refcard.dvi gdbint.dvi |
1041a570 | 73 | all-doc: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi |
dc341d8b | 74 | |
570e1733 | 75 | install-info: info |
dc341d8b | 76 | for i in *.info* ; do \ |
570e1733 | 77 | $(INSTALL_DATA) $$i $(infodir)/$$i ; \ |
dc341d8b | 78 | done |
1eb988b9 | 79 | |
18fae2a8 | 80 | STAGESTUFF = *.info* gdb-all.texi GDBvn.texi |
332523bf RP |
81 | |
82 | # Copy the object files from a particular stage into a subdirectory. | |
83 | stage1: force | |
84 | -mkdir stage1 | |
85 | -mv $(STAGESTUFF) stage1 | |
86 | ||
87 | stage2: force | |
88 | -mkdir stage2 | |
89 | -mv $(STAGESTUFF) stage2 | |
90 | ||
91 | stage3: force | |
92 | -mkdir stage3 | |
93 | -mv $(STAGESTUFF) stage3 | |
94 | ||
95 | against=stage2 | |
96 | ||
97 | comparison: force | |
98 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
99 | ||
100 | de-stage1: force | |
570e1733 RP |
101 | -(cd stage1 ; mv -f * ..) |
102 | -rmdir stage1 | |
332523bf RP |
103 | |
104 | de-stage2: force | |
570e1733 RP |
105 | -(cd stage2 ; mv -f * ..) |
106 | -rmdir stage2 | |
332523bf RP |
107 | |
108 | de-stage3: force | |
570e1733 RP |
109 | -(cd stage3 ; mv -f * ..) |
110 | -rmdir stage3 | |
332523bf | 111 | |
18fae2a8 RP |
112 | clean-info: |
113 | rm -f gdb.info* gdbint.info* stabs.info* | |
114 | ||
115 | clean-dvi: | |
116 | rm -f gdb.dvi refcard.dvi gdbint.dvi stabs.dvi psref.dvi | |
117 | ||
118 | mostlyclean: clean-info clean-dvi | |
119 | rm -f gdb.?? gdb.??? gdb.mm gdb.ms gdb.me | |
120 | rm -f links2roff | |
121 | rm -f refcard.ps lrefcard.ps refcard.log psref.* *~ | |
122 | rm -f gdbint.?? gdbint.??? stabs.?? stabs.??? | |
123 | ||
124 | clean: mostlyclean | |
125 | rm -f GDBvn.texi rluser.texinfo inc-hist.texi | |
126 | ||
127 | distclean: clean | |
128 | rm -f Makefile config.status | |
129 | ||
b397d5b8 | 130 | realclean: distclean clean-dvi clean-info |
18fae2a8 | 131 | |
1eb988b9 RP |
132 | |
133 | # GDB QUICK REFERENCE (TeX dvi file, CM fonts) | |
cacf5942 | 134 | refcard.dvi : $(srcdir)/refcard.tex |
18fae2a8 | 135 | $(SET_TEXINPUTS) $(TEX) refcard.tex; rm -f refcard.log |
1eb988b9 RP |
136 | rm -f rcfonts.tex |
137 | ||
138 | # GDB QUICK REFERENCE (PostScript output, common PS fonts) | |
228d9e54 | 139 | refcard.ps : $(srcdir)/refcard.tex $(srcdir)/psrc.sed |
0d1cd01e | 140 | sed -f $(srcdir)/psrc.sed $(srcdir)/refcard.tex >psref.tex |
18fae2a8 | 141 | $(SET_TEXINPUTS) $(TEX) psref.tex |
228d9e54 | 142 | dvips -t landscape psref -o; mv psref.ps refcard.ps |
7a694ae8 | 143 | rm -f psref.dvi psref.log psref.tex |
228d9e54 RP |
144 | |
145 | # GDB QUICK REFERENCE (PostScript output, common PS fonts w/long names) | |
146 | lrefcard.ps : $(srcdir)/refcard.tex $(srcdir)/lpsrc.sed | |
0d1cd01e | 147 | sed -f $(srcdir)/lpsrc.sed $(srcdir)/refcard.tex >psref.tex |
18fae2a8 | 148 | $(SET_TEXINPUTS) $(TEX) psref.tex |
228d9e54 | 149 | dvips -t landscape psref -o; mv psref.ps lrefcard.ps |
7a694ae8 | 150 | rm -f psref.dvi psref.log psref.tex |
1eb988b9 | 151 | |
1eb988b9 | 152 | # File to record current GDB version number (copied from main dir Makefile.in) |
18fae2a8 | 153 | GDBvn.texi : ${gdbdir}/Makefile.in |
af08a43a JK |
154 | echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`" > ./GDBvn.new |
155 | mv GDBvn.new GDBvn.texi | |
156 | ||
157 | # Updated atomically | |
158 | .PRECIOUS: GDBvn.texi | |
18fae2a8 | 159 | |
1d7c3357 RP |
160 | # Choose configuration for GDB manual (normally `all'; normally not tied into |
161 | # `configure' script because most users prefer generic version of manual, | |
162 | # not one for their binary config---which may not be specifically | |
163 | # defined anyways). | |
c15024ee JK |
164 | gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi |
165 | ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \ | |
166 | ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \ | |
167 | cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi | |
1d7c3357 | 168 | |
18fae2a8 RP |
169 | # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear |
170 | # If your texinfo or makeinfo don't support these, get a new texinfo release | |
171 | # | |
172 | # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make. | |
173 | # Note that we can *generate* GDBvn.texi, but since we distribute one in the | |
cacf5942 RP |
174 | # source directory for the benefit of people who *don't* use this makefile, |
175 | # VPATH will often tell make not to bother building it, because the one | |
176 | # in the srcdir is up to date. (if not, then make should build one here). | |
787c6bfe | 177 | |
1eb988b9 | 178 | # GDB MANUAL: TeX dvi file |
18fae2a8 RP |
179 | gdb.dvi: ${SFILES_DOC} |
180 | if [ ! -f ./GDBvn.texi ]; then \ | |
181 | ln -s $(srcdir)/GDBvn.texi . || \ | |
182 | ln $(srcdir)/GDBvn.texi . || \ | |
183 | cp $(srcdir)/GDBvn.texi . ; else true; fi | |
184 | $(SET_TEXINPUTS) $(TEX) gdb.texinfo | |
185 | $(SET_TEXINPUTS) $(TEX) gdb.texinfo | |
186 | $(TEXINDEX) gdb.?? | |
187 | $(SET_TEXINPUTS) $(TEX) gdb.texinfo | |
188 | rm -f gdb.?? gdb.log gdb.aux gdb.toc gdb.??s | |
1eb988b9 RP |
189 | |
190 | # GDB MANUAL: info file | |
191 | # We're using texinfo2, and older makeinfo's may not be able to | |
18fae2a8 RP |
192 | # cope with all the markup. |
193 | gdb.info: ${SFILES_DOC} | |
194 | $(MAKEINFO) -I ${READLINE_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo | |
92b73793 RP |
195 | |
196 | # GDB MANUAL: roff translations | |
197 | # Try to use a recent texi2roff. v2 was put on prep in jan91. | |
198 | # If you want an index, see texi2roff doc for postprocessing | |
199 | # and add -i to texi2roff invocations below. | |
200 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
cacf5942 | 201 | # corresponding -e lines when later texi2roff's are current) |
92b73793 RP |
202 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. |
203 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
204 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
205 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
206 | ||
18fae2a8 RP |
207 | # texi2roff doesn't have a notion of include dirs, so we have to fake |
208 | # it out for gdb manual's include files---but only if not configured | |
209 | # in main sourcedir. | |
210 | links2roff: $(SFILES_INCLUDED) | |
1d7c3357 | 211 | if [ ! -f gdb.texinfo ]; then \ |
18fae2a8 RP |
212 | ln -s $(SFILES_INCLUDED) . || \ |
213 | ln $(SFILES_INCLUDED) . || \ | |
214 | cp $(SFILES_INCLUDED) . ; \ | |
215 | fi | |
216 | touch links2roff | |
217 | ||
218 | # "Readline" appendices. Get them also due to lack of includes, | |
219 | # regardless of whether or not configuring in main sourcedir. | |
220 | # @ftable removed due to bug in texi2roff-2; if your texi2roff | |
221 | # is newer, try just ln or cp | |
222 | rluser.texinfo: ${READLINE_DIR}/rluser.texinfo | |
223 | sed -e 's/^@ftable/@table/g' \ | |
5f92dab8 | 224 | -e 's/^@end ftable/@end table/g' \ |
18fae2a8 RP |
225 | ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo |
226 | ||
227 | inc-hist.texi: ${READLINE_DIR}/inc-hist.texi | |
228 | ln -s ${READLINE_DIR}/inc-hist.texi . || \ | |
229 | ln ${READLINE_DIR}/inc-hist.texi . || \ | |
230 | cp ${READLINE_DIR}/inc-hist.texi . | |
231 | ||
232 | # gdb manual suitable for [gtn]roff -me | |
233 | gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi | |
92b73793 RP |
234 | sed -e '/\\input texinfo/d' \ |
235 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
236 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
50a39795 | 237 | -e '/^@c /d' \ |
92b73793 | 238 | -e 's/{.*,,/{/' \ |
92b73793 RP |
239 | -e 's/@ / /g' \ |
240 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
241 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
18fae2a8 RP |
242 | $(srcdir)/gdb.texinfo | \ |
243 | $(TEXI2ROFF) -me | \ | |
92b73793 | 244 | sed -e 's/---/\\(em/g' \ |
18fae2a8 | 245 | >gdb.me |
92b73793 | 246 | |
18fae2a8 RP |
247 | # gdb manual suitable for [gtn]roff -ms |
248 | gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi | |
92b73793 RP |
249 | sed -e '/\\input texinfo/d' \ |
250 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
251 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
50a39795 | 252 | -e '/^@c /d' \ |
92b73793 RP |
253 | -e 's/{.*,,/{/' \ |
254 | -e 's/@ / /g' \ | |
255 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
256 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
18fae2a8 RP |
257 | $(srcdir)/gdb.texinfo | \ |
258 | $(TEXI2ROFF) -ms | \ | |
92b73793 | 259 | sed -e 's/---/\\(em/g' \ |
18fae2a8 | 260 | >gdb.ms |
92b73793 | 261 | |
18fae2a8 RP |
262 | # gdb manual suitable for [tn]roff -mm |
263 | # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, | |
264 | # try leaving them in | |
265 | gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi | |
92b73793 RP |
266 | sed -e '/\\input texinfo/d' \ |
267 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
268 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
50a39795 | 269 | -e '/^@c /d' \ |
92b73793 | 270 | -e 's/{.*,,/{/' \ |
18fae2a8 | 271 | -e '/@noindent/d' \ |
92b73793 RP |
272 | -e 's/@ / /g' \ |
273 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
274 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
18fae2a8 RP |
275 | $(srcdir)/gdb.texinfo | \ |
276 | $(TEXI2ROFF) -mm | \ | |
92b73793 | 277 | sed -e 's/---/\\(em/g' \ |
18fae2a8 | 278 | >gdb.mm |
1eb988b9 RP |
279 | |
280 | # GDB INTERNALS MANUAL: TeX dvi file | |
281 | gdbint.dvi : gdbint.texinfo | |
18fae2a8 RP |
282 | $(SET_TEXINPUTS) $(TEX) gdbint.texinfo |
283 | $(TEXINDEX) gdbint.?? | |
284 | $(SET_TEXINPUTS) $(TEX) gdbint.texinfo | |
1eb988b9 RP |
285 | rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \ |
286 | gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs | |
287 | ||
288 | # GDB INTERNALS MANUAL: info file | |
dc341d8b | 289 | gdb-internals: gdbint.info |
1eb988b9 | 290 | |
dc341d8b RP |
291 | gdbint.info: gdbint.texinfo |
292 | $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo | |
1eb988b9 | 293 | |
e505224d PB |
294 | stabs.info: stabs.texinfo |
295 | $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo | |
296 | ||
612dbd4c JG |
297 | # STABS DOCUMENTATION: TeX dvi file |
298 | stabs.dvi : stabs.texinfo | |
18fae2a8 RP |
299 | $(SET_TEXINPUTS) $(TEX) stabs.texinfo |
300 | $(TEXINDEX) stabs.?? | |
301 | $(SET_TEXINPUTS) $(TEX) stabs.texinfo | |
612dbd4c JG |
302 | rm -f stabs.?? stabs.aux stabs.cps stabs.fns stabs.kys \ |
303 | stabs.log stabs.pgs stabs.toc stabs.tps stabs.vrs | |
304 | ||
305 | stabs.ps: stabs.dvi | |
306 | dvips -o stabs.ps stabs | |
307 | ||
dc341d8b | 308 | force: |
1eb988b9 | 309 | |
dc341d8b RP |
310 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
311 | $(SHELL) ./config.status |