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 ############################# EVERYTHING ###############################
10 # Generate all the documentation files...
12 ## removed info files as I cannot generate them - spec.info filter.info
13 ## removed html files as superceded by new website code
14 everything: spec.pdf spec.ps spec.txt spec.epub \
15 filter.pdf filter.ps filter.txt filter.epub \
18 ############################## MAN PAGE ################################
20 exim.8: spec.xml x2man
23 ########################################################################
27 echo .macro version > $@
28 echo $(EXIM_VER) >> $@
30 echo .macro fulldate >> $@
31 date "+%d %b %Y" >> $@
33 echo .macro year >> $@
38 ############################### FILTER #################################
40 filter.xml: local_params filter.xfpt
43 filter-pr.xml: filter.xml Pre-xml
44 ./Pre-xml -bookinfo <filter.xml >filter-pr.xml
46 filter-txt.xml: filter.xml Pre-xml
47 ./Pre-xml -ascii -html -quoteliteral <filter.xml >filter-txt.xml
49 filter-info.xml: filter.xml Pre-xml
50 ./Pre-xml -ascii -html <filter.xml >filter-info.xml
52 filter-epub.xml: filter.xml Pre-xml
53 ./Pre-xml -epub <filter.xml >filter-epub.xml
55 filter.fo: filter-pr.xml MyStyle-filter-fo.xsl MyStyle-fo.xsl MyStyle.xsl
56 /bin/rm -rf filter.fo filter-pr.fo
57 xmlto -x MyStyle-filter-fo.xsl fo filter-pr.xml
58 /bin/mv -f filter-pr.fo filter.fo
60 # Do not use pdf2ps from the PDF version; better PS is generated directly.
63 ### PS/PDF generation using fop
66 fop-filter.ps: filter.fo
67 fop filter.fo -ps filter-tmp.ps
68 mv filter-tmp.ps filter.ps
70 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
71 # contains cross links etc.
73 fop-filter.pdf: filter.fo PageLabelPDF
74 fop filter.fo -pdf filter-tmp.pdf
75 ./PageLabelPDF 2 <filter-tmp.pdf >filter.pdf
78 ### PS/PDF generation using SDoP
81 sdop-filter.ps: filter-pr.xml
82 sdop -o filter.ps filter-pr.xml
84 sdop-filter.pdf: filter.ps
85 ps2pdf filter.ps filter.pdf
88 ### PS/PDF default setting
91 filter.ps: sdop-filter.ps
93 filter.pdf: sdop-filter.pdf
98 filter.txt: filter-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
100 /bin/rm -rf filter-txt.html
101 xmlto -x MyStyle-txt-html.xsl html-nochunks filter-txt.xml
102 w3m -dump filter-txt.html | ./Tidytxt >filter.txt
103 ./SanityTestText filter.txt
105 # I have not found a way of making docbook2texi write its output anywhere
106 # other than the file name that it makes up. The --to-stdout option does not
109 filter.info: filter-info.xml
110 docbook2texi filter-info.xml
111 perl -ne 's/conceptindex/cindex/;s/optionindex/findex/;print;' \
112 <exim_filtering.texi | ./Tidytxt >filter.texinfo
113 /bin/rm -rf exim_filtering.texi
114 makeinfo -o filter.info filter.texinfo
116 filter.epub: filter-epub.xml
117 xmlto epub filter-epub.xml
118 mv filter-epub.epub filter.epub
120 ########################################################################
123 ################################ SPEC ##################################
125 spec.xml: local_params spec.xfpt
128 spec-pr.xml: spec.xml Pre-xml
129 ./Pre-xml -optbreak <spec.xml >spec-pr.xml
131 spec-txt.xml: spec.xml Pre-xml
132 ./Pre-xml -ascii -html -noindex -quoteliteral \
133 <spec.xml >spec-txt.xml
135 spec-info.xml: spec.xml Pre-xml
136 ./Pre-xml -ascii -html -noindex <spec.xml >spec-info.xml
138 spec-epub.xml: spec.xml Pre-xml
139 ./Pre-xml -epub <spec.xml >spec-epub.xml
141 spec.fo: spec-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \
143 /bin/rm -rf spec.fo spec-pr.fo
144 xmlto -x MyStyle-spec-fo.xsl fo spec-pr.xml
145 /bin/mv -f spec-pr.fo spec.fo
148 ### PS/PDF generation using fop
151 # Do not use pdf2ps from the PDF version; better PS is generated directly.
154 FOP_OPTS=-Xmx512m fop spec.fo -ps spec-tmp.ps
155 mv spec-tmp.ps spec.ps
157 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
158 # contains cross links etc. We post-process it to add page label information
159 # so that the page identifiers shown by acroread are the correct page numbers.
161 fop-spec.pdf: spec.fo PageLabelPDF
162 FOP_OPTS=-Xmx512m fop spec.fo -pdf spec-tmp.pdf
163 ./PageLabelPDF 12 <spec-tmp.pdf >spec.pdf
166 ### PS/PDF generation using SDoP
169 sdop-spec.ps: spec-pr.xml
170 sdop -o spec.ps spec-pr.xml
172 sdop-spec.pdf: spec.ps
173 ps2pdf spec.ps spec.pdf
176 ### PS/PDF default setting
179 spec.ps: sdop-spec.ps
181 spec.pdf: sdop-spec.pdf
186 spec.txt: spec-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
188 /bin/rm -rf spec-txt.html
189 xmlto -x MyStyle-txt-html.xsl html-nochunks spec-txt.xml
190 w3m -dump spec-txt.html | ./Tidytxt >spec.txt
191 ./SanityTestText spec.txt
193 # I have not found a way of making docbook2texi write its output anywhere
194 # other than the file name that it makes up. The --to-stdout option does not
197 spec.info: spec-info.xml
198 docbook2texi spec-info.xml
199 ./TidyInfo <the_exim_mta.texi >spec.texinfo
200 /bin/rm -rf the_exim_mta.texi
201 makeinfo -o spec.info --no-split spec.texinfo
203 spec.epub: spec-epub.xml
204 xmlto epub spec-epub.xml
205 mv spec-epub.epub spec.epub
207 ########################################################################
210 ################################ TEST ##################################
212 # These targets (similar to the above) are for running little tests.
217 test-pr.xml: test.xml Pre-xml
218 ./Pre-xml <test.xml >test-pr.xml
220 test-html.xml: test.xml Pre-xml
221 ./Pre-xml -html -oneindex <test.xml >test-html.xml
223 test-txt.xml: test.xml Pre-xml
224 ./Pre-xml -ascii -html -noindex -quoteinfo \
225 <test.xml >test-txt.xml
227 test-info.xml: test.xml Pre-xml
228 ./Pre-xml -ascii -html -noindex <test.xml >test-info.xml
230 test.fo: test-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \
232 /bin/rm -rf test.fo test-pr.fo
233 xmlto -x MyStyle-spec-fo.xsl fo test-pr.xml
234 /bin/mv -f test-pr.fo test.fo
237 ### PS/PDF generation using fop
240 # Do not use pdf2ps from the PDF version; better PS is generated directly.
243 fop test.fo -ps test-tmp.ps
244 mv test-tmp.ps test.ps
246 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
247 # contains cross links etc.
249 fop-test.pdf: test.fo
250 fop test.fo -pdf test-tmp.pdf
251 mv test-tmp.pdf test.pdf
254 ### PS/PDF generation using SDoP
257 sdop-test.ps: test-pr.xml
258 sdop -o test.ps test-pr.xml
260 sdop-test.pdf: test.ps
261 ps2pdf test.ps test.pdf
264 ### PS/PDF default setting
267 test.ps: sdop-test.ps
269 test.pdf: sdop-test.pdf
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 \
311 filter*.html spec*.html test*.html \
312 filter*.txt spec*.txt test*.txt \
313 *.info* *.texinfo *.texi \
316 ########################################################################