]> Dogcows Code - chaz/tar/blob - doc/Makefile.am
Rewritten. Added rules for generating documentation for the project's website.
[chaz/tar] / doc / Makefile.am
1 # Makefile for GNU tar documentation.
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003 Free
4 # Software Foundation, Inc.
5
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 2, or (at your option)
9 ## any later version.
10
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ## GNU General Public License for more details.
15
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software Foundation,
18 ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 info_TEXINFOS = tar.texi
21 tar_TEXINFOS = fdl.texi freemanuals.texi getdate.texi header.texi
22 EXTRA_DIST = convtexi.pl
23
24 CLEANFILES = tmp-* tmp2-* index.html
25
26 # The rendering level is anyone of PUBLISH, DISTRIB or PROOF.
27 # Just call `make dvi RENDITION=PROOF' if you want PROOF rendition.
28 RENDITION = DISTRIB
29
30 $(srcdir)/tar.info: tar.texi fdl.texi freemanuals.texi getdate.texi \
31 $(srcdir)/header.texi version.texi
32 $(MAKEINFO) --no-split -D$(RENDITION) -I$(srcdir) tar.texi -o $@
33
34 tmp-tar.texi: tar.texi getdate.texi $(srcdir)/header.texi version.texi
35 $(MAKEINFO) -D$(RENDITION) -Etmp-tar.tmp -otmp-tar.info \
36 -I$(srcdir) tar.texi
37 rm -f tmp-tar.sed tmp-tar.info*
38 test $(RENDITION) = DISTRIB \
39 || echo >>tmp-tar.sed 's/^@set DISTRIB/@set $(RENDITION)/'
40 test $(RENDITION) = PUBLISH \
41 || echo >>tmp-tar.sed '/^@smallbook/d'
42 sed -f tmp-tar.sed tmp-tar.tmp > tmp-tar.texi
43 rm -f tmp-tar.sed tmp-tar.tmp
44
45 tar.dvi: tmp-tar.texi
46 TEXINPUTS=$(top_srcdir)/config:$$TEXINPUTS \
47 MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
48 $(TEXI2DVI) tmp-tar.texi
49 mv tmp-tar.dvi $@
50
51 $(srcdir)/header.texi: $(top_srcdir)/src/tar.h
52 sed -n '/Archive Format/,/End of Format/p' $(top_srcdir)/src/tar.h \
53 | expand | sed 's/\([{}]\)/@\1/g' >$@
54
55 ##
56 PROJECT=$(PACKAGE_TARNAME)
57 BASE_URL="http://www.gnu.org/software/$(PROJECT)/manual/"
58 TEXI2HTML=${SHELL} `cd $(top_srcdir); pwd`/config/missing --run texi2html
59 INFO=${SHELL} `cd $(top_srcdir); pwd`/config/missing --run info
60 DVIPDF=${SHELL} `cd $(top_srcdir); pwd`/config/missing --run dvipdf
61
62 clean-local:
63 rm -rf $(WEBDOC) $(WEB_HTML_STAMPS)
64
65 html: html_mono.stamp html_node.stamp html_chapter.stamp
66
67 tmp2-$(PROJECT).texi: Makefile tmp-$(PROJECT).texi
68 echo '/@copying/,/@end copying/{H;x;s/@copying//;s/@end copying//;x;}' > tmp2.sed
69 echo '/@insertcopying/{x;h;}' >> tmp2.sed
70 echo 's/\(.\)@ifset/\1\' >> tmp2.sed
71 echo '@ifset/' >> tmp2.sed
72 sed -f tmp2.sed tmp-$(PROJECT).texi > tmp2-$(PROJECT).texi
73 rm -f tmp2.sed
74
75 html_node.stamp: tmp2-$(PROJECT).texi
76 texi2html="$(TEXI2HTML)";\
77 if ! test -d html_node; then mkdir html_node; fi; \
78 cd html_node; \
79 $$texi2html -menu -split_node -prefix $(PROJECT) ../tmp2-$(PROJECT).texi; \
80 cd ..; \
81 touch html_node.stamp
82
83 html_chapter.stamp: tmp2-$(PROJECT).texi
84 texi2html="$(TEXI2HTML)";\
85 if ! test -d html_chapter; then mkdir html_chapter; fi; \
86 cd html_chapter; \
87 $$texi2html -menu -split_chapter -prefix $(PROJECT) ../tmp2-$(PROJECT).texi; \
88 cd ..; \
89 touch html_chapter.stamp
90
91 html_mono.stamp: tmp2-$(PROJECT).texi
92 texi2html="$(TEXI2HTML)";\
93 if ! test -d html_mono; then mkdir html_mono; fi; \
94 cd html_mono; \
95 $$texi2html -menu -monolithic -prefix $(PROJECT) ../tmp2-$(PROJECT).texi; \
96 cd ..; \
97 touch html_mono.stamp
98
99 ps: $(PROJECT).ps
100
101 $(PROJECT).ps: $(PROJECT).dvi
102 $(DVIPS) -o$(PROJECT).ps $(PROJECT).dvi
103
104 # Override the default rule. The texinfo <= 4.5 is unable to cope with
105 # tar docs.
106 $(PROJECT).pdf: $(PROJECT).dvi
107 $(DVIPDF) $(PROJECT).dvi
108
109 text: $(PROJECT).text
110
111 $(PROJECT).text: Makefile $(PROJECT).info
112 $(INFO) --node=Top --subnodes --out $(PROJECT).text -f $(PROJECT).info
113
114 $(PROJECT).info.tar.gz: Makefile
115 rm -f $(PROJECT).info.tar.gz
116 tar cf $(PROJECT).info.tar $(PROJECT).info*
117 gzip -f $(PROJECT).info.tar
118
119 $(PROJECT).dvi.gz: Makefile $(PROJECT).dvi
120 gzip -c $(PROJECT).dvi > $(PROJECT).dvi.gz
121
122 $(PROJECT).ps.gz: Makefile $(PROJECT).ps
123 gzip -c $(PROJECT).ps > $(PROJECT).ps.gz
124
125 $(PROJECT).pdf.gz: Makefile $(PROJECT).pdf
126 gzip -c $(PROJECT).pdf > $(PROJECT).pdf.gz
127
128 $(PROJECT).texi.tar.gz: Makefile $(info_TEXINFOS) $(tar_TEXINFOS)
129 tar cfz $(PROJECT).texi.tar.gz $(info_TEXINFOS) $(tar_TEXINFOS)
130
131 WEB_HTML=\
132 html_mono\
133 html_node\
134 html_chapter
135
136 WEB_HTML_STAMPS=$(patsubst %,%.stamp,$(WEB_HTML))
137
138 WEB_BIN=\
139 $(PROJECT).info.tar.gz\
140 $(PROJECT).dvi.gz\
141 $(PROJECT).pdf.gz\
142 $(PROJECT).ps.gz\
143 $(PROJECT).texi.tar.gz\
144 $(PROJECT).text
145
146 WEBDOC=$(WEB_HTML) $(WEB_BIN)
147
148 webdocdir: $(WEB_HTML_STAMPS) $(WEB_BIN) index.html
149 if ! test -d $(WEBDOCDIR); then mkdir $(WEBDOCDIR); fi; \
150 here=`cd $(srcdir) && pwd`; \
151 webdocdir=`cd $(WEBDOCDIR) && pwd`; \
152 for file in $(WEB_HTML) index.html; do \
153 if test -d $$here/$$file; then \
154 cp -pr $$here/$$file $$webdocdir/$$file; \
155 else \
156 test -f $$webdocdir/$$file \
157 || ln $$here/$$file $$webdocdir/$$file 2> /dev/null \
158 || cp -p $$here/$$file $$webdocdir/$$file || :; \
159 fi; \
160 done; \
161 if ! test -d $(WEBDOCDIR)/other; then mkdir $(WEBDOCDIR)/other; fi;\
162 for file in $(WEB_BIN); do \
163 if test -d $$here/$$file; then \
164 cp -pr $$here/$$file $$webdocdir/other/$$file; \
165 else \
166 test -f $$webdocdir/other/$$file \
167 || ln $$here/$$file $$webdocdir/other/$$file 2> /dev/null \
168 || cp -p $$here/$$file $$webdocdir/other/$$file || :; \
169 fi; \
170 done
171
172 index.html: index.html.in $(WEBDOC)
173 @echo "s^%BASE_URL%^$(BASE_URL)^;" > .webdoc
174 @echo "s/%DATE%/`date`/;" >> .webdoc
175 @echo "s/%UPDATED%/`date +'%B, %d'`/;" >> .webdoc
176 @echo "s/%PACKAGE_NAME%/$(PACKAGE_NAME)/" >> .webdoc
177 @echo "s/%PACKAGE%/$(PACKAGE)/" >> .webdoc
178 @echo "s/%VERSION%/$(VERSION)/" >> .webdoc
179 @for file in `sed -n 's,.*"other/%PACKAGE%\(.*\)".*,$(PACKAGE)\1,pg;s,.*"\(.*\)%PACKAGE%\(.*\)".*,\1$(PACKAGE)\2,pg' index.html.in`; \
180 do\
181 ls -sk $$file; \
182 done |\
183 $(AWK) -vPACKAGE=$(PACKAGE) \
184 'BEGIN { len = length(PACKAGE) } \
185 { gsub("\\.", "_", $$2); \
186 if (match($$2,"/")) \
187 $$2=substr($$2,RSTART+1); \
188 print "s/%" toupper(substr($$2,len+2)) "_SIZE%/" $$1 "/;" }' >> .webdoc
189 sed -f .webdoc index.html.in > index.html
190 rm -f .webdoc
191
192 webdocname=$(PACKAGE)-$(VERSION)-doc
193 WEBDOCDIR=$(webdocname)
194
195 webdoc:
196 $(MAKE) RENDITION=PUBLISH WEBDOCDIR=$(top_builddir)/doc/$(webdocname) webdocdir
197 cd $(top_builddir)/doc &&\
198 tar cfz $(webdocname).tar.gz $(webdocname) &&\
199 rm -r $(webdocname)
200
201 ## End of webdoc
202
This page took 0.048972 seconds and 5 git commands to generate.