Commit | Line | Data |
---|---|---|
1eb988b9 RP |
1 | ##Copyright (C) 1991 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., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | ||
dc341d8b RP |
20 | srcdir = . |
21 | ||
22 | ddestdir = /usr/local | |
23 | idestdir = $(ddestdir) | |
24 | ||
25 | SHELL = /bin/sh | |
26 | ||
1eb988b9 | 27 | # main GDB source directory |
dc341d8b | 28 | gdbdir = .. |
1eb988b9 RP |
29 | |
30 | # Documentation (gdb.dvi) needs either GNU m4 or SysV m4; | |
31 | # Berkeley/Sun don't have quite enough. | |
32 | #M4=/usr/5bin/m4 | |
33 | M4=gm4 | |
34 | ||
35 | # where to find texinfo; GDB dist should include a recent one | |
e92ee469 | 36 | TEXIDIR=$(srcdir)/${gdbdir}/../texinfo/fsf |
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 | ||
1eb988b9 RP |
44 | # Where is the source dir for the READLINE library? Traditionally in .. or . |
45 | # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.) | |
e92ee469 | 46 | READLINE_DIR = $(srcdir)/${gdbdir}/../readline |
1eb988b9 RP |
47 | |
48 | # Main GDB manual's source files | |
49 | SFILES_DOCDIR = \ | |
e92ee469 | 50 | $(srcdir)/gdb.texinfo $(srcdir)/pretex.m4 $(srcdir)/none.m4 \ |
919de9a1 | 51 | $(srcdir)/all.m4 gdbinv-m.m4 gdbinv-s.m4 gdbVN.m4 |
1eb988b9 | 52 | |
92b73793 RP |
53 | # Which version of GDB manual? default includes everything |
54 | CONFIG=all | |
55 | ||
e92ee469 RP |
56 | all install: |
57 | ||
58 | all-info: gdb.info gdbint.info | |
dc341d8b RP |
59 | #all: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi |
60 | ||
e92ee469 | 61 | install-info: all-info |
dc341d8b RP |
62 | for i in *.info* ; do \ |
63 | echo Installing $$i... ; \ | |
b98412e3 SC |
64 | (cp $$i $(idestdir)/info/$$i.n \ |
65 | && mv -f $(idestdir)/info/$$i.n $(idestdir)/info/$$i) \ | |
dc341d8b RP |
66 | || exit 1 ; \ |
67 | done | |
1eb988b9 | 68 | |
332523bf RP |
69 | STAGESTUFF = *.info* gdb-all.texi gdbVN.m4 |
70 | ||
71 | # Copy the object files from a particular stage into a subdirectory. | |
72 | stage1: force | |
73 | -mkdir stage1 | |
74 | -mv $(STAGESTUFF) stage1 | |
75 | ||
76 | stage2: force | |
77 | -mkdir stage2 | |
78 | -mv $(STAGESTUFF) stage2 | |
79 | ||
80 | stage3: force | |
81 | -mkdir stage3 | |
82 | -mv $(STAGESTUFF) stage3 | |
83 | ||
84 | against=stage2 | |
85 | ||
86 | comparison: force | |
87 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
88 | ||
89 | de-stage1: force | |
90 | - (cd stage1 ; mv -f * ..) | |
91 | - rmdir stage1 | |
92 | ||
93 | de-stage2: force | |
94 | - (cd stage2 ; mv -f * ..) | |
95 | - rmdir stage2 | |
96 | ||
97 | de-stage3: force | |
98 | - (cd stage3 ; mv -f * ..) | |
99 | - rmdir stage3 | |
100 | ||
1eb988b9 RP |
101 | clean: |
102 | rm -f gdb.dvi rdl-apps.texi gdb-all* gdb.info* gdbVN.m4 | |
dc341d8b | 103 | rm -f gdb-internals gdbint.?? gdbint.??? gdbint.info |
1eb988b9 RP |
104 | rm -f refcard.ps refcard.dvi rcfonts.tex refcard.log *~ |
105 | ||
106 | # GDB QUICK REFERENCE (TeX dvi file, CM fonts) | |
107 | refcard.dvi : refcard.tex | |
108 | rm -f rcfonts.tex; cp rc-cm.tex rcfonts.tex | |
109 | TEXINPUTS=.:$$TEXINPUTS tex refcard.tex; rm -f refcard.log | |
110 | rm -f rcfonts.tex | |
111 | ||
112 | # GDB QUICK REFERENCE (PostScript output, common PS fonts) | |
113 | refcard.ps : refcard.tex | |
114 | rm -f rcfonts.tex; cp rc-ps.tex rcfonts.tex | |
115 | TEXINPUTS=.:$$TEXINPUTS tex refcard.tex | |
116 | dvips -t landscape refcard -o; rm -f refcard.dvi refcard.log | |
117 | rm -f rcfonts.tex | |
118 | ||
119 | # Cover file for "Readline" appendices | |
e9d98c95 SG |
120 | rdl-apps.texi: ${READLINE_DIR}/doc/rluser.texinfo \ |
121 | ${READLINE_DIR}/doc/hsuser.texinfo | |
1eb988b9 | 122 | rm -f rdl-apps.texi |
e9d98c95 SG |
123 | echo "@include ${READLINE_DIR}/doc/rluser.texinfo" >rdl-apps.texi |
124 | echo "@include ${READLINE_DIR}/doc/hsuser.texinfo" >>rdl-apps.texi | |
1eb988b9 RP |
125 | |
126 | # File to record current GDB version number (copied from main dir Makefile.in) | |
dc341d8b | 127 | gdbVN.m4 : ${gdbdir}/Makefile.in |
e92ee469 | 128 | ( VER=`sed <$(srcdir)/${gdbdir}/Makefile.in -n 's/VERSION = //p'` ;\ |
1eb988b9 RP |
129 | echo "_define__(<_GDB_VN__>,$$VER)" > gdbVN.m4 ) |
130 | ||
131 | # GDB MANUAL: texinfo source, created by preprocessing w/m4 | |
92b73793 RP |
132 | # If you want other configs in the makefile, add or modify instructions for |
133 | # building source here, then change CONFIG (that way you get info, dvi, | |
134 | # roff targets automatically for your config). | |
1eb988b9 RP |
135 | # Be sure to not create a bad gdb-all.texi if ${M4} is missing or aborts... |
136 | gdb-all.texi: ${SFILES_DOCDIR} | |
137 | rm -f foobus.texinfo | |
919de9a1 | 138 | ${M4} $(srcdir)/pretex.m4 $(srcdir)/none.m4 $(srcdir)/all.m4 $(srcdir)/gdb.texinfo >foobus.texinfo |
1eb988b9 RP |
139 | rm -f gdb-all.texi |
140 | mv foobus.texinfo gdb-all.texi | |
141 | ||
142 | # GDB MANUAL: TeX dvi file | |
92b73793 RP |
143 | gdb.dvi : gdb-${CONFIG}.texi rdl-apps.texi |
144 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-${CONFIG}.texi | |
145 | texindex gdb-${CONFIG}.?? | |
146 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-${CONFIG}.texi | |
147 | mv gdb-${CONFIG}.dvi gdb.dvi | |
148 | rm -f gdb-${CONFIG}.?? gdb-${CONFIG}.??? | |
1eb988b9 RP |
149 | |
150 | # GDB MANUAL: info file | |
151 | # We're using texinfo2, and older makeinfo's may not be able to | |
152 | # cope with all the markup. In the meantime, we distribute the info | |
153 | # files | |
92b73793 RP |
154 | gdb.info: gdb-${CONFIG}.texi |
155 | $(MAKEINFO) -o gdb.info gdb-${CONFIG}.texi | |
156 | ||
157 | # GDB MANUAL: roff translations | |
158 | # Try to use a recent texi2roff. v2 was put on prep in jan91. | |
159 | # If you want an index, see texi2roff doc for postprocessing | |
160 | # and add -i to texi2roff invocations below. | |
161 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
162 | # correspondint -e lines when later texi2roff's are current) | |
163 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. | |
164 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
165 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
166 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
167 | ||
168 | ||
169 | # gdb manual suitable for [tn]roff -mm | |
170 | # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, | |
171 | # try leaving them in | |
172 | gdb.mm: gdb-${CONFIG}.texi | |
173 | sed -e '/\\input texinfo/d' \ | |
174 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
175 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
176 | -e '/^@c/d' \ | |
177 | -e 's/{.*,,/{/' \ | |
178 | -e '/@noindent/d' \ | |
179 | -e 's/@ / /g' \ | |
180 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
181 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
182 | gdb-${CONFIG}.texi | \ | |
183 | $(TEXI2ROFF) -mm | \ | |
184 | sed -e 's/---/\\(em/g' \ | |
185 | >gdb.mm | |
186 | ||
187 | # gdb manual suitable for [gtn]roff -me | |
188 | gdb.me: gdb-${CONFIG}.texi | |
189 | sed -e '/\\input texinfo/d' \ | |
190 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
191 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
192 | -e '/^@c/d' \ | |
193 | -e 's/{.*,,/{/' \ | |
194 | -e 's/@ / /g' \ | |
195 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
196 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
197 | gdb-${CONFIG}.texi | \ | |
198 | $(TEXI2ROFF) -me | \ | |
199 | sed -e 's/---/\\(em/g' \ | |
200 | >gdb.me | |
201 | ||
202 | # gdb manual suitable for [gtn]roff -ms | |
203 | gdb.ms: gdb-${CONFIG}.texi | |
204 | sed -e '/\\input texinfo/d' \ | |
205 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
206 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
207 | -e '/^@c/d' \ | |
208 | -e 's/{.*,,/{/' \ | |
209 | -e 's/@ / /g' \ | |
210 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
211 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
212 | gdb-${CONFIG}.texi | \ | |
213 | $(TEXI2ROFF) -ms | \ | |
214 | sed -e 's/---/\\(em/g' \ | |
215 | >gdb.ms | |
1eb988b9 RP |
216 | |
217 | # GDB INTERNALS MANUAL: TeX dvi file | |
218 | gdbint.dvi : gdbint.texinfo | |
219 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo | |
220 | texindex gdbint.?? | |
221 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo | |
222 | rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \ | |
223 | gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs | |
224 | ||
225 | # GDB INTERNALS MANUAL: info file | |
dc341d8b | 226 | gdb-internals: gdbint.info |
1eb988b9 | 227 | |
dc341d8b RP |
228 | gdbint.info: gdbint.texinfo |
229 | $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo | |
1eb988b9 | 230 | |
dc341d8b | 231 | force: |
1eb988b9 | 232 | |
dc341d8b RP |
233 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
234 | $(SHELL) ./config.status |