1 # Make file for Exim documentation from xfpt source.
3 notarget:; @echo "** You must specify a target, in the form x.y, where x is 'filter', 'spec',"
4 @echo "** or 'test', and y is 'xml', 'fo', 'ps', 'pdf', 'html', 'txt', or 'info'."
5 @echo "** One other possible target is 'exim.8'".
8 EPUB_DOCBOOK= /usr/local/share/xsl/docbook/epub/docbook.xsl
10 ############################# EVERYTHING ###############################
12 # Generate all the documentation files...
14 ## removed info files as I cannot generate them - spec.info filter.info
15 ## removed html files as superceded by new website code
16 everything: spec.pdf spec.ps spec.txt spec.epub \
17 filter.pdf filter.ps filter.txt filter.epub \
20 ############################## MAN PAGE ################################
22 exim.8: spec.xml x2man
25 ########################################################################
29 echo .macro version > $@
30 echo $(EXIM_VER) >> $@
32 echo .macro fulldate >> $@
33 date "+%d %b %Y" >> $@
35 echo .macro year >> $@
40 ############################### FILTER #################################
42 filter.xml: local_params filter.xfpt
45 filter-pr.xml: filter.xml Pre-xml
46 ./Pre-xml -bookinfo <filter.xml >filter-pr.xml
48 filter-txt.xml: filter.xml Pre-xml
49 ./Pre-xml -ascii -html -quoteliteral <filter.xml >filter-txt.xml
51 filter-info.xml: filter.xml Pre-xml
52 ./Pre-xml -ascii -html <filter.xml >filter-info.xml
54 filter-epub.xml: filter.xml Pre-xml
55 ./Pre-xml -epub <filter.xml >filter-epub.xml
57 filter.fo: filter-pr.xml MyStyle-filter-fo.xsl MyStyle-fo.xsl MyStyle.xsl
58 /bin/rm -rf filter.fo filter-pr.fo
59 xmlto -x MyStyle-filter-fo.xsl fo filter-pr.xml
60 /bin/mv -f filter-pr.fo filter.fo
62 # Do not use pdf2ps from the PDF version; better PS is generated directly.
65 ### PS/PDF generation using fop
68 fop-filter.ps: filter.fo
69 fop filter.fo -ps filter-tmp.ps
70 mv filter-tmp.ps filter.ps
72 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
73 # contains cross links etc.
75 fop-filter.pdf: filter.fo PageLabelPDF
76 fop filter.fo -pdf filter-tmp.pdf
77 ./PageLabelPDF 2 <filter-tmp.pdf >filter.pdf
80 ### PS/PDF generation using SDoP
83 sdop-filter.ps: filter-pr.xml
84 sdop -o filter.ps filter-pr.xml
86 sdop-filter.pdf: filter.ps
87 ps2pdf filter.ps filter.pdf
90 ### PS/PDF default setting
93 filter.ps: sdop-filter.ps
95 filter.pdf: sdop-filter.pdf
100 filter.txt: filter-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
102 /bin/rm -rf filter-txt.html
103 xmlto -x MyStyle-txt-html.xsl html-nochunks filter-txt.xml
104 w3m -dump filter-txt.html | ./Tidytxt >filter.txt
105 ./SanityTestText filter.txt
107 # I have not found a way of making docbook2texi write its output anywhere
108 # other than the file name that it makes up. The --to-stdout option does not
111 filter.info: filter-info.xml
112 docbook2texi filter-info.xml
113 perl -ne 's/conceptindex/cindex/;s/optionindex/findex/;print;' \
114 <exim_filtering.texi | ./Tidytxt >filter.texinfo
115 /bin/rm -rf exim_filtering.texi
116 makeinfo -o filter.info filter.texinfo
118 filter.epub: filter-epub.xml
121 xsltproc -o book-filter/ $(EPUB_DOCBOOK) filter-epub.xml
122 echo "application/epub+zip" > book-filter/mimetype
123 ( cd book-filter; zip -XqD ../filter.epub mimetype )
124 ( cd book-filter; zip -Xr9D ../filter.epub META-INF OEBPS )
126 ########################################################################
129 ################################ SPEC ##################################
131 spec.xml: local_params spec.xfpt
134 spec-pr.xml: spec.xml Pre-xml
135 ./Pre-xml -optbreak <spec.xml >spec-pr.xml
137 spec-txt.xml: spec.xml Pre-xml
138 ./Pre-xml -ascii -html -noindex -quoteliteral \
139 <spec.xml >spec-txt.xml
141 spec-info.xml: spec.xml Pre-xml
142 ./Pre-xml -ascii -html -noindex <spec.xml >spec-info.xml
144 spec-epub.xml: spec.xml Pre-xml
145 ./Pre-xml -epub <spec.xml >spec-epub.xml
147 spec.fo: spec-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \
149 /bin/rm -rf spec.fo spec-pr.fo
150 xmlto -x MyStyle-spec-fo.xsl fo spec-pr.xml
151 /bin/mv -f spec-pr.fo spec.fo
154 ### PS/PDF generation using fop
157 # Do not use pdf2ps from the PDF version; better PS is generated directly.
160 FOP_OPTS=-Xmx512m fop spec.fo -ps spec-tmp.ps
161 mv spec-tmp.ps spec.ps
163 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
164 # contains cross links etc. We post-process it to add page label information
165 # so that the page identifiers shown by acroread are the correct page numbers.
167 fop-spec.pdf: spec.fo PageLabelPDF
168 FOP_OPTS=-Xmx512m fop spec.fo -pdf spec-tmp.pdf
169 ./PageLabelPDF 12 <spec-tmp.pdf >spec.pdf
172 ### PS/PDF generation using SDoP
175 sdop-spec.ps: spec-pr.xml
176 sdop -o spec.ps spec-pr.xml
178 sdop-spec.pdf: spec.ps
179 ps2pdf spec.ps spec.pdf
182 ### PS/PDF default setting
185 spec.ps: sdop-spec.ps
187 spec.pdf: sdop-spec.pdf
192 spec.txt: spec-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
194 /bin/rm -rf spec-txt.html
195 xmlto -x MyStyle-txt-html.xsl html-nochunks spec-txt.xml
196 w3m -dump spec-txt.html | ./Tidytxt >spec.txt
197 ./SanityTestText spec.txt
199 # I have not found a way of making docbook2texi write its output anywhere
200 # other than the file name that it makes up. The --to-stdout option does not
203 spec.info: spec-info.xml
204 docbook2texi spec-info.xml
205 ./TidyInfo <the_exim_mta.texi >spec.texinfo
206 /bin/rm -rf the_exim_mta.texi
207 makeinfo -o spec.info --no-split spec.texinfo
209 spec.epub: spec-epub.xml
212 xsltproc -o book-spec/ $(EPUB_DOCBOOK) spec-epub.xml
213 echo "application/epub+zip" > book-spec/mimetype
214 ( cd book-spec; zip -XqD ../spec.epub mimetype )
215 ( cd book-spec; zip -Xr9D ../spec.epub META-INF OEBPS )
217 ########################################################################
220 ################################ TEST ##################################
222 # These targets (similar to the above) are for running little tests.
227 test-pr.xml: test.xml Pre-xml
228 ./Pre-xml <test.xml >test-pr.xml
230 test-html.xml: test.xml Pre-xml
231 ./Pre-xml -html -oneindex <test.xml >test-html.xml
233 test-txt.xml: test.xml Pre-xml
234 ./Pre-xml -ascii -html -noindex -quoteinfo \
235 <test.xml >test-txt.xml
237 test-info.xml: test.xml Pre-xml
238 ./Pre-xml -ascii -html -noindex <test.xml >test-info.xml
240 test.fo: test-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \
242 /bin/rm -rf test.fo test-pr.fo
243 xmlto -x MyStyle-spec-fo.xsl fo test-pr.xml
244 /bin/mv -f test-pr.fo test.fo
247 ### PS/PDF generation using fop
250 # Do not use pdf2ps from the PDF version; better PS is generated directly.
253 fop test.fo -ps test-tmp.ps
254 mv test-tmp.ps test.ps
256 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
257 # contains cross links etc.
259 fop-test.pdf: test.fo
260 fop test.fo -pdf test-tmp.pdf
261 mv test-tmp.pdf test.pdf
264 ### PS/PDF generation using SDoP
267 sdop-test.ps: test-pr.xml
268 sdop -o test.ps test-pr.xml
270 sdop-test.pdf: test.ps
271 ps2pdf test.ps test.pdf
274 ### PS/PDF default setting
277 test.ps: sdop-test.ps
279 test.pdf: sdop-test.pdf
285 test.txt: test-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
287 /bin/rm -rf test-txt.html
288 xmlto -x MyStyle-txt-html.xsl html-nochunks test-txt.xml
289 w3m -dump test-txt.html | Tidytxt >test.txt
291 # I have not found a way of making docbook2texi write its output anywhere
292 # other than the file name that it makes up. The --to-stdout option does not
295 test.info: test-info.xml
296 docbook2texi test-info.xml
297 ./TidyInfo <short_title.texi >test.texinfo
298 /bin/rm -rf short_title.texi
299 makeinfo -o test.info test.texinfo
301 ########################################################################
304 ############################## OS FIXUP ################################
306 # Yes, we've advanced so far in text processing that we now have to
307 # hardcode in complete paths and so become dependent upon exactly where
308 # files were installed for xsl:import. Which of course varies by OS.
313 ########################################################################
316 ################################ CLEAN #################################
318 clean:; /bin/rm -rf exim.8 \
319 filter*.xml spec*.xml test*.xml \
321 filter*.html spec*.html test*.html \
322 filter*.txt spec*.txt test*.txt \
323 *.info* *.texinfo *.texi
325 ########################################################################