1 # This Makefile is for the Bash/documentation directory -*- text -*-.
3 # Copyright (C) 2003-2009 Free Software Foundation, Inc.
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 3 of the License, or
8 # (at your option) any later version.
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.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 PACKAGE
= @PACKAGE_NAME@
19 VERSION
= @PACKAGE_VERSION@
21 PACKAGE_BUGREPORT
= @PACKAGE_BUGREPORT@
22 PACKAGE_NAME
= @PACKAGE_NAME@
23 PACKAGE_STRING
= @PACKAGE_STRING@
24 PACKAGE_VERSION
= @PACKAGE_VERSION@
35 exec_prefix = @
exec_prefix@
37 datarootdir
= @datarootdir@
41 # set this to a directory name to have the HTML files installed
44 # Support an alternate destination root directory for package building
51 man1dir = $(mandir)/$(manpfx
)1
53 man3dir = $(mandir)/$(manpfx
)3
56 INSTALL_DATA
= @INSTALL_DATA@
57 BUILD_DIR
= @BUILD_DIR@
59 SUPPORT_SRCDIR
= $(topdir
)/support
62 RL_LIBDIR
= $(topdir
)/lib
/readline
69 TEXI2DVI
= ${SUPPORT_SRCDIR}/texi2dvi
70 TEXI2HTML
= ${SUPPORT_SRCDIR}/texi2html
71 MAN2HTML
= ${BUILD_DIR}/support
/man2html
72 HTMLPOST
= ${srcdir}/htmlpost.sh
73 INFOPOST
= ${srcdir}/infopost.sh
74 QUIETPS
= #set this to -q to shut up dvips
75 PAPERSIZE
= letter
# change to a4 for A4-size paper
76 PSDPI
= 600 # could be 300 if you like
77 DVIPS
= dvips
-D
${PSDPI} $(QUIETPS
) -t
${PAPERSIZE} -o
$@
# tricky
79 TEXINPUTDIR
= $(RL_LIBDIR
)/doc
80 SET_TEXINPUTS
= TEXINPUTS
=.
:$(TEXINPUTDIR
):$$TEXINPUTS
82 # These tools might not be available; they're not required
83 DVIPDF
= dvipdfm
-o
$@
-p
${PAPERSIZE}
84 PSPDF
= gs
-sPAPERSIZE
=${PAPERSIZE} -sDEVICE
=pdfwrite
-dNOPAUSE
-dBATCH
-sOutputFile
=$@
86 MKDIRS
= ${SUPPORT_SRCDIR}/mkdirs
88 # This should be a program that converts troff to an ascii-readable format
91 # This should be a program that converts troff to postscript
94 HSUSER
= $(RL_LIBDIR
)/doc
/hsuser.texi
95 RLUSER
= $(RL_LIBDIR
)/doc
/rluser.texi
97 BASHREF_FILES
= $(srcdir)/bashref.texi
$(srcdir)/fdl.texi
$(srcdir)/version.texi
99 .SUFFIXES
: .0 .1 .3 .ms .ps .txt .
dvi .html .pdf
103 -${GROFF} -man
$< > $@
107 -${NROFF} -man
$< > $@
111 -${MAN2HTML} $< |
${HTMLPOST} > $@
115 -${GROFF} -ms
$< > $@
119 -${NROFF} -ms
$< > $@
123 -${GROFF} -man
$< > $@
127 -${NROFF} -man
$< > $@
145 all: ps
info dvi text html
146 nodvi
: ps
info text html
149 PSFILES
= bash.ps bashbug.ps article.ps builtins.ps rbash.ps
150 DVIFILES
= bashref.
dvi bashref.ps
151 INFOFILES
= bashref.
info
152 MAN0FILES
= bash
.0 bashbug
.0 builtins
.0 rbash
.0
153 HTMLFILES
= bashref.html bash.html
154 PDFFILES
= bash.pdf bashref.pdf article.pdf rose94.pdf
163 bashref.
dvi: $(BASHREF_FILES
) $(HSUSER
) $(RLUSER
)
164 ${SET_TEXINPUTS} $(TEXI2DVI
) $(srcdir)/bashref.texi ||
{ ${RM} $@
; exit
1; }
166 bashref.
info: $(BASHREF_FILES
) $(HSUSER
) $(RLUSER
)
167 $(MAKEINFO
) --no-split
-I
$(TEXINPUTDIR
) $(srcdir)/bashref.texi
169 bashref.html
: $(BASHREF_FILES
) $(HSUSER
) $(RLUSER
)
170 $(TEXI2HTML
) -menu
-monolithic
-I
$(TEXINPUTDIR
) $(srcdir)/bashref.texi
172 bash.
info: bashref.
info
173 ${SHELL} ${INFOPOST} < $(srcdir)/bashref.
info > $@
; \
177 bash.html
: bash
.1 $(MAN2HTML
)
178 bashbug.ps
: bashbug
.1
179 builtins.ps
: builtins
.1 bash
.1
180 rbash.ps
: rbash
.1 bash
.1
183 builtins
.0: builtins
.1 bash
.1
184 rbash
.0: rbash
.1 bash
.1
185 article.ps
: article.ms
187 bashref.ps
: bashref.
dvi
189 article.pdf
: article.ps
190 bashref.pdf
: bashref.
dvi
192 rose94.pdf
: rose94.ps
194 $(MAN2HTML
): ${topdir}/support
/man2html.c
195 -( cd
${BUILD_DIR}/support
; ${MAKE} ${MFLAGS} man2html
)
198 $(RM
) *.aux
*.bak
*.cp
*.fn
*.ky
*.log
*.pg
*.toc
*.tp
*.vr
*.cps \
199 *.pgs
*.bt
*.bts
*.rw
*.rws
*.fns
*.kys
*.tps
*.vrs
*.o
205 distclean: clean maybe-clean
208 maintainer-clean
: clean
209 ${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}
214 -if
test "X$(topdir)" != "X$(BUILD_DIR)"; then \
215 $(RM
) ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}; \
219 -$(SHELL
) $(SUPPORT_SRCDIR
)/mkinstalldirs
$(DESTDIR
)$(man1dir)
220 -$(SHELL
) $(SUPPORT_SRCDIR
)/mkinstalldirs
$(DESTDIR
)$(infodir)
221 -if
test -n
"$(htmldir)" ; then \
222 $(SHELL
) $(SUPPORT_SRCDIR
)/mkinstalldirs
$(DESTDIR
)$(htmldir
) ; \
225 install: info installdirs bash.
info
226 -$(INSTALL_DATA
) $(srcdir)/bash
.1 $(DESTDIR
)$(man1dir)/bash
${man1ext}
227 -$(INSTALL_DATA
) $(srcdir)/bashbug
.1 $(DESTDIR
)$(man1dir)/bashbug
${man1ext}
228 # uncomment the next lines to install the builtins man page
229 # sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
230 # -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
231 # -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
232 -if
test -f bash.
info; then d
=.
; else d
=$(srcdir); fi
; \
233 $(INSTALL_DATA
) $$d/bash.
info $(DESTDIR
)$(infodir)/bash.
info
234 # run install-info if it is present to update the info directory
235 if
$(SHELL
) -c
'install-info --version' >/dev
/null
2>&1; then \
236 install-info
--dir-file
=$(DESTDIR
)$(infodir)/dir $(DESTDIR
)$(infodir)/bash.
info; \
238 # if htmldir is set, install the html files into that directory
239 -if
test -n
"${htmldir}" ; then \
240 $(INSTALL_DATA
) $(srcdir)/bash.html
$(DESTDIR
)$(htmldir
) ; \
241 $(INSTALL_DATA
) $(srcdir)/bashref.html
$(DESTDIR
)$(htmldir
) ; \
244 install_builtins
: installdirs
245 sed
's:bash\.1:man1/&:' $(srcdir)/builtins
.1 > $${TMPDIR
:-/var
/tmp
}/builtins
.1
246 -$(INSTALL_DATA
) $${TMPDIR
:-/var
/tmp
}/builtins
.1 $(DESTDIR
)$(man1dir)/bash_builtins
${man1ext}
247 -$(RM
) $${TMPDIR
:-/var
/tmp
}/builtins
.1
249 install_everything
: install install_builtins
252 -$(RM
) $(DESTDIR
)$(man1dir)/bash
${man1ext} $(DESTDIR
)$(man1dir)/bashbug
${man1ext}
253 -$(RM
) $(DESTDIR
)$(man1dir)/bash_builtins
${man1ext}
254 $(RM
) $(DESTDIR
)$(infodir)/bash.
info
255 -if
test -n
"$(htmldir)" ; then \
256 $(RM
) $(DESTDIR
)$(htmldir
)/bash.html
; \
257 $(RM
) $(DESTDIR
)$(htmldir
)/bashref.html
; \
261 CREATED_FAQ
= faq.news faq.news2 faq.mail faq.version
265 faq.version
: FAQ.version FAQ
266 sh mkfaqvers FAQ.version
> $@
268 faq.headers.mail
: FAQ.headers.mail FAQ
269 sh mkfaqvers FAQ.headers.mail
> $@
271 faq.headers.news
: FAQ.headers.news FAQ
272 sh mkfaqvers FAQ.headers.news
> $@
274 faq.headers.news2
: FAQ.headers.news2 FAQ
275 sh mkfaqvers FAQ.headers.news2
> $@
277 faq.news
: FAQ faq.headers.news faq.version
279 cat faq.headers.news faq.version FAQ
> $@
281 faq.news2
: FAQ faq.headers.news2 faq.version
283 cat faq.headers.news2 faq.version FAQ
> $@
285 faq.mail
: FAQ faq.headers.mail faq.version
287 cat faq.headers.mail faq.version FAQ
> $@
291 cmp
-s INSTALL ..
/INSTALL || mv INSTALL ..
/INSTALL
296 cmp
-s POSIX ..
/POSIX || mv POSIX ..
/POSIX
301 cmp
-s RBASH ..
/RBASH || mv RBASH ..
/RBASH
304 xdist
: pdf inst posix rbash