1 # This Makefile is for the Bash/documentation directory -*- text -*-.
3 # Copyright (C) 2003-2013 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@
26 PACKAGE_TARNAME
= @PACKAGE_TARNAME@
37 exec_prefix = @
exec_prefix@
39 datarootdir
= @datarootdir@
45 # set this to a directory name to have the HTML files installed
48 # Support an alternate destination root directory for package building
55 man1dir = $(mandir)/$(manpfx
)1
57 man3dir = $(mandir)/$(manpfx
)3
60 INSTALL_DATA
= @INSTALL_DATA@
61 BUILD_DIR
= @BUILD_DIR@
63 SUPPORT_SRCDIR
= $(topdir
)/support
66 RL_LIBDIR
= $(topdir
)/lib
/readline
73 TEXI2DVI
= ${SUPPORT_SRCDIR}/texi2dvi
74 TEXI2HTML
= ${SUPPORT_SRCDIR}/texi2html
75 MAN2HTML
= ${BUILD_DIR}/support
/man2html
76 HTMLPOST
= ${srcdir}/htmlpost.sh
77 INFOPOST
= ${srcdir}/infopost.sh
78 QUIETPS
= #set this to -q to shut up dvips
79 PAPERSIZE
= letter
# change to a4 for A4-size paper
80 PSDPI
= 600 # could be 300 if you like
81 DVIPS
= dvips
-D
${PSDPI} $(QUIETPS
) -t
${PAPERSIZE} -o
$@
# tricky
83 TEXINPUTDIR
= $(RL_LIBDIR
)/doc
84 SET_TEXINPUTS
= TEXINPUTS
=.
:$(TEXINPUTDIR
):$$TEXINPUTS
86 # These tools might not be available; they're not required
87 DVIPDF
= dvipdfm
-o
$@
-p
${PAPERSIZE}
88 PSPDF
= gs
-sPAPERSIZE
=${PAPERSIZE} -sDEVICE
=pdfwrite
-dNOPAUSE
-dBATCH
-sOutputFile
=$@
90 MKDIRS
= ${SUPPORT_SRCDIR}/mkdirs
92 # This should be a program that converts troff to an ascii-readable format
95 # This should be a program that converts troff to postscript
98 HSUSER
= $(RL_LIBDIR
)/doc
/hsuser.texi
99 RLUSER
= $(RL_LIBDIR
)/doc
/rluser.texi
101 BASHREF_FILES
= $(srcdir)/bashref.texi
$(srcdir)/fdl.texi
$(srcdir)/version.texi
103 .SUFFIXES
: .0 .1 .3 .ms .ps .txt .
dvi .html .pdf
107 -${GROFF} -man
$< > $@
111 -${NROFF} -man
$< > $@
115 -${MAN2HTML} $< |
${HTMLPOST} > $@
119 -${GROFF} -ms
$< > $@
123 -${NROFF} -ms
$< > $@
127 -${GROFF} -man
$< > $@
131 -${NROFF} -man
$< > $@
149 all: ps
info dvi text html
150 nodvi
: ps
info text html
153 PSFILES
= bash.ps bashbug.ps article.ps builtins.ps rbash.ps
154 DVIFILES
= bashref.
dvi bashref.ps
155 INFOFILES
= bashref.
info
156 MAN0FILES
= bash
.0 bashbug
.0 builtins
.0 rbash
.0
157 HTMLFILES
= bashref.html bash.html
158 PDFFILES
= bash.pdf bashref.pdf article.pdf rose94.pdf
167 bashref.
dvi: $(BASHREF_FILES
) $(HSUSER
) $(RLUSER
)
168 ${SET_TEXINPUTS} $(TEXI2DVI
) $(srcdir)/bashref.texi ||
{ ${RM} $@
; exit
1; }
170 bashref.
info: $(BASHREF_FILES
) $(HSUSER
) $(RLUSER
)
171 $(MAKEINFO
) --no-split
-I
$(TEXINPUTDIR
) $(srcdir)/bashref.texi
174 # $(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
175 bashref.html
: $(BASHREF_FILES
) $(HSUSER
) $(RLUSER
)
176 $(TEXI2HTML
) -menu
-monolithic
-I
$(TEXINPUTDIR
) $(srcdir)/bashref.texi
178 bash.
info: bashref.
info
179 ${SHELL} ${INFOPOST} < $(srcdir)/bashref.
info > $@
; \
183 bash.html
: bash
.1 $(MAN2HTML
)
184 bashbug.ps
: bashbug
.1
185 builtins.ps
: builtins
.1 bash
.1
186 rbash.ps
: rbash
.1 bash
.1
189 builtins
.0: builtins
.1 bash
.1
190 rbash
.0: rbash
.1 bash
.1
191 article.ps
: article.ms
193 bashref.ps
: bashref.
dvi
195 article.pdf
: article.ps
196 bashref.pdf
: bashref.
dvi
198 rose94.pdf
: rose94.ps
200 OTHER_DOCS
= $(srcdir)/FAQ
$(srcdir)/INTRO
201 OTHER_INSTALLED_DOCS
= FAQ INTRO
203 $(MAN2HTML
): ${topdir}/support
/man2html.c
204 -( cd
${BUILD_DIR}/support
; ${MAKE} ${MFLAGS} man2html
)
207 $(RM
) *.aux
*.bak
*.cp
*.fn
*.ky
*.log
*.pg
*.toc
*.tp
*.vr
*.cps \
208 *.pgs
*.bt
*.bts
*.rw
*.rws
*.fns
*.kys
*.tps
*.vrs
*.o
214 distclean: clean maybe-clean
217 maintainer-clean
: clean
218 ${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}
223 -if
test "X$(topdir)" != "X$(BUILD_DIR)"; then \
224 $(RM
) ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}; \
228 -$(SHELL
) $(SUPPORT_SRCDIR
)/mkinstalldirs
$(DESTDIR
)$(man1dir)
229 -$(SHELL
) $(SUPPORT_SRCDIR
)/mkinstalldirs
$(DESTDIR
)$(infodir)
230 -$(SHELL
) $(SUPPORT_SRCDIR
)/mkinstalldirs
$(DESTDIR
)$(docdir
)
231 -if
test -n
"$(htmldir)" ; then \
232 $(SHELL
) $(SUPPORT_SRCDIR
)/mkinstalldirs
$(DESTDIR
)$(htmldir
) ; \
235 install: info installdirs bash.
info
236 -$(INSTALL_DATA
) $(srcdir)/bash
.1 $(DESTDIR
)$(man1dir)/bash
${man1ext}
237 -$(INSTALL_DATA
) $(srcdir)/bashbug
.1 $(DESTDIR
)$(man1dir)/bashbug
${man1ext}
238 -$(INSTALL_DATA
) $(OTHER_DOCS
) $(DESTDIR
)$(docdir
)
239 # uncomment the next lines to install the builtins man page
240 # sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
241 # -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
242 # -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
243 -if
test -f bash.
info; then d
=.
; else d
=$(srcdir); fi
; \
244 $(INSTALL_DATA
) $$d/bash.
info $(DESTDIR
)$(infodir)/bash.
info
245 # run install-info if it is present to update the info directory
246 if
$(SHELL
) -c
'install-info --version' >/dev
/null
2>&1; then \
247 install-info
--dir-file
=$(DESTDIR
)$(infodir)/dir $(DESTDIR
)$(infodir)/bash.
info; \
249 # if htmldir is set, install the html files into that directory
250 -if
test -n
"${htmldir}" ; then \
251 $(INSTALL_DATA
) $(srcdir)/bash.html
$(DESTDIR
)$(htmldir
) ; \
252 $(INSTALL_DATA
) $(srcdir)/bashref.html
$(DESTDIR
)$(htmldir
) ; \
255 install_builtins
: installdirs
256 sed
's:bash\.1:man1/&:' $(srcdir)/builtins
.1 > $${TMPDIR
:-/var
/tmp
}/builtins
.1
257 -$(INSTALL_DATA
) $${TMPDIR
:-/var
/tmp
}/builtins
.1 $(DESTDIR
)$(man1dir)/bash_builtins
${man1ext}
258 -$(RM
) $${TMPDIR
:-/var
/tmp
}/builtins
.1
260 install_everything
: install install_builtins
263 -$(RM
) $(DESTDIR
)$(man1dir)/bash
${man1ext} $(DESTDIR
)$(man1dir)/bashbug
${man1ext}
264 -$(RM
) $(DESTDIR
)$(man1dir)/bash_builtins
${man1ext}
265 $(RM
) $(DESTDIR
)$(infodir)/bash.
info
266 -( cd
$(DESTDIR
)$(docdir
) && $(RM
) $(OTHER_INSTALLED_DOCS
) )
267 -if
test -n
"$(htmldir)" ; then \
268 $(RM
) $(DESTDIR
)$(htmldir
)/bash.html
; \
269 $(RM
) $(DESTDIR
)$(htmldir
)/bashref.html
; \
273 CREATED_FAQ
= faq.news faq.news2 faq.mail faq.version
277 faq.version
: FAQ.version FAQ
278 sh mkfaqvers FAQ.version
> $@
280 faq.headers.mail
: FAQ.headers.mail FAQ
281 sh mkfaqvers FAQ.headers.mail
> $@
283 faq.headers.news
: FAQ.headers.news FAQ
284 sh mkfaqvers FAQ.headers.news
> $@
286 faq.headers.news2
: FAQ.headers.news2 FAQ
287 sh mkfaqvers FAQ.headers.news2
> $@
289 faq.news
: FAQ faq.headers.news faq.version
291 cat faq.headers.news faq.version FAQ
> $@
293 faq.news2
: FAQ faq.headers.news2 faq.version
295 cat faq.headers.news2 faq.version FAQ
> $@
297 faq.mail
: FAQ faq.headers.mail faq.version
299 cat faq.headers.mail faq.version FAQ
> $@
303 cmp
-s INSTALL ..
/INSTALL || mv INSTALL ..
/INSTALL
308 cmp
-s POSIX ..
/POSIX || mv POSIX ..
/POSIX
313 cmp
-s RBASH ..
/RBASH || mv RBASH ..
/RBASH
316 xdist
: pdf inst posix rbash