Commit 3b485b7c 3b485b7c94ba7ec3f5473e7dbd828dd9529588a8 by Sergey Poznyakoff

Rewritten to use gendocs.sh

1 parent 15d33fdf
...@@ -71,124 +71,20 @@ SUFFIXES=.c .inc ...@@ -71,124 +71,20 @@ SUFFIXES=.c .inc
71 71
72 DISTCLEANFILES=*.pgs *.kys *.vrs 72 DISTCLEANFILES=*.pgs *.kys *.vrs
73 MAINTAINERCLEANFILES=$(INCFILES) 73 MAINTAINERCLEANFILES=$(INCFILES)
74
75 ## Web documentation
76 BASE_URL="http://www.gnu.org/software/mailutils/manual/"
77 TEXI2HTML=${SHELL} `cd $(top_srcdir); pwd`/scripts/missing --run texi2html
78 DVIPS=${SHELL} `cd $(top_srcdir); pwd`/scripts/missing --run dvips
79 INFO=${SHELL} `cd $(top_srcdir); pwd`/scripts/missing --run info
80 EXTRA_DIST = index.html.in COPYING.DOC
81
82 html: html_mono html_node html_chapter
83
84 html_node:
85 texi2html="$(TEXI2HTML)";\
86 if ! test -d html_node; then mkdir html_node; fi; \
87 cd html_node; \
88 $$texi2html -menu -split_node ../$(srcdir)/mailutils.texi
89
90 html_chapter:
91 texi2html="$(TEXI2HTML)";\
92 if ! test -d html_chapter; then mkdir html_chapter; fi; \
93 cd html_chapter; \
94 $$texi2html -menu -split_chapter ../$(srcdir)/mailutils.texi
95
96 html_mono:
97 texi2html="$(TEXI2HTML)";\
98 if ! test -d html_mono; then mkdir html_mono; fi; \
99 cd html_mono; \
100 $$texi2html -menu -monolithic ../$(srcdir)/mailutils.texi
101
102 ps: mailutils.ps
103
104 mailutils.ps: mailutils.dvi
105 $(DVIPS) -omailutils.ps mailutils.dvi
106
107 text: mailutils.text
108
109 mailutils.text: mailutils.info
110 $(INFO) --node=Top --subnodes --out mailutils.text -f mailutils.info
111
112 mailutils.info.tar.gz:
113 tar cfz mailutils.info.tar.gz mailutils.info*
114
115 mailutils.dvi.gz: mailutils.dvi
116 gzip -c mailutils.dvi > mailutils.dvi.gz
117
118 mailutils.ps.gz: mailutils.ps
119 gzip -c mailutils.ps > mailutils.ps.gz
120
121 mailutils.texi.tar.gz:
122 tar cfz mailutils.texi.tar.gz *.texi
123
124 WEB_HTML=\
125 html_mono\
126 html_node\
127 html_chapter
128
129 WEB_BIN=\
130 mailutils.info.tar.gz\
131 mailutils.dvi.gz\
132 mailutils.ps.gz\
133 mailutils.texi.tar.gz\
134 mailutils.text
135
136 CLEANFILES = $(WEB_BIN)
137 clean-local: 74 clean-local:
138 rm -rf $(WEB_HTML) 75 rm -rf manual
139
140 WEBDOC=$(WEB_HTML) $(WEB_BIN)
141 76
142 webdocdir: $(WEBDOC) index.html 77 GENDOCS=gendocs.sh
143 if ! test -d $(WEBDOCDIR); then mkdir $(WEBDOCDIR); fi; \ 78 TEXI2DVI=texi2dvi
144 here=`cd $(srcdir) && pwd`; \ 79 MAKEINFOFLAGS=
145 webdocdir=`cd $(WEBDOCDIR) && pwd`; \
146 for file in $(WEB_HTML) index.html; do \
147 if test -d $$here/$$file; then \
148 cp -pr $$here/$$file $$webdocdir/$$file; \
149 else \
150 test -f $$webdocdir/$$file \
151 || ln $$here/$$file $$webdocdir/$$file 2> /dev/null \
152 || cp -p $$here/$$file $$webdocdir/$$file || :; \
153 fi; \
154 done; \
155 if ! test -d $(WEBDOCDIR)/other; then mkdir $(WEBDOCDIR)/other; fi;\
156 for file in $(WEB_BIN); do \
157 if test -d $$here/$$file; then \
158 cp -pr $$here/$$file $$webdocdir/other/$$file; \
159 else \
160 test -f $$webdocdir/other/$$file \
161 || ln $$here/$$file $$webdocdir/other/$$file 2> /dev/null \
162 || cp -p $$here/$$file $$webdocdir/other/$$file || :; \
163 fi; \
164 done
165 80
166 index.html: index.html.in $(WEBDOC) 81 # Make sure you set TEXINPUTS.
167 @echo "s^%BASE_URL%^$(BASE_URL)^;" > .webdoc 82 # TEXINPUTS=/usr/share/texmf/pdftex/plain/misc/ is ok for most distributions
168 @echo "s/%DATE%/`date`/;" >> .webdoc
169 @echo "s/%UPDATED%/`date +'%B, %d'`/;" >> .webdoc
170 @echo "s/%PACKAGE_NAME%/$(PACKAGE_NAME)/" >> .webdoc
171 @echo "s/%PACKAGE%/$(PACKAGE)/" >> .webdoc
172 @echo "s/%VERSION%/$(VERSION)/" >> .webdoc
173 @for file in `sed -n 's,.*"other/%PACKAGE%\(.*\)".*,$(PACKAGE)\1,pg;s,.*"\(.*\)%PACKAGE%\(.*\)".*,\1$(PACKAGE)\2,pg' index.html.in`; \
174 do\
175 ls -sk $$file; \
176 done |\
177 $(AWK) -vPACKAGE=$(PACKAGE) \
178 'BEGIN { len = length(PACKAGE) } \
179 { gsub("\\.", "_", $$2); \
180 if (match($$2,"/")) \
181 $$2=substr($$2,RSTART+1); \
182 print "s/%" toupper(substr($$2,len+2)) "_SIZE%/" $$1 "/;" }' >> .webdoc
183 sed -f .webdoc index.html.in > index.html
184 rm -f .webdoc
185 83
186 webdocname=$(PACKAGE)-$(VERSION)-doc 84 TEXINPUTS=$(srcdir):$(top_srcdir)/scripts:$$TEXINPUTS
187 WEBDOCDIR=$(webdocname)
188 85
189 webdoc: $(WEBDOC) index.html 86 manual:
190 $(MAKE) WEBDOCDIR=$(top_builddir)/doc/texinfo/$(webdocname) webdocdir 87 TEXINPUTS=$(srcdir):$(top_srcdir)/scripts:$(TEXINPUTS) \
191 cd $(top_builddir)/doc/texinfo &&\ 88 MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
192 tar cfz $(webdocname).tar.gz $(webdocname) &&\ 89 TEXI2DVI="$(TEXI2DVI) -t @finalout" \
193 rm -r $(webdocname) 90 $(GENDOCS) $(PACKAGE) '$(PACKAGE_NAME) manual'
194 ## End of webdoc
......