Imported from ../bash-2.05b.tar.gz.
[platform/upstream/bash.git] / doc / Makefile.in
1 # This Makefile is for the Bash/documentation directory -*- text -*-.
2 #
3 # Copyright (C) 1996 Free Software Foundation, Inc.     
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
18
19 #
20 SHELL = @MAKE_SHELL@
21 RM          = rm -f
22
23 topdir = @top_srcdir@
24 srcdir = @srcdir@
25 VPATH = .:@srcdir@
26
27 prefix = @prefix@
28 exec_prefix = @exec_prefix@
29
30 infodir = @infodir@
31
32 # set this to a directory name to have the HTML files installed
33 htmldir = @htmldir@
34
35 # Support an alternate destination root directory for package building
36 DESTDIR =
37
38 mandir = @mandir@
39 manpfx = man
40
41 man1ext = .1
42 man1dir = $(mandir)/$(manpfx)1
43 man3ext = .3
44 man3dir = $(mandir)/$(manpfx)3
45
46 INSTALL = @INSTALL@
47 INSTALL_DATA = @INSTALL_DATA@
48 BUILD_DIR = @BUILD_DIR@
49
50 # bad style
51 RL_LIBDIR = $(topdir)/lib/readline
52
53 # unused
54 TEXINDEX    = texindex
55 TEX         = tex
56
57 MAKEINFO    = makeinfo
58 TEXI2DVI    = ${topdir}/support/texi2dvi
59 TEXI2HTML   = ${topdir}/support/texi2html
60 MAN2HTML    = ${BUILD_DIR}/support/man2html
61 HTMLPOST    = ${srcdir}/htmlpost.sh
62 QUIETPS     = #set this to -q to shut up dvips
63 PAPERSIZE   = letter    # change to a4 for A4-size paper
64 PSDPI       = 300       # could be 600 if you like
65 DVIPS       = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@        # tricky
66 TEXINPUTDIR = $(RL_LIBDIR)/doc
67
68 # These tools might not be available; they're not required
69 DVIPDF      = dvipdfm -o $@ -p ${PAPERSIZE}
70 PSPDF       = gs -sPAPERSIZE=${PAPERSIZE} -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@
71
72 MKDIRS      = ${topdir}/support/mkdirs
73
74 # This should be a program that converts troff to an ascii-readable format
75 NROFF       = groff -Tascii
76
77 # This should be a program that converts troff to postscript
78 GROFF       = groff
79
80 HSUSER      = $(RL_LIBDIR)/doc/hsuser.texinfo
81 RLUSER      = $(RL_LIBDIR)/doc/rluser.texinfo
82
83 .SUFFIXES:      .0 .1 .3 .ms .ps .txt .dvi .html .pdf
84
85 .1.ps:
86         $(RM) $@
87         -${GROFF} -man $< > $@
88
89 .1.0:
90         $(RM) $@
91         -${NROFF} -man $< > $@
92
93 .1.html:
94         $(RM) $@
95         -${MAN2HTML} $< | ${HTMLPOST} > $@
96
97 .ms.ps:
98         $(RM) $@
99         -${GROFF} -ms $< > $@
100
101 .ms.txt:
102         $(RM) $@
103         -${NROFF} -ms $< > $@
104
105 .3.ps:
106         $(RM) $@
107         -${GROFF} -man $< > $@
108
109 .3.0:
110         $(RM) $@
111         -${NROFF} -man $< > $@
112
113 .3.html:
114         $(RM) $@
115         -${MAN2HTML} $< > $@
116
117 .ps.pdf:
118         $(RM) $@
119         -${PSPDF} $<
120
121 .dvi.pdf:
122         $(RM) $@
123         -${DVIPDF} $<
124
125 all: ps info dvi text html
126 nodvi: ps info text html
127
128 PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps
129 DVIFILES = bashref.dvi bashref.ps
130 INFOFILES = bashref.info
131 MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0
132 HTMLFILES = bashref.html bash.html
133 PDFFILES = bash.pdf bashref.pdf article.pdf rose94.pdf
134
135 ps: ${PSFILES}
136 dvi: ${DVIFILES}
137 info: ${INFOFILES}
138 text: ${MAN0FILES}
139 html: ${HTMLFILES}
140 pdf: ${PDFFILES}
141
142 bashref.dvi: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
143         TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/bashref.texi
144
145 bashref.ps: bashref.dvi
146         $(RM) $@
147         $(DVIPS) bashref.dvi
148
149 bashref.info: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
150         $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
151
152 bashref.html: bashref.texi $(HSUSER) $(RLUSER)
153         $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
154
155 new-bashref.dvi: $(srcdir)/new-bashref.texi $(HSUSER) $(RLUSER)
156         TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/new-bashref.texi
157
158 new-bashref.ps: new-bashref.dvi
159         $(RM) $@
160         $(DVIPS) new-bashref.dvi
161
162 new-bashref.info: $(srcdir)/new-bashref.texi $(HSUSER) $(RLUSER)
163         $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/new-bashref.texi
164
165 #bash.dvi: bash.texinfo $(HSUSER) $(RLUSER)
166 #       TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) bash.texinfo
167 #
168 #bashman.ps: bash.dvi
169 #       $(RM) $@
170 #       $(DVIPS) bash.dvi
171
172 bash.txt: bash.1
173 bash.ps: bash.1
174 bash.html: bash.1 $(MAN2HTML)
175 bashbug.ps: bashbug.1
176 builtins.ps: builtins.1 bash.1
177 rbash.ps: rbash.1 bash.1
178 bash.0: bash.1
179 bashbug.0: bashbug.1
180 builtins.0: builtins.1 bash.1
181 rbash.0: rbash.1 bash.1
182 article.ps: article.ms
183
184 article.pdf: article.ps
185 bashref.pdf: bashref.dvi
186 bash.pdf: bash.ps
187 rose94.pdf: rose94.ps
188
189 $(MAN2HTML):    ${topdir}/support/man2html.c
190         -( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html)
191
192 clean:
193         $(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \
194                 *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o
195         ${RM} core *.core
196
197 mostlyclean: clean
198         $(RM) Makefile
199
200 distclean: clean maybe-clean
201         $(RM) Makefile
202
203 maintainer-clean:       clean
204         ${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}
205         ${RM} ${CREATED_FAQ}
206         $(RM) Makefile
207
208 maybe-clean:
209         -if test "X$(topdir)" != "X$(BUILD_DIR)"; then \
210                 $(RM) ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}; \
211         fi
212
213 installdirs:
214         -test -d $(man1dir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(man1dir)
215         -test -d $(infodir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(infodir)
216         -if test -n "$(htmldir)" ; then \
217                 test -d $(htmldir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(htmldir) ; \
218         fi
219         
220 install: info installdirs
221         -$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext}
222         -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
223 # uncomment the next line to install the builtins man page
224 #       -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
225         -$(INSTALL_DATA) $(srcdir)/bashref.info $(DESTDIR)$(infodir)/bash.info
226 # run install-info if it is present to update the info directory
227         if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
228                 install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \
229         else true; fi
230 # if htmldir is set, install the html files into that directory
231         -if test -n "${htmldir}" ; then \
232                 $(INSTALL_DATA) $(srcdir)/bash.html $(DESTDIR)$(htmldir) ; \
233                 $(INSTALL_DATA) $(srcdir)/bashref.html $(DESTDIR)$(htmldir) ; \
234         fi
235
236 uninstall:
237         -$(RM) $(DESTDIR)$(man1dir)/bash${man1ext} $(DESTDIR)$(man1dir)/bashbug${man1ext}
238         $(RM) $(DESTDIR)$(infodir)/bash.info
239         -if test -n "$(htmldir)" ; then \
240                 $(RM) $(DESTDIR)$(htmldir)/bash.html ; \
241                 $(RM) $(DESTDIR)$(htmldir)/bashref.html ; \
242         fi
243
244 # for use by chet
245 CREATED_FAQ = faq.news faq.news2 faq.mail faq.version
246
247 faq:    ${CREATED_FAQ}
248
249 faq.version:    FAQ.version FAQ
250         sh mkfaqvers FAQ.version > $@
251
252 faq.headers.mail: FAQ.headers.mail FAQ
253         sh mkfaqvers FAQ.headers.mail > $@
254
255 faq.headers.news: FAQ.headers.news FAQ
256         sh mkfaqvers FAQ.headers.news > $@
257
258 faq.headers.news2: FAQ.headers.news2 FAQ
259         sh mkfaqvers FAQ.headers.news2 > $@
260
261 faq.news: FAQ faq.headers.news faq.version
262         $(RM) $@
263         cat faq.headers.news faq.version FAQ > $@
264
265 faq.news2: FAQ faq.headers.news2 faq.version
266         $(RM) $@
267         cat faq.headers.news2 faq.version FAQ > $@
268
269 faq.mail: FAQ faq.headers.mail faq.version
270         $(RM) $@
271         cat faq.headers.mail faq.version FAQ > $@
272
273 inst:   bashref.texi
274         $(SHELL) ./mkinstall
275         cmp -s INSTALL ../INSTALL || mv INSTALL ../INSTALL
276         $(RM) INSTALL
277
278 posix:  bashref.texi
279         $(SHELL) ./mkposix
280         cmp -s POSIX ../POSIX || mv POSIX ../POSIX
281         $(RM) POSIX
282
283 rbash:  bashref.texi
284         $(SH) ./mkrbash
285         cmp -s RBASH ../RBASH || mv RBASH ../RBASH
286         $(RM) RBASH
287
288 xdist: inst posix rbash