Imported from ../bash-2.05.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 mandir = @mandir@
36 manpfx = man
37
38 man1ext = 1
39 man1dir = $(mandir)/$(manpfx)$(man1ext)
40 man3ext = 3
41 man3dir = $(mandir)/$(manpfx)$(man3ext) 
42
43 INSTALL = @INSTALL@
44 INSTALL_DATA = @INSTALL_DATA@
45 BUILD_DIR = @BUILD_DIR@
46
47 # bad style
48 RL_LIBDIR = $(topdir)/lib/readline
49
50 # unused
51 TEXINDEX    = texindex
52 TEX         = tex
53
54 MAKEINFO    = makeinfo
55 TEXI2DVI    = ${topdir}/support/texi2dvi
56 TEXI2HTML   = ${topdir}/support/texi2html
57 MAN2HTML    = ${BUILD_DIR}/support/man2html
58 HTMLPOST    = ${srcdir}/htmlpost.sh
59 QUIETPS     = #set this to -q to shut up dvips
60 PAPERSIZE   = letter    # change to a4 for A4-size paper
61 PSDPI       = 300       # could be 600 if you like
62 DVIPS       = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@        # tricky
63 TEXINPUTDIR = $(RL_LIBDIR)/doc
64
65 MKDIRS      = ${topdir}/support/mkdirs
66
67 # This should be a program that converts troff to an ascii-readable format
68 NROFF       = groff -Tascii
69
70 # This should be a program that converts troff to postscript
71 GROFF       = groff
72
73 HSUSER      = $(RL_LIBDIR)/doc/hsuser.texinfo
74 RLUSER      = $(RL_LIBDIR)/doc/rluser.texinfo
75
76 .SUFFIXES:      .0 .1 .3 .ms .ps .txt .dvi .html
77
78 .1.ps:
79         $(RM) $@
80         -${GROFF} -man $< > $@
81
82 .1.0:
83         $(RM) $@
84         -${NROFF} -man $< > $@
85
86 .1.html:
87         $(RM) $@
88         -${MAN2HTML} $< | ${HTMLPOST} > $@
89
90 .ms.ps:
91         $(RM) $@
92         -${GROFF} -ms $< > $@
93
94 .ms.txt:
95         $(RM) $@
96         -${NROFF} -ms $< > $@
97
98 .3.ps:
99         $(RM) $@
100         -${GROFF} -man $< > $@
101
102 .3.0:
103         $(RM) $@
104         -${NROFF} -man $< > $@
105
106 .3.html:
107         $(RM) $@
108         -${MAN2HTML} $< > $@
109
110 all: ps info dvi text html
111 nodvi: ps info text html
112
113 PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps
114 DVIFILES = bashref.dvi bashref.ps
115 INFOFILES = bashref.info
116 MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0
117 HTMLFILES = bashref.html bash.html
118
119 ps: ${PSFILES}
120 dvi: ${DVIFILES}
121 info: ${INFOFILES}
122 text: ${MAN0FILES}
123 html: ${HTMLFILES}
124
125 bashref.dvi: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
126         TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/bashref.texi
127
128 bashref.ps: bashref.dvi
129         $(RM) $@
130         $(DVIPS) bashref.dvi
131
132 bashref.info: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
133         $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
134
135 bashref.html: bashref.texi $(HSUSER) $(RLUSER)
136         $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
137
138 new-bashref.dvi: $(srcdir)/new-bashref.texi $(HSUSER) $(RLUSER)
139         TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/new-bashref.texi
140
141 new-bashref.ps: new-bashref.dvi
142         $(RM) $@
143         $(DVIPS) new-bashref.dvi
144
145 new-bashref.info: $(srcdir)/new-bashref.texi $(HSUSER) $(RLUSER)
146         $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/new-bashref.texi
147
148 bash.dvi: bash.texinfo $(HSUSER) $(RLUSER)
149         TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) bash.texinfo
150
151 bashman.ps: bash.dvi
152         $(RM) $@
153         $(DVIPS) bash.dvi
154
155 bash.txt: bash.1
156 bash.ps: bash.1
157 bash.html: bash.1 $(MAN2HTML)
158 bashbug.ps: bashbug.1
159 builtins.ps: builtins.1 bash.1
160 rbash.ps: rbash.1 bash.1
161 bash.0: bash.1
162 bashbug.0: bashbug.1
163 builtins.0: builtins.1 bash.1
164 rbash.0: rbash.1 bash.1
165 article.ps: article.ms
166
167 $(MAN2HTML):    ${topdir}/support/man2html.c
168         -( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html)
169
170 CREATED_FAQ = faq.news faq.news2 faq.mail faq.version
171
172 faq:    ${CREATED_FAQ}
173
174 faq.version:    FAQ.version FAQ
175         sh mkfaqvers FAQ.version > $@
176
177 faq.headers.mail: FAQ.headers.mail FAQ
178         sh mkfaqvers FAQ.headers.mail > $@
179
180 faq.headers.news: FAQ.headers.news FAQ
181         sh mkfaqvers FAQ.headers.news > $@
182
183 faq.headers.news2: FAQ.headers.news2 FAQ
184         sh mkfaqvers FAQ.headers.news2 > $@
185
186 faq.news: FAQ faq.headers.news faq.version
187         $(RM) $@
188         cat faq.headers.news faq.version FAQ > $@
189
190 faq.news2: FAQ faq.headers.news2 faq.version
191         $(RM) $@
192         cat faq.headers.news2 faq.version FAQ > $@
193
194 faq.mail: FAQ faq.headers.mail faq.version
195         $(RM) $@
196         cat faq.headers.mail faq.version FAQ > $@
197
198 clean:
199         $(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \
200                 *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o
201         ${RM} core *.core
202
203 distclean mostlyclean: clean
204         $(RM) Makefile
205
206 maintainer-clean:       clean
207         ${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}
208         ${RM} ${CREATED_FAQ}
209         $(RM) Makefile
210
211 installdirs:
212         -test -d $(man1dir) || $(SHELL) ${MKDIRS} $(man1dir)
213         -test -d $(infodir) || $(SHELL) ${MKDIRS} $(infodir)
214         -if [ -n "$(htmldir)" ]; then \
215                 test -d $(htmldir) || $(SHELL) ${MKDIRS} $(htmldir) ; \
216         fi
217         
218 install: info installdirs
219         -$(INSTALL_DATA) $(srcdir)/bash.1 $(man1dir)/bash.${man1ext}
220         -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(man1dir)/bashbug.${man1ext}
221 # uncomment the next line to install the builtins man page
222 #       $(INSTALL_DATA) $(srcdir)/builtins.1 $(man1dir)/bash_builtins.${man1ext}
223         -$(INSTALL_DATA) $(srcdir)/bashref.info $(infodir)/bash.info
224 # run install-info if it is present to update the info directory
225         if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
226                 install-info --dir-file=$(infodir)/dir $(infodir)/bash.info; \
227         else true; fi
228 # if htmldir is set, install the html files into that directory
229         -if [ -n "${htmldir}" ]; then \
230                 $(INSTALL_DATA) $(srcdir)/bash.html $(htmldir) ; \
231                 $(INSTALL_DATA) $(srcdir)/bashref.html $(htmldir) ; \
232         fi
233
234 uninstall:
235         -$(RM) $(man1dir)/bash.${man1ext} $(man1dir)/bashbug.${man1ext}
236         $(RM) $(infodir)/bash.info
237         -if [ -n "$(htmldir)" ]; then \
238                 $(RM) $(htmldir)/bash.html ; \
239                 $(RM) $(htmldir)/bashref.html ; \
240         fi
241
242 # for use by chet
243 inst:   bashref.texi
244         $(SHELL) ./mkinstall
245         cmp -s INSTALL ../INSTALL || mv INSTALL ../INSTALL
246         $(RM) INSTALL
247
248 posix:  bashref.texi
249         $(SHELL) ./mkposix
250         cmp -s POSIX.NOTES ../CWRU/POSIX.NOTES || mv POSIX.NOTES ../CWRU/POSIX.NOTES
251         $(RM) POSIX.NOTES
252
253 xdist: inst posix