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