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