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 | ||
570e1733 RP |
22 | prefix = /usr/local |
23 | ||
24 | bindir = $(prefix)/bin | |
25 | datadir = $(prefix)/lib | |
26 | libdir = $(prefix)/lib | |
27 | mandir = $(datadir)/man | |
28 | man1dir = $(mandir)/man1 | |
29 | man2dir = $(mandir)/man2 | |
30 | man3dir = $(mandir)/man3 | |
31 | man4dir = $(mandir)/man4 | |
32 | man5dir = $(mandir)/man5 | |
33 | man6dir = $(mandir)/man6 | |
34 | man7dir = $(mandir)/man7 | |
35 | man8dir = $(mandir)/man8 | |
36 | man9dir = $(mandir)/man9 | |
37 | infodir = $(prefix)/info | |
38 | includedir = $(prefix)/include | |
39 | docdir = $(datadir)/doc | |
dc341d8b RP |
40 | |
41 | SHELL = /bin/sh | |
42 | ||
570e1733 RP |
43 | INSTALL = install -c |
44 | INSTALL_PROGRAM = $(INSTALL) | |
45 | INSTALL_DATA = $(INSTALL) | |
46 | ||
47 | AR = ar | |
48 | AR_FLAGS = qv | |
49 | BISON = bison | |
50 | RANLIB = ranlib | |
51 | ||
52 | #### Host, target, and site specific Makefile fragments come in here. | |
53 | ### | |
1eb988b9 | 54 | # main GDB source directory |
dc341d8b | 55 | gdbdir = .. |
1eb988b9 RP |
56 | |
57 | # Documentation (gdb.dvi) needs either GNU m4 or SysV m4; | |
58 | # Berkeley/Sun don't have quite enough. | |
59 | #M4=/usr/5bin/m4 | |
60 | M4=gm4 | |
61 | ||
62 | # where to find texinfo; GDB dist should include a recent one | |
e92ee469 | 63 | TEXIDIR=$(srcdir)/${gdbdir}/../texinfo/fsf |
1eb988b9 RP |
64 | |
65 | # where to find makeinfo, preferably one designed for texinfo-2 | |
66 | MAKEINFO=makeinfo | |
67 | ||
92b73793 RP |
68 | # where to find texi2roff, ditto |
69 | TEXI2ROFF=texi2roff | |
70 | ||
1eb988b9 RP |
71 | # Where is the source dir for the READLINE library? Traditionally in .. or . |
72 | # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.) | |
e92ee469 | 73 | READLINE_DIR = $(srcdir)/${gdbdir}/../readline |
1eb988b9 RP |
74 | |
75 | # Main GDB manual's source files | |
76 | SFILES_DOCDIR = \ | |
e92ee469 | 77 | $(srcdir)/gdb.texinfo $(srcdir)/pretex.m4 $(srcdir)/none.m4 \ |
919de9a1 | 78 | $(srcdir)/all.m4 gdbinv-m.m4 gdbinv-s.m4 gdbVN.m4 |
1eb988b9 | 79 | |
92b73793 RP |
80 | # Which version of GDB manual? default includes everything |
81 | CONFIG=all | |
82 | ||
e92ee469 RP |
83 | all install: |
84 | ||
570e1733 | 85 | info: gdb.info gdbint.info |
dc341d8b | 86 | #all: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi |
570e1733 RP |
87 | clean-info: |
88 | -rm -f *.info* | |
dc341d8b | 89 | |
570e1733 | 90 | install-info: info |
dc341d8b | 91 | for i in *.info* ; do \ |
570e1733 | 92 | $(INSTALL_DATA) $$i $(infodir)/$$i ; \ |
dc341d8b | 93 | done |
1eb988b9 | 94 | |
332523bf RP |
95 | STAGESTUFF = *.info* gdb-all.texi gdbVN.m4 |
96 | ||
97 | # Copy the object files from a particular stage into a subdirectory. | |
98 | stage1: force | |
99 | -mkdir stage1 | |
100 | -mv $(STAGESTUFF) stage1 | |
101 | ||
102 | stage2: force | |
103 | -mkdir stage2 | |
104 | -mv $(STAGESTUFF) stage2 | |
105 | ||
106 | stage3: force | |
107 | -mkdir stage3 | |
108 | -mv $(STAGESTUFF) stage3 | |
109 | ||
110 | against=stage2 | |
111 | ||
112 | comparison: force | |
113 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
114 | ||
115 | de-stage1: force | |
570e1733 RP |
116 | -(cd stage1 ; mv -f * ..) |
117 | -rmdir stage1 | |
332523bf RP |
118 | |
119 | de-stage2: force | |
570e1733 RP |
120 | -(cd stage2 ; mv -f * ..) |
121 | -rmdir stage2 | |
332523bf RP |
122 | |
123 | de-stage3: force | |
570e1733 RP |
124 | -(cd stage3 ; mv -f * ..) |
125 | -rmdir stage3 | |
332523bf | 126 | |
1eb988b9 | 127 | clean: |
cacf5942 | 128 | rm -f gdb.dvi rluser.texinfo inc-hist.texi gdb-all* gdb.info* gdbVN.m4 |
dc341d8b | 129 | rm -f gdb-internals gdbint.?? gdbint.??? gdbint.info |
1eb988b9 RP |
130 | rm -f refcard.ps refcard.dvi rcfonts.tex refcard.log *~ |
131 | ||
132 | # GDB QUICK REFERENCE (TeX dvi file, CM fonts) | |
cacf5942 RP |
133 | refcard.dvi : $(srcdir)/refcard.tex |
134 | rm -f rcfonts.tex; cp $(srcdir)/rc-cm.tex rcfonts.tex | |
135 | TEXINPUTS=$(srcdir):.:$$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) | |
cacf5942 RP |
139 | refcard.ps : $(srcdir)/refcard.tex |
140 | rm -f rcfonts.tex; cp $(srcdir)/rc-ps.tex rcfonts.tex | |
141 | TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex refcard.tex | |
1eb988b9 RP |
142 | dvips -t landscape refcard -o; rm -f refcard.dvi refcard.log |
143 | rm -f rcfonts.tex | |
144 | ||
cacf5942 RP |
145 | # "Readline" appendices. Get them here so both TeX and texi2roff can find. |
146 | rluser.texinfo: ${READLINE_DIR}/doc/rluser.texinfo | |
147 | ln -s ${READLINE_DIR}/doc/rluser.texinfo $(unsubdir) || \ | |
148 | ln ${READLINE_DIR}/doc/rluser.texinfo $(unsubdir) || \ | |
149 | cp ${READLINE_DIR}/doc/rluser.texinfo $(unsubdir) | |
150 | ||
151 | inc-hist.texi: ${READLINE_DIR}/doc/inc-hist.texi | |
152 | ln -s ${READLINE_DIR}/doc/inc-hist.texi $(unsubdir) || \ | |
153 | ln ${READLINE_DIR}/doc/inc-hist.texi $(unsubdir) || \ | |
154 | cp ${READLINE_DIR}/doc/inc-hist.texi $(unsubdir) | |
1eb988b9 RP |
155 | |
156 | # File to record current GDB version number (copied from main dir Makefile.in) | |
cacf5942 RP |
157 | gdbVN.m4 : $(srcdir)/${gdbdir}/Makefile.in |
158 | VER=`sed <$(srcdir)/${gdbdir}/Makefile.in -n 's/VERSION = //p'` echo "_define__(<_GDB_VN__>,$$VER)" > $(unsubdir)/gdbVN.m4 | |
1eb988b9 RP |
159 | |
160 | # GDB MANUAL: texinfo source, created by preprocessing w/m4 | |
92b73793 RP |
161 | # If you want other configs in the makefile, add or modify instructions for |
162 | # building source here, then change CONFIG (that way you get info, dvi, | |
163 | # roff targets automatically for your config). | |
1eb988b9 | 164 | # Be sure to not create a bad gdb-all.texi if ${M4} is missing or aborts... |
cacf5942 RP |
165 | # The nonsense with gdbVN.m4 is to get this to run with both Sun and GNU make. |
166 | # Note that we can *generate* gdbVN.m4, but since we distribute one in the | |
167 | # source directory for the benefit of people who *don't* use this makefile, | |
168 | # VPATH will often tell make not to bother building it, because the one | |
169 | # in the srcdir is up to date. (if not, then make should build one here). | |
1eb988b9 | 170 | gdb-all.texi: ${SFILES_DOCDIR} |
cacf5942 RP |
171 | if [ ! -f ./gdbVN.m4 ]; then \ |
172 | ln -s $(srcdir)/gdbVN.m4 . || \ | |
173 | ln $(srcdir)/gdbVN.m4 . || \ | |
174 | cp $(srcdir)/gdbVN.m4 . ; fi | |
1eb988b9 | 175 | rm -f foobus.texinfo |
cacf5942 RP |
176 | ${M4} $(srcdir)/pretex.m4 $(srcdir)/none.m4 $(srcdir)/all.m4 \ |
177 | gdbVN.m4 $(srcdir)/gdb.texinfo >foobus.texinfo | |
1eb988b9 | 178 | rm -f gdb-all.texi |
cacf5942 | 179 | mv foobus.texinfo $(unsubdir)/gdb-all.texi |
1eb988b9 RP |
180 | |
181 | # GDB MANUAL: TeX dvi file | |
cacf5942 RP |
182 | gdb.dvi : gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi |
183 | TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi | |
92b73793 | 184 | texindex gdb-${CONFIG}.?? |
cacf5942 RP |
185 | TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi |
186 | mv gdb-${CONFIG}.dvi $(unsubdir)/gdb.dvi | |
92b73793 | 187 | rm -f gdb-${CONFIG}.?? gdb-${CONFIG}.??? |
1eb988b9 RP |
188 | |
189 | # GDB MANUAL: info file | |
190 | # We're using texinfo2, and older makeinfo's may not be able to | |
191 | # cope with all the markup. In the meantime, we distribute the info | |
192 | # files | |
92b73793 | 193 | gdb.info: gdb-${CONFIG}.texi |
cacf5942 | 194 | $(MAKEINFO) -o $(unsubdir)/gdb.info gdb-${CONFIG}.texi |
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 | ||
207 | ||
208 | # gdb manual suitable for [tn]roff -mm | |
209 | # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, | |
210 | # try leaving them in | |
cacf5942 | 211 | gdb.mm: gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi |
92b73793 RP |
212 | sed -e '/\\input texinfo/d' \ |
213 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
214 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
215 | -e '/^@c/d' \ | |
216 | -e 's/{.*,,/{/' \ | |
217 | -e '/@noindent/d' \ | |
218 | -e 's/@ / /g' \ | |
219 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
220 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
221 | gdb-${CONFIG}.texi | \ | |
222 | $(TEXI2ROFF) -mm | \ | |
223 | sed -e 's/---/\\(em/g' \ | |
224 | >gdb.mm | |
225 | ||
226 | # gdb manual suitable for [gtn]roff -me | |
cacf5942 | 227 | gdb.me: gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi |
92b73793 RP |
228 | sed -e '/\\input texinfo/d' \ |
229 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
230 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
231 | -e '/^@c/d' \ | |
232 | -e 's/{.*,,/{/' \ | |
233 | -e 's/@ / /g' \ | |
234 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
235 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
236 | gdb-${CONFIG}.texi | \ | |
237 | $(TEXI2ROFF) -me | \ | |
238 | sed -e 's/---/\\(em/g' \ | |
239 | >gdb.me | |
240 | ||
241 | # gdb manual suitable for [gtn]roff -ms | |
cacf5942 | 242 | gdb.ms: gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi |
92b73793 RP |
243 | sed -e '/\\input texinfo/d' \ |
244 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
245 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
246 | -e '/^@c/d' \ | |
247 | -e 's/{.*,,/{/' \ | |
248 | -e 's/@ / /g' \ | |
249 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
250 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
251 | gdb-${CONFIG}.texi | \ | |
252 | $(TEXI2ROFF) -ms | \ | |
253 | sed -e 's/---/\\(em/g' \ | |
254 | >gdb.ms | |
1eb988b9 RP |
255 | |
256 | # GDB INTERNALS MANUAL: TeX dvi file | |
257 | gdbint.dvi : gdbint.texinfo | |
258 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo | |
259 | texindex gdbint.?? | |
260 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo | |
261 | rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \ | |
262 | gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs | |
263 | ||
264 | # GDB INTERNALS MANUAL: info file | |
dc341d8b | 265 | gdb-internals: gdbint.info |
1eb988b9 | 266 | |
dc341d8b RP |
267 | gdbint.info: gdbint.texinfo |
268 | $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo | |
1eb988b9 | 269 | |
dc341d8b | 270 | force: |
1eb988b9 | 271 | |
dc341d8b RP |
272 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
273 | $(SHELL) ./config.status |