1 # $Cambridge: exim/doc/doc-docbook/Makefile,v 1.14 2010/05/28 15:38:18 nm4 Exp $
3 # Make file for Exim documentation from xfpt source.
5 notarget:; @echo "** You must specify a target, in the form x.y, where x is 'filter', 'spec',"
6 @echo "** or 'test', and y is 'xml', 'fo', 'ps', 'pdf', 'html', 'txt', or 'info'."
7 @echo "** One other possible target is 'exim.8'".
11 ############################# EVERYTHING ###############################
13 # Generate all the documentation files...
15 ## removed info files as I cannot generate them - spec.info filter.info
16 everything: spec.pdf spec.ps spec.html spec.txt \
17 filter.pdf filter.ps filter.html filter.txt \
20 ############################## MAN PAGE ################################
22 exim.8: spec.xml x2man
25 ########################################################################
28 ############################### FILTER #################################
30 filter.xml: filter.xfpt
33 filter-pr.xml: filter.xml Pre-xml
34 ./Pre-xml -bookinfo <filter.xml >filter-pr.xml
36 filter-html.xml: filter.xml Pre-xml
37 ./Pre-xml -html <filter.xml >filter-html.xml
39 filter-txt.xml: filter.xml Pre-xml
40 ./Pre-xml -ascii -html -quoteliteral <filter.xml >filter-txt.xml
42 filter-info.xml: filter.xml Pre-xml
43 ./Pre-xml -ascii -html <filter.xml >filter-info.xml
45 filter.fo: filter-pr.xml MyStyle-filter-fo.xsl MyStyle-fo.xsl MyStyle.xsl
46 /bin/rm -rf filter.fo filter-pr.fo
47 xmlto -x MyStyle-filter-fo.xsl fo filter-pr.xml
48 /bin/mv -f filter-pr.fo filter.fo
50 # Do not use pdf2ps from the PDF version; better PS is generated directly.
53 ### PS/PDF generation using fop
56 fop-filter.ps: filter.fo
57 fop filter.fo -ps filter-tmp.ps
58 mv filter-tmp.ps filter.ps
60 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
61 # contains cross links etc.
63 fop-filter.pdf: filter.fo PageLabelPDF
64 fop filter.fo -pdf filter-tmp.pdf
65 ./PageLabelPDF 2 <filter-tmp.pdf >filter.pdf
68 ### PS/PDF generation using SDoP
71 sdop-filter.ps: filter-pr.xml
72 sdop -o filter.ps filter-pr.xml
74 sdop-filter.pdf: filter.ps
75 ps2pdf filter.ps filter.pdf
78 ### PS/PDF default setting
81 filter.ps: sdop-filter.ps
83 filter.pdf: sdop-filter.pdf
88 filter.html: filter-html.xml TidyHTML-filter MyStyle-nochunk-html.xsl \
89 MyStyle-html.xsl MyStyle.xsl
90 /bin/rm -rf filter.html filter-html.html
91 xmlto -x MyStyle-nochunk-html.xsl html-nochunks filter-html.xml
92 /bin/mv -f filter-html.html filter.html
95 filter.txt: filter-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
97 /bin/rm -rf filter-txt.html
98 xmlto -x MyStyle-txt-html.xsl html-nochunks filter-txt.xml
99 w3m -dump filter-txt.html | ./Tidytxt >filter.txt
101 # I have not found a way of making docbook2texi write its output anywhere
102 # other than the file name that it makes up. The --to-stdout option does not
105 filter.info: filter-info.xml
106 docbook2texi filter-info.xml
107 perl -ne 's/conceptindex/cindex/;s/optionindex/findex/;print;' \
108 <exim_filtering.texi | ./Tidytxt >filter.texinfo
109 /bin/rm -rf exim_filtering.texi
110 makeinfo -o filter.info filter.texinfo
112 ########################################################################
115 ################################ SPEC ##################################
120 spec-pr.xml: spec.xml Pre-xml
121 ./Pre-xml -optbreak <spec.xml >spec-pr.xml
123 spec-html.xml: spec.xml Pre-xml
124 ./Pre-xml -html -oneindex \
125 <spec.xml >spec-html.xml
127 spec-txt.xml: spec.xml Pre-xml
128 ./Pre-xml -ascii -html -noindex -quoteliteral \
129 <spec.xml >spec-txt.xml
131 spec-info.xml: spec.xml Pre-xml
132 ./Pre-xml -ascii -html -noindex <spec.xml >spec-info.xml
134 spec.fo: spec-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \
136 /bin/rm -rf spec.fo spec-pr.fo
137 xmlto -x MyStyle-spec-fo.xsl fo spec-pr.xml
138 /bin/mv -f spec-pr.fo spec.fo
141 ### PS/PDF generation using fop
144 # Do not use pdf2ps from the PDF version; better PS is generated directly.
147 FOP_OPTS=-Xmx512m fop spec.fo -ps spec-tmp.ps
148 mv spec-tmp.ps spec.ps
150 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
151 # contains cross links etc. We post-process it to add page label information
152 # so that the page identifiers shown by acroread are the correct page numbers.
154 fop-spec.pdf: spec.fo PageLabelPDF
155 FOP_OPTS=-Xmx512m fop spec.fo -pdf spec-tmp.pdf
156 ./PageLabelPDF 12 <spec-tmp.pdf >spec.pdf
159 ### PS/PDF generation using SDoP
162 sdop-spec.ps: spec-pr.xml
163 sdop -o spec.ps spec-pr.xml
165 sdop-spec.pdf: spec.ps
166 ps2pdf spec.ps spec.pdf
169 ### PS/PDF default setting
172 spec.ps: sdop-spec.ps
174 spec.pdf: sdop-spec.pdf
179 spec.html: spec-html.xml TidyHTML-spec MyStyle-chunk-html.xsl \
180 MyStyle-html.xsl MyStyle.xsl
181 /bin/rm -rf spec_html
182 xmlto -x MyStyle-chunk-html.xsl -o spec_html html spec-html.xml
185 spec.txt: spec-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
187 /bin/rm -rf spec-txt.html
188 xmlto -x MyStyle-txt-html.xsl html-nochunks spec-txt.xml
189 w3m -dump spec-txt.html | ./Tidytxt >spec.txt
191 # I have not found a way of making docbook2texi write its output anywhere
192 # other than the file name that it makes up. The --to-stdout option does not
195 spec.info: spec-info.xml
196 docbook2texi spec-info.xml
197 ./TidyInfo <the_exim_mta.texi >spec.texinfo
198 /bin/rm -rf the_exim_mta.texi
199 makeinfo -o spec.info --no-split spec.texinfo
201 ########################################################################
204 ################################ TEST ##################################
206 # These targets (similar to the above) are for running little tests.
211 test-pr.xml: test.xml Pre-xml
212 ./Pre-xml <test.xml >test-pr.xml
214 test-html.xml: test.xml Pre-xml
215 ./Pre-xml -html -oneindex <test.xml >test-html.xml
217 test-txt.xml: test.xml Pre-xml
218 ./Pre-xml -ascii -html -noindex -quoteinfo \
219 <test.xml >test-txt.xml
221 test-info.xml: test.xml Pre-xml
222 ./Pre-xml -ascii -html -noindex <test.xml >test-info.xml
224 test.fo: test-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \
226 /bin/rm -rf test.fo test-pr.fo
227 xmlto -x MyStyle-spec-fo.xsl fo test-pr.xml
228 /bin/mv -f test-pr.fo test.fo
231 ### PS/PDF generation using fop
234 # Do not use pdf2ps from the PDF version; better PS is generated directly.
237 fop test.fo -ps test-tmp.ps
238 mv test-tmp.ps test.ps
240 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
241 # contains cross links etc.
243 fop-test.pdf: test.fo
244 fop test.fo -pdf test-tmp.pdf
245 mv test-tmp.pdf test.pdf
248 ### PS/PDF generation using SDoP
251 sdop-test.ps: test-pr.xml
252 sdop -o test.ps test-pr.xml
254 sdop-test.pdf: test.ps
255 ps2pdf test.ps test.pdf
258 ### PS/PDF default setting
261 test.ps: sdop-test.ps
263 test.pdf: sdop-test.pdf
269 test.html: test-html.xml MyStyle-nochunk-html.xsl MyStyle-html.xsl \
271 /bin/rm -rf test.html test-html.html
272 xmlto -x MyStyle-nochunk-html.xsl html-nochunks test-html.xml
273 /bin/mv -f test-html.html test.html
275 test.txt: test-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
277 /bin/rm -rf test-txt.html
278 xmlto -x MyStyle-txt-html.xsl html-nochunks test-txt.xml
279 w3m -dump test-txt.html | Tidytxt >test.txt
281 # I have not found a way of making docbook2texi write its output anywhere
282 # other than the file name that it makes up. The --to-stdout option does not
285 test.info: test-info.xml
286 docbook2texi test-info.xml
287 ./TidyInfo <short_title.texi >test.texinfo
288 /bin/rm -rf short_title.texi
289 makeinfo -o test.info test.texinfo
291 ########################################################################
294 ############################## OS FIXUP ################################
296 # Yes, we've advanced so far in text processing that we now have to
297 # hardcode in complete paths and so become dependent upon exactly where
298 # files were installed for xsl:import. Which of course varies by OS.
303 ########################################################################
306 ################################ CLEAN #################################
308 clean:; /bin/rm -rf exim.8 \
309 filter*.xml spec*.xml test*.xml \
310 *.fo *.html *.pdf *.ps \
311 filter*.txt spec*.txt test*.txt \
312 *.info* *.texinfo *.texi
314 ########################################################################