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