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 | ||
50 | # Don Knuth's TeX formatter | |
51 | TEX = tex | |
52 | ||
53 | # auxiliary program for sorting Texinfo indices | |
54 | TEXINDEX = texindex | |
1eb988b9 RP |
55 | |
56 | # Main GDB manual's source files | |
18fae2a8 RP |
57 | SFILES_INCLUDED = $(srcdir)/gdb-config.texi $(srcdir)/gdbinv-s.texi |
58 | ||
59 | SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED) | |
1eb988b9 | 60 | |
18fae2a8 RP |
61 | SFILES_DOC = $(SFILES_LOCAL) \ |
62 | $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texi | |
92b73793 | 63 | |
4f98572e RP |
64 | #### Host, target, and site specific Makefile fragments come in here. |
65 | ### | |
66 | ||
e92ee469 RP |
67 | all install: |
68 | ||
612dbd4c | 69 | info: gdb.info gdbint.info stabs.info |
1041a570 | 70 | all-doc: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi |
dc341d8b | 71 | |
570e1733 | 72 | install-info: info |
c973953a ILT |
73 | -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \ |
74 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi | |
75 | -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi | |
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 | ||
130 | realclean: distclean | |
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 RP |
153 | GDBvn.texi : ${gdbdir}/Makefile.in |
154 | echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`" > ./GDBvn.texi | |
155 | ||
156 | # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear | |
157 | # If your texinfo or makeinfo don't support these, get a new texinfo release | |
158 | # | |
159 | # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make. | |
160 | # Note that we can *generate* GDBvn.texi, but since we distribute one in the | |
cacf5942 RP |
161 | # source directory for the benefit of people who *don't* use this makefile, |
162 | # VPATH will often tell make not to bother building it, because the one | |
163 | # in the srcdir is up to date. (if not, then make should build one here). | |
787c6bfe | 164 | |
1eb988b9 | 165 | # GDB MANUAL: TeX dvi file |
18fae2a8 RP |
166 | gdb.dvi: ${SFILES_DOC} |
167 | if [ ! -f ./GDBvn.texi ]; then \ | |
168 | ln -s $(srcdir)/GDBvn.texi . || \ | |
169 | ln $(srcdir)/GDBvn.texi . || \ | |
170 | cp $(srcdir)/GDBvn.texi . ; else true; fi | |
171 | $(SET_TEXINPUTS) $(TEX) gdb.texinfo | |
172 | $(SET_TEXINPUTS) $(TEX) gdb.texinfo | |
173 | $(TEXINDEX) gdb.?? | |
174 | $(SET_TEXINPUTS) $(TEX) gdb.texinfo | |
175 | rm -f gdb.?? gdb.log gdb.aux gdb.toc gdb.??s | |
1eb988b9 RP |
176 | |
177 | # GDB MANUAL: info file | |
178 | # We're using texinfo2, and older makeinfo's may not be able to | |
18fae2a8 RP |
179 | # cope with all the markup. |
180 | gdb.info: ${SFILES_DOC} | |
181 | $(MAKEINFO) -I ${READLINE_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo | |
92b73793 RP |
182 | |
183 | # GDB MANUAL: roff translations | |
184 | # Try to use a recent texi2roff. v2 was put on prep in jan91. | |
185 | # If you want an index, see texi2roff doc for postprocessing | |
186 | # and add -i to texi2roff invocations below. | |
187 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
cacf5942 | 188 | # corresponding -e lines when later texi2roff's are current) |
92b73793 RP |
189 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. |
190 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
191 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
192 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
193 | ||
18fae2a8 RP |
194 | # texi2roff doesn't have a notion of include dirs, so we have to fake |
195 | # it out for gdb manual's include files---but only if not configured | |
196 | # in main sourcedir. | |
197 | links2roff: $(SFILES_INCLUDED) | |
198 | if [ ! -f gdb-config.texi ]; then \ | |
199 | ln -s $(SFILES_INCLUDED) . || \ | |
200 | ln $(SFILES_INCLUDED) . || \ | |
201 | cp $(SFILES_INCLUDED) . ; \ | |
202 | fi | |
203 | touch links2roff | |
204 | ||
205 | # "Readline" appendices. Get them also due to lack of includes, | |
206 | # regardless of whether or not configuring in main sourcedir. | |
207 | # @ftable removed due to bug in texi2roff-2; if your texi2roff | |
208 | # is newer, try just ln or cp | |
209 | rluser.texinfo: ${READLINE_DIR}/rluser.texinfo | |
210 | sed -e 's/^@ftable/@table/g' \ | |
5f92dab8 | 211 | -e 's/^@end ftable/@end table/g' \ |
18fae2a8 RP |
212 | ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo |
213 | ||
214 | inc-hist.texi: ${READLINE_DIR}/inc-hist.texi | |
215 | ln -s ${READLINE_DIR}/inc-hist.texi . || \ | |
216 | ln ${READLINE_DIR}/inc-hist.texi . || \ | |
217 | cp ${READLINE_DIR}/inc-hist.texi . | |
218 | ||
219 | # gdb manual suitable for [gtn]roff -me | |
220 | gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi | |
92b73793 RP |
221 | sed -e '/\\input texinfo/d' \ |
222 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
223 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
50a39795 | 224 | -e '/^@c /d' \ |
92b73793 | 225 | -e 's/{.*,,/{/' \ |
92b73793 RP |
226 | -e 's/@ / /g' \ |
227 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
228 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
18fae2a8 RP |
229 | $(srcdir)/gdb.texinfo | \ |
230 | $(TEXI2ROFF) -me | \ | |
92b73793 | 231 | sed -e 's/---/\\(em/g' \ |
18fae2a8 | 232 | >gdb.me |
92b73793 | 233 | |
18fae2a8 RP |
234 | # gdb manual suitable for [gtn]roff -ms |
235 | gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi | |
92b73793 RP |
236 | sed -e '/\\input texinfo/d' \ |
237 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
238 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
50a39795 | 239 | -e '/^@c /d' \ |
92b73793 RP |
240 | -e 's/{.*,,/{/' \ |
241 | -e 's/@ / /g' \ | |
242 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
243 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
18fae2a8 RP |
244 | $(srcdir)/gdb.texinfo | \ |
245 | $(TEXI2ROFF) -ms | \ | |
92b73793 | 246 | sed -e 's/---/\\(em/g' \ |
18fae2a8 | 247 | >gdb.ms |
92b73793 | 248 | |
18fae2a8 RP |
249 | # gdb manual suitable for [tn]roff -mm |
250 | # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, | |
251 | # try leaving them in | |
252 | gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi | |
92b73793 RP |
253 | sed -e '/\\input texinfo/d' \ |
254 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
255 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
50a39795 | 256 | -e '/^@c /d' \ |
92b73793 | 257 | -e 's/{.*,,/{/' \ |
18fae2a8 | 258 | -e '/@noindent/d' \ |
92b73793 RP |
259 | -e 's/@ / /g' \ |
260 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
261 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
18fae2a8 RP |
262 | $(srcdir)/gdb.texinfo | \ |
263 | $(TEXI2ROFF) -mm | \ | |
92b73793 | 264 | sed -e 's/---/\\(em/g' \ |
18fae2a8 | 265 | >gdb.mm |
1eb988b9 RP |
266 | |
267 | # GDB INTERNALS MANUAL: TeX dvi file | |
268 | gdbint.dvi : gdbint.texinfo | |
18fae2a8 RP |
269 | $(SET_TEXINPUTS) $(TEX) gdbint.texinfo |
270 | $(TEXINDEX) gdbint.?? | |
271 | $(SET_TEXINPUTS) $(TEX) gdbint.texinfo | |
1eb988b9 RP |
272 | rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \ |
273 | gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs | |
274 | ||
275 | # GDB INTERNALS MANUAL: info file | |
dc341d8b | 276 | gdb-internals: gdbint.info |
1eb988b9 | 277 | |
dc341d8b RP |
278 | gdbint.info: gdbint.texinfo |
279 | $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo | |
1eb988b9 | 280 | |
e505224d PB |
281 | stabs.info: stabs.texinfo |
282 | $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo | |
283 | ||
612dbd4c JG |
284 | # STABS DOCUMENTATION: TeX dvi file |
285 | stabs.dvi : stabs.texinfo | |
18fae2a8 RP |
286 | $(SET_TEXINPUTS) $(TEX) stabs.texinfo |
287 | $(TEXINDEX) stabs.?? | |
288 | $(SET_TEXINPUTS) $(TEX) stabs.texinfo | |
612dbd4c JG |
289 | rm -f stabs.?? stabs.aux stabs.cps stabs.fns stabs.kys \ |
290 | stabs.log stabs.pgs stabs.toc stabs.tps stabs.vrs | |
291 | ||
292 | stabs.ps: stabs.dvi | |
293 | dvips -o stabs.ps stabs | |
294 | ||
dc341d8b | 295 | force: |
1eb988b9 | 296 | |
dc341d8b RP |
297 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
298 | $(SHELL) ./config.status |