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 targets 'exim.8', 'spec.utf8'".
9 ############################# EVERYTHING ###############################
11 # Generate all the documentation files...
13 ## removed info files as I cannot generate them - spec.info filter.info
14 ## removed html files as superseded by new website code
15 everything: spec.pdf spec.ps spec.txt \
16 filter.pdf filter.ps filter.txt \
19 ############################## MAN PAGE ################################
21 exim.8: spec.xml x2man
24 ########################################################################
26 # .PHONY doesn't work here, because it forces a rebuild of all dependent
27 # targets, always. It sets the internal timestamp of its target to
29 # But it may happen that local_params does not change
31 local_params: FORCE GenLocalParams
33 trap 'rm -f $$tmp' EXIT; \
35 ./GenLocalParams $$tmp; \
36 cmp -s $@ $$tmp || mv $$tmp $@
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.fo: filter-pr.xml MyStyle-filter-fo.xsl MyStyle-fo.xsl MyStyle.xsl
53 /bin/rm -rf filter.fo filter-pr.fo
54 xmlto -x MyStyle-filter-fo.xsl fo filter-pr.xml
55 /bin/mv -f filter-pr.fo filter.fo
57 # Do not use pdf2ps from the PDF version; better PS is generated directly.
60 ### PS/PDF generation using fop
63 fop-filter.ps: filter.fo
64 fop filter.fo -ps filter-tmp.ps
65 mv filter-tmp.ps filter.ps
67 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
68 # contains cross links etc.
70 fop-filter.pdf: filter.fo PageLabelPDF
71 fop filter.fo -pdf filter-tmp.pdf
72 ./PageLabelPDF 2 <filter-tmp.pdf >filter.pdf
75 ### PS/PDF generation using SDoP
78 sdop-filter.ps: filter-pr.xml
79 sdop -o filter.ps filter-pr.xml
81 sdop-filter.pdf: filter.ps
82 ps2pdf filter.ps filter.pdf
85 ### PS/PDF default setting
88 filter.ps: sdop-filter.ps
90 filter.pdf: sdop-filter.pdf
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 command -v w3m >/dev/null
100 LC_ALL=C w3m -dump filter-txt.html | ./Tidytxt >filter.txt
101 ./SanityTestText filter.txt
103 # I have not found a way of making docbook2texi write its output anywhere
104 # other than the file name that it makes up. The --to-stdout option does not
107 filter.info: filter-info.xml
108 docbook2texi filter-info.xml
109 perl -ne 's/conceptindex/cindex/;s/optionindex/findex/;print;' \
110 <exim_filtering.texi | ./Tidytxt >filter.texinfo
111 /bin/rm -rf exim_filtering.texi
112 makeinfo -o filter.info filter.texinfo
114 ########################################################################
117 ################################ SPEC ##################################
119 spec.xml: spec.xfpt local_params
122 spec-pr.xml: spec.xml Pre-xml
123 ./Pre-xml -optbreak <spec.xml >spec-pr.xml
125 spec-txt.xml: spec.xml Pre-xml
126 ./Pre-xml -ascii -html -noindex -quoteliteral \
127 <spec.xml >spec-txt.xml
129 spec-info.xml: spec.xml Pre-xml
130 ./Pre-xml -ascii -html -noindex <spec.xml >spec-info.xml
132 spec.fo: spec-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \
134 /bin/rm -rf spec.fo spec-pr.fo
135 xmlto -x MyStyle-spec-fo.xsl fo spec-pr.xml
136 /bin/mv -f spec-pr.fo spec.fo
139 ### PS/PDF generation using fop
142 # Do not use pdf2ps from the PDF version; better PS is generated directly.
145 FOP_OPTS=-Xmx512m fop spec.fo -ps spec-tmp.ps
146 mv spec-tmp.ps spec.ps
148 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
149 # contains cross links etc. We post-process it to add page label information
150 # so that the page identifiers shown by acroread are the correct page numbers.
152 fop-spec.pdf: spec.fo PageLabelPDF
153 FOP_OPTS=-Xmx512m fop spec.fo -pdf spec-tmp.pdf
154 ./PageLabelPDF 12 <spec-tmp.pdf >spec.pdf
157 ### PS/PDF generation using SDoP
160 sdop-spec.ps: spec-pr.xml
161 sdop -o spec.ps spec-pr.xml
163 sdop-spec.pdf: spec.ps
164 ps2pdf spec.ps spec.pdf
167 ### PS/PDF default setting
170 spec.ps: sdop-spec.ps
172 spec.pdf: sdop-spec.pdf
177 spec-txt.html: spec-txt.xml \
178 MyStyle-txt-html.xsl MyStyle-html.xsl MyStyle.xsl
179 xmlto -x MyStyle-txt-html.xsl html-nochunks $<
181 spec.utf8: spec-txt.html Tidytxt
182 @grep -iq 'LC_CTYPE=.*utf-\?8' local_params || { \
183 echo 'your current locale does not support UTF-8' >&2; \
185 command -v w3m >/dev/null
186 w3m -dump $< | ./Tidytxt -utf8 >$@
188 spec.txt: spec-txt.html Tidytxt
189 command -v w3m >/dev/null
190 LC_ALL=C w3m -dump $< | ./Tidytxt >$@
191 ./SanityTestText spec.txt
194 # I have not found a way of making docbook2texi write its output anywhere
195 # other than the file name that it makes up. The --to-stdout option does not
198 spec.info: spec-info.xml
199 docbook2texi spec-info.xml
200 ./TidyInfo <the_exim_mta.texi >spec.texinfo
201 /bin/rm -rf the_exim_mta.texi
202 makeinfo -o spec.info --no-split spec.texinfo
204 ########################################################################
207 ################################ TEST ##################################
209 # These targets (similar to the above) are for running little tests.
214 test-pr.xml: test.xml Pre-xml
215 ./Pre-xml <test.xml >test-pr.xml
217 test-html.xml: test.xml Pre-xml
218 ./Pre-xml -html -oneindex <test.xml >test-html.xml
220 test-txt.xml: test.xml Pre-xml
221 ./Pre-xml -ascii -html -noindex -quoteinfo \
222 <test.xml >test-txt.xml
224 test-info.xml: test.xml Pre-xml
225 ./Pre-xml -ascii -html -noindex <test.xml >test-info.xml
227 test.fo: test-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \
229 /bin/rm -rf test.fo test-pr.fo
230 xmlto -x MyStyle-spec-fo.xsl fo test-pr.xml
231 /bin/mv -f test-pr.fo test.fo
234 ### PS/PDF generation using fop
237 # Do not use pdf2ps from the PDF version; better PS is generated directly.
240 fop test.fo -ps test-tmp.ps
241 mv test-tmp.ps test.ps
243 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
244 # contains cross links etc.
246 fop-test.pdf: test.fo
247 fop test.fo -pdf test-tmp.pdf
248 mv test-tmp.pdf test.pdf
251 ### PS/PDF generation using SDoP
254 sdop-test.ps: test-pr.xml
255 sdop -o test.ps test-pr.xml
257 sdop-test.pdf: test.ps
258 ps2pdf test.ps test.pdf
261 ### PS/PDF default setting
264 test.ps: sdop-test.ps
266 test.pdf: sdop-test.pdf
272 test.txt: test-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
274 /bin/rm -rf test-txt.html
275 xmlto -x MyStyle-txt-html.xsl html-nochunks test-txt.xml
276 command -v w3m >/dev/null
277 w3m -dump test-txt.html | Tidytxt >test.txt
279 # I have not found a way of making docbook2texi write its output anywhere
280 # other than the file name that it makes up. The --to-stdout option does not
283 test.info: test-info.xml
284 docbook2texi test-info.xml
285 ./TidyInfo <short_title.texi >test.texinfo
286 /bin/rm -rf short_title.texi
287 makeinfo -o test.info test.texinfo
289 ########################################################################
292 ############################## OS FIXUP ################################
294 # Yes, we've advanced so far in text processing that we now have to
295 # hardcode in complete paths and so become dependent upon exactly where
296 # files were installed for xsl:import. Which of course varies by OS.
301 ########################################################################
304 ################################ CLEAN #################################
306 clean:; /bin/rm -rf exim.8 \
307 filter*.xml spec*.xml test*.xml \
309 filter*.html spec*.html test*.html \
310 filter*.txt spec*.txt test*.txt \
311 *.info* *.texinfo *.texi
313 ########################################################################