Commit 3b485b7c 3b485b7c94ba7ec3f5473e7dbd828dd9529588a8 by Sergey Poznyakoff

Rewritten to use gendocs.sh

1 parent 15d33fdf
......@@ -71,124 +71,20 @@ SUFFIXES=.c .inc
DISTCLEANFILES=*.pgs *.kys *.vrs
MAINTAINERCLEANFILES=$(INCFILES)
## Web documentation
BASE_URL="http://www.gnu.org/software/mailutils/manual/"
TEXI2HTML=${SHELL} `cd $(top_srcdir); pwd`/scripts/missing --run texi2html
DVIPS=${SHELL} `cd $(top_srcdir); pwd`/scripts/missing --run dvips
INFO=${SHELL} `cd $(top_srcdir); pwd`/scripts/missing --run info
EXTRA_DIST = index.html.in COPYING.DOC
html: html_mono html_node html_chapter
html_node:
texi2html="$(TEXI2HTML)";\
if ! test -d html_node; then mkdir html_node; fi; \
cd html_node; \
$$texi2html -menu -split_node ../$(srcdir)/mailutils.texi
html_chapter:
texi2html="$(TEXI2HTML)";\
if ! test -d html_chapter; then mkdir html_chapter; fi; \
cd html_chapter; \
$$texi2html -menu -split_chapter ../$(srcdir)/mailutils.texi
html_mono:
texi2html="$(TEXI2HTML)";\
if ! test -d html_mono; then mkdir html_mono; fi; \
cd html_mono; \
$$texi2html -menu -monolithic ../$(srcdir)/mailutils.texi
ps: mailutils.ps
mailutils.ps: mailutils.dvi
$(DVIPS) -omailutils.ps mailutils.dvi
text: mailutils.text
mailutils.text: mailutils.info
$(INFO) --node=Top --subnodes --out mailutils.text -f mailutils.info
mailutils.info.tar.gz:
tar cfz mailutils.info.tar.gz mailutils.info*
mailutils.dvi.gz: mailutils.dvi
gzip -c mailutils.dvi > mailutils.dvi.gz
mailutils.ps.gz: mailutils.ps
gzip -c mailutils.ps > mailutils.ps.gz
mailutils.texi.tar.gz:
tar cfz mailutils.texi.tar.gz *.texi
WEB_HTML=\
html_mono\
html_node\
html_chapter
WEB_BIN=\
mailutils.info.tar.gz\
mailutils.dvi.gz\
mailutils.ps.gz\
mailutils.texi.tar.gz\
mailutils.text
CLEANFILES = $(WEB_BIN)
clean-local:
rm -rf $(WEB_HTML)
WEBDOC=$(WEB_HTML) $(WEB_BIN)
rm -rf manual
webdocdir: $(WEBDOC) index.html
if ! test -d $(WEBDOCDIR); then mkdir $(WEBDOCDIR); fi; \
here=`cd $(srcdir) && pwd`; \
webdocdir=`cd $(WEBDOCDIR) && pwd`; \
for file in $(WEB_HTML) index.html; do \
if test -d $$here/$$file; then \
cp -pr $$here/$$file $$webdocdir/$$file; \
else \
test -f $$webdocdir/$$file \
|| ln $$here/$$file $$webdocdir/$$file 2> /dev/null \
|| cp -p $$here/$$file $$webdocdir/$$file || :; \
fi; \
done; \
if ! test -d $(WEBDOCDIR)/other; then mkdir $(WEBDOCDIR)/other; fi;\
for file in $(WEB_BIN); do \
if test -d $$here/$$file; then \
cp -pr $$here/$$file $$webdocdir/other/$$file; \
else \
test -f $$webdocdir/other/$$file \
|| ln $$here/$$file $$webdocdir/other/$$file 2> /dev/null \
|| cp -p $$here/$$file $$webdocdir/other/$$file || :; \
fi; \
done
GENDOCS=gendocs.sh
TEXI2DVI=texi2dvi
MAKEINFOFLAGS=
index.html: index.html.in $(WEBDOC)
@echo "s^%BASE_URL%^$(BASE_URL)^;" > .webdoc
@echo "s/%DATE%/`date`/;" >> .webdoc
@echo "s/%UPDATED%/`date +'%B, %d'`/;" >> .webdoc
@echo "s/%PACKAGE_NAME%/$(PACKAGE_NAME)/" >> .webdoc
@echo "s/%PACKAGE%/$(PACKAGE)/" >> .webdoc
@echo "s/%VERSION%/$(VERSION)/" >> .webdoc
@for file in `sed -n 's,.*"other/%PACKAGE%\(.*\)".*,$(PACKAGE)\1,pg;s,.*"\(.*\)%PACKAGE%\(.*\)".*,\1$(PACKAGE)\2,pg' index.html.in`; \
do\
ls -sk $$file; \
done |\
$(AWK) -vPACKAGE=$(PACKAGE) \
'BEGIN { len = length(PACKAGE) } \
{ gsub("\\.", "_", $$2); \
if (match($$2,"/")) \
$$2=substr($$2,RSTART+1); \
print "s/%" toupper(substr($$2,len+2)) "_SIZE%/" $$1 "/;" }' >> .webdoc
sed -f .webdoc index.html.in > index.html
rm -f .webdoc
# Make sure you set TEXINPUTS.
# TEXINPUTS=/usr/share/texmf/pdftex/plain/misc/ is ok for most distributions
webdocname=$(PACKAGE)-$(VERSION)-doc
WEBDOCDIR=$(webdocname)
TEXINPUTS=$(srcdir):$(top_srcdir)/scripts:$$TEXINPUTS
webdoc: $(WEBDOC) index.html
$(MAKE) WEBDOCDIR=$(top_builddir)/doc/texinfo/$(webdocname) webdocdir
cd $(top_builddir)/doc/texinfo &&\
tar cfz $(webdocname).tar.gz $(webdocname) &&\
rm -r $(webdocname)
## End of webdoc
manual:
TEXINPUTS=$(srcdir):$(top_srcdir)/scripts:$(TEXINPUTS) \
MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
TEXI2DVI="$(TEXI2DVI) -t @finalout" \
$(GENDOCS) $(PACKAGE) '$(PACKAGE_NAME) manual'
......