Imported from ../bash-2.05a.tar.gz.
[platform/upstream/bash.git] / doc / Makefile.in
index 98f76b0..f7231c7 100644 (file)
@@ -1,20 +1,47 @@
 # This Makefile is for the Bash/documentation directory -*- text -*-.
 #
+# Copyright (C) 1996 Free Software Foundation, Inc.     
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+
+#
+SHELL = @MAKE_SHELL@
 RM         = rm -f
 
 topdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = .:@srcdir@
 
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
 infodir = @infodir@
 
+# set this to a directory name to have the HTML files installed
+htmldir = @htmldir@
+
+# Support an alternate destination root directory for package building
+DESTDIR =
+
 mandir = @mandir@
 manpfx = man
 
-man1ext = 1
-man1dir = $(mandir)/$(manpfx)$(man1ext)
-man3ext = 3
-man3dir = $(mandir)/$(manpfx)$(man3ext) 
+man1ext = .1
+man1dir = $(mandir)/$(manpfx)1
+man3ext = .3
+man3dir = $(mandir)/$(manpfx)3
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -30,8 +57,12 @@ TEX      = tex
 MAKEINFO    = makeinfo
 TEXI2DVI    = ${topdir}/support/texi2dvi
 TEXI2HTML   = ${topdir}/support/texi2html
+MAN2HTML    = ${BUILD_DIR}/support/man2html
+HTMLPOST    = ${srcdir}/htmlpost.sh
 QUIETPS            = #set this to -q to shut up dvips
-DVIPS      = dvips -D 300 $(QUIETPS) -o $@     # tricky
+PAPERSIZE   = letter   # change to a4 for A4-size paper
+PSDPI       = 300      # could be 600 if you like
+DVIPS      = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@        # tricky
 TEXINPUTDIR = $(RL_LIBDIR)/doc
 
 MKDIRS      = ${topdir}/support/mkdirs
@@ -45,7 +76,7 @@ GROFF     = groff
 HSUSER      = $(RL_LIBDIR)/doc/hsuser.texinfo
 RLUSER      = $(RL_LIBDIR)/doc/rluser.texinfo
 
-.SUFFIXES:     .0 .1 .3 .ms .ps .txt .dvi
+.SUFFIXES:     .0 .1 .3 .ms .ps .txt .dvi .html
 
 .1.ps:
        $(RM) $@
@@ -55,6 +86,10 @@ RLUSER      = $(RL_LIBDIR)/doc/rluser.texinfo
        $(RM) $@
        -${NROFF} -man $< > $@
 
+.1.html:
+       $(RM) $@
+       -${MAN2HTML} $< | ${HTMLPOST} > $@
+
 .ms.ps:
        $(RM) $@
        -${GROFF} -ms $< > $@
@@ -71,14 +106,24 @@ RLUSER      = $(RL_LIBDIR)/doc/rluser.texinfo
        $(RM) $@
        -${NROFF} -man $< > $@
 
+.3.html:
+       $(RM) $@
+       -${MAN2HTML} $< > $@
+
 all: ps info dvi text html
 nodvi: ps info text html
 
-ps: bash.ps bashbug.ps readline.ps article.ps builtins.ps
-dvi: bashref.dvi bashref.ps 
-info: bashref.info
-text: bash.0 bashbug.0 builtins.0 readline.0
-html: bashref.html
+PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps
+DVIFILES = bashref.dvi bashref.ps
+INFOFILES = bashref.info
+MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0
+HTMLFILES = bashref.html bash.html
+
+ps: ${PSFILES}
+dvi: ${DVIFILES}
+info: ${INFOFILES}
+text: ${MAN0FILES}
+html: ${HTMLFILES}
 
 bashref.dvi: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
        TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/bashref.texi
@@ -91,7 +136,17 @@ bashref.info: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
        $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
 
 bashref.html: bashref.texi $(HSUSER) $(RLUSER)
-       $(TEXI2HTML) -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
+       $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
+
+new-bashref.dvi: $(srcdir)/new-bashref.texi $(HSUSER) $(RLUSER)
+       TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/new-bashref.texi
+
+new-bashref.ps: new-bashref.dvi
+       $(RM) $@
+       $(DVIPS) new-bashref.dvi
+
+new-bashref.info: $(srcdir)/new-bashref.texi $(HSUSER) $(RLUSER)
+       $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/new-bashref.texi
 
 bash.dvi: bash.texinfo $(HSUSER) $(RLUSER)
        TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) bash.texinfo
@@ -102,69 +157,92 @@ bashman.ps: bash.dvi
 
 bash.txt: bash.1
 bash.ps: bash.1
+bash.html: bash.1 $(MAN2HTML)
 bashbug.ps: bashbug.1
 builtins.ps: builtins.1 bash.1
+rbash.ps: rbash.1 bash.1
 bash.0: bash.1
 bashbug.0: bashbug.1
 builtins.0: builtins.1 bash.1
-readline.0: readline.3
-readline.ps: readline.3
+rbash.0: rbash.1 bash.1
 article.ps: article.ms
 
-faq:   faq.news faq.news2 faq.mail faq.version
-
-faq.version:   FAQ.version FAQ
-       sh mkfaqvers FAQ.version > $@
-
-faq.news: FAQ FAQ.headers.news faq.version
-       $(RM) $@
-       cat FAQ.headers.news faq.version FAQ > $@
-
-faq.news2: FAQ FAQ.headers.news2 faq.version
-       $(RM) $@
-       cat FAQ.headers.news2 faq.version FAQ > $@
-
-faq.mail: FAQ FAQ.headers.mail faq.version
-       $(RM) $@
-       cat FAQ.headers.mail faq.version FAQ > $@
+$(MAN2HTML):   ${topdir}/support/man2html.c
+       -( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html)
 
 clean:
-       $(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \
-               *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o \
-               core rluser.texinfo hsuser.texinfo
+       $(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \
+               *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o
+       ${RM} core *.core
 
 distclean mostlyclean: clean
        $(RM) Makefile
 
 maintainer-clean:      clean
-       $(RM) *.0 *.ps *.dvi *.info *.txt
+       ${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}
+       ${RM} ${CREATED_FAQ}
        $(RM) Makefile
 
 installdirs:
-       -test -d $(man1dir) || $(SHELL) ${MKDIRS} $(man1dir)
-# uncomment the next line to create the directory for the readline man page
-#      -test -d $(man3dir) || $(SHELL) ${MKDIRS} $(man3dir)
-       -test -d $(infodir) || $(SHELL) ${MKDIRS} $(infodir)
+       -test -d $(man1dir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(man1dir)
+       -test -d $(infodir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(infodir)
+       -if test -n "$(htmldir)" ; then \
+               test -d $(htmldir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(htmldir) ; \
+       fi
        
 install: info installdirs
-       -$(INSTALL_DATA) $(srcdir)/bash.1 $(man1dir)/bash.${man1ext}
-       -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(man1dir)/bashbug.${man1ext}
-# uncomment the next line to install the readline man page
-#      -$(INSTALL_DATA) $(srcdir)/readline.3 $(man3dir)/readline.${man3ext}
+       -$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext}
+       -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
 # uncomment the next line to install the builtins man page
-#      $(INSTALL_DATA) builtins.1 $(man1dir)/bash_builtins.${man1ext}
-       -$(INSTALL_DATA) $(srcdir)/bashref.info $(infodir)/bash.info
+#      -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
+       -$(INSTALL_DATA) $(srcdir)/bashref.info $(DESTDIR)$(infodir)/bash.info
 # run install-info if it is present to update the info directory
        if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
-               install-info --dir-file=$(infodir)/dir $(infodir)/bash.info; \
+               install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \
        else true; fi
+# if htmldir is set, install the html files into that directory
+       -if test -n "${htmldir}" ; then \
+               $(INSTALL_DATA) $(srcdir)/bash.html $(DESTDIR)$(htmldir) ; \
+               $(INSTALL_DATA) $(srcdir)/bashref.html $(DESTDIR)$(htmldir) ; \
+       fi
 
 uninstall:
-       -$(RM) $(man1dir)/bash.${man1ext} $(man1dir)/bashbug.${man1ext}
-       -$(RM) $(man3dir)/readline.${man3ext}
-       $(RM) $(infodir)/bash.info
+       -$(RM) $(DESTDIR)$(man1dir)/bash${man1ext} $(DESTDIR)$(man1dir)/bashbug${man1ext}
+       $(RM) $(DESTDIR)$(infodir)/bash.info
+       -if test -n "$(htmldir)" ; then \
+               $(RM) $(DESTDIR)$(htmldir)/bash.html ; \
+               $(RM) $(DESTDIR)$(htmldir)/bashref.html ; \
+       fi
 
 # for use by chet
+CREATED_FAQ = faq.news faq.news2 faq.mail faq.version
+
+faq:   ${CREATED_FAQ}
+
+faq.version:   FAQ.version FAQ
+       sh mkfaqvers FAQ.version > $@
+
+faq.headers.mail: FAQ.headers.mail FAQ
+       sh mkfaqvers FAQ.headers.mail > $@
+
+faq.headers.news: FAQ.headers.news FAQ
+       sh mkfaqvers FAQ.headers.news > $@
+
+faq.headers.news2: FAQ.headers.news2 FAQ
+       sh mkfaqvers FAQ.headers.news2 > $@
+
+faq.news: FAQ faq.headers.news faq.version
+       $(RM) $@
+       cat faq.headers.news faq.version FAQ > $@
+
+faq.news2: FAQ faq.headers.news2 faq.version
+       $(RM) $@
+       cat faq.headers.news2 faq.version FAQ > $@
+
+faq.mail: FAQ faq.headers.mail faq.version
+       $(RM) $@
+       cat faq.headers.mail faq.version FAQ > $@
+
 inst:  bashref.texi
        $(SHELL) ./mkinstall
        cmp -s INSTALL ../INSTALL || mv INSTALL ../INSTALL
@@ -174,3 +252,5 @@ posix:      bashref.texi
        $(SHELL) ./mkposix
        cmp -s POSIX.NOTES ../CWRU/POSIX.NOTES || mv POSIX.NOTES ../CWRU/POSIX.NOTES
        $(RM) POSIX.NOTES
+
+xdist: inst posix