Commit | Line | Data |
---|---|---|
9b371988 | 1 | # Make file for Exim documentation from xfpt source. |
1e1ddfac | 2 | # Copyright (c) The Exim Maintainers 2020 |
e2685613 | 3 | export LC_ALL=C |
168e428f PH |
4 | |
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'." | |
263c04a6 | 7 | @echo "** One other possible targets 'exim.8', 'spec.utf8'". |
168e428f PH |
8 | exit 1 |
9 | ||
10 | ||
207c78ae NM |
11 | ############################# EVERYTHING ############################### |
12 | # | |
13 | # Generate all the documentation files... | |
14 | # | |
4a04fa7a | 15 | ## removed info files as I cannot generate them - spec.info filter.info |
aded2255 | 16 | ## removed html files as superseded by new website code |
50023e05 NM |
17 | everything: spec.pdf spec.ps spec.txt \ |
18 | filter.pdf filter.ps filter.txt \ | |
207c78ae NM |
19 | exim.8 |
20 | ||
168e428f PH |
21 | ############################## MAN PAGE ################################ |
22 | ||
9b371988 | 23 | exim.8: spec.xml x2man |
168e428f PH |
24 | ./x2man |
25 | ||
26 | ######################################################################## | |
27 | ||
4c04137d | 28 | # .PHONY doesn't work here, because it forces a rebuild of all dependent |
263c04a6 HSHR |
29 | # targets, always. It sets the internal timestamp of its target to |
30 | # now(). | |
31 | # But it may happen that local_params does not change | |
32 | FORCE: | |
33 | local_params: FORCE GenLocalParams | |
34 | @set -e; \ | |
35 | trap 'rm -f $$tmp' EXIT; \ | |
36 | tmp=`mktemp`; \ | |
37 | ./GenLocalParams $$tmp; \ | |
9da11cd7 | 38 | cmp -s $@ $$tmp || mv -f $$tmp $@ |
168e428f PH |
39 | |
40 | ############################### FILTER ################################# | |
41 | ||
2aee48d6 | 42 | filter.xml: local_params filter.xfpt |
f89d2485 | 43 | xfpt filter.xfpt |
168e428f | 44 | |
f89d2485 PH |
45 | filter-pr.xml: filter.xml Pre-xml |
46 | ./Pre-xml -bookinfo <filter.xml >filter-pr.xml | |
168e428f | 47 | |
f89d2485 PH |
48 | filter-txt.xml: filter.xml Pre-xml |
49 | ./Pre-xml -ascii -html -quoteliteral <filter.xml >filter-txt.xml | |
9b371988 PH |
50 | |
51 | filter-info.xml: filter.xml Pre-xml | |
f89d2485 | 52 | ./Pre-xml -ascii -html <filter.xml >filter-info.xml |
168e428f | 53 | |
f89d2485 PH |
54 | filter.fo: filter-pr.xml MyStyle-filter-fo.xsl MyStyle-fo.xsl MyStyle.xsl |
55 | /bin/rm -rf filter.fo filter-pr.fo | |
56 | xmlto -x MyStyle-filter-fo.xsl fo filter-pr.xml | |
57 | /bin/mv -f filter-pr.fo filter.fo | |
168e428f | 58 | |
deca074a PH |
59 | # Do not use pdf2ps from the PDF version; better PS is generated directly. |
60 | ||
f89d2485 PH |
61 | ### |
62 | ### PS/PDF generation using fop | |
63 | ### | |
64 | ||
65 | fop-filter.ps: filter.fo | |
66 | fop filter.fo -ps filter-tmp.ps | |
67 | mv filter-tmp.ps filter.ps | |
168e428f | 68 | |
deca074a PH |
69 | # Do not use ps2pdf from the PS version; better PDF is generated directly. It |
70 | # contains cross links etc. | |
d1e83bff | 71 | |
f89d2485 PH |
72 | fop-filter.pdf: filter.fo PageLabelPDF |
73 | fop filter.fo -pdf filter-tmp.pdf | |
74 | ./PageLabelPDF 2 <filter-tmp.pdf >filter.pdf | |
75 | ||
76 | ### | |
77 | ### PS/PDF generation using SDoP | |
78 | ### | |
79 | ||
80 | sdop-filter.ps: filter-pr.xml | |
81 | sdop -o filter.ps filter-pr.xml | |
82 | ||
4aa45c31 | 83 | sdop-filter.pdf: filter.ps |
f89d2485 PH |
84 | ps2pdf filter.ps filter.pdf |
85 | ||
86 | ### | |
87 | ### PS/PDF default setting | |
88 | ### | |
89 | ||
90 | filter.ps: sdop-filter.ps | |
91 | ||
92 | filter.pdf: sdop-filter.pdf | |
93 | ||
94 | ### | |
95 | ### | |
168e428f | 96 | |
9b371988 PH |
97 | filter.txt: filter-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \ |
98 | MyStyle.xsl | |
168e428f PH |
99 | /bin/rm -rf filter-txt.html |
100 | xmlto -x MyStyle-txt-html.xsl html-nochunks filter-txt.xml | |
53d77ba6 | 101 | command -v w3m >/dev/null |
263c04a6 | 102 | LC_ALL=C w3m -dump filter-txt.html | ./Tidytxt >filter.txt |
b32a9711 | 103 | ./SanityTestText filter.txt |
168e428f PH |
104 | |
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 | |
107 | # work. | |
108 | ||
9b371988 PH |
109 | filter.info: filter-info.xml |
110 | docbook2texi filter-info.xml | |
168e428f | 111 | perl -ne 's/conceptindex/cindex/;s/optionindex/findex/;print;' \ |
207c78ae | 112 | <exim_filtering.texi | ./Tidytxt >filter.texinfo |
168e428f PH |
113 | /bin/rm -rf exim_filtering.texi |
114 | makeinfo -o filter.info filter.texinfo | |
115 | ||
116 | ######################################################################## | |
117 | ||
118 | ||
119 | ################################ SPEC ################################## | |
120 | ||
263c04a6 | 121 | spec.xml: spec.xfpt local_params |
9da11cd7 | 122 | xfpt spec.xfpt |
168e428f | 123 | |
f89d2485 PH |
124 | spec-pr.xml: spec.xml Pre-xml |
125 | ./Pre-xml -optbreak <spec.xml >spec-pr.xml | |
168e428f | 126 | |
f89d2485 PH |
127 | spec-txt.xml: spec.xml Pre-xml |
128 | ./Pre-xml -ascii -html -noindex -quoteliteral \ | |
129 | <spec.xml >spec-txt.xml | |
9b371988 PH |
130 | |
131 | spec-info.xml: spec.xml Pre-xml | |
f89d2485 PH |
132 | ./Pre-xml -ascii -html -noindex <spec.xml >spec-info.xml |
133 | ||
134 | spec.fo: spec-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \ | |
135 | MyTitleStyle.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 | |
168e428f | 139 | |
f89d2485 PH |
140 | ### |
141 | ### PS/PDF generation using fop | |
142 | ### | |
168e428f | 143 | |
deca074a PH |
144 | # Do not use pdf2ps from the PDF version; better PS is generated directly. |
145 | ||
f89d2485 | 146 | fop-spec.ps: spec.fo |
068aaea8 PH |
147 | FOP_OPTS=-Xmx512m fop spec.fo -ps spec-tmp.ps |
148 | mv spec-tmp.ps spec.ps | |
168e428f | 149 | |
deca074a | 150 | # Do not use ps2pdf from the PS version; better PDF is generated directly. It |
9b371988 PH |
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. | |
d1e83bff | 153 | |
f89d2485 | 154 | fop-spec.pdf: spec.fo PageLabelPDF |
deca074a | 155 | FOP_OPTS=-Xmx512m fop spec.fo -pdf spec-tmp.pdf |
4f578862 | 156 | ./PageLabelPDF 12 <spec-tmp.pdf >spec.pdf |
168e428f | 157 | |
f89d2485 PH |
158 | ### |
159 | ### PS/PDF generation using SDoP | |
160 | ### | |
161 | ||
162 | sdop-spec.ps: spec-pr.xml | |
163 | sdop -o spec.ps spec-pr.xml | |
164 | ||
4aa45c31 | 165 | sdop-spec.pdf: spec.ps |
f89d2485 PH |
166 | ps2pdf spec.ps spec.pdf |
167 | ||
168 | ### | |
169 | ### PS/PDF default setting | |
170 | ### | |
171 | ||
172 | spec.ps: sdop-spec.ps | |
173 | ||
174 | spec.pdf: sdop-spec.pdf | |
175 | ||
176 | ### | |
177 | ### | |
178 | ||
263c04a6 HSHR |
179 | spec-txt.html: spec-txt.xml \ |
180 | MyStyle-txt-html.xsl MyStyle-html.xsl MyStyle.xsl | |
9da11cd7 | 181 | xmlto -x MyStyle-txt-html.xsl html-nochunks spec-txt.xml |
263c04a6 HSHR |
182 | |
183 | spec.utf8: spec-txt.html Tidytxt | |
184 | @grep -iq 'LC_CTYPE=.*utf-\?8' local_params || { \ | |
185 | echo 'your current locale does not support UTF-8' >&2; \ | |
186 | false; } | |
53d77ba6 | 187 | command -v w3m >/dev/null |
9da11cd7 | 188 | w3m -dump spec-txt.html | ./Tidytxt -utf8 >$@ |
263c04a6 HSHR |
189 | |
190 | spec.txt: spec-txt.html Tidytxt | |
53d77ba6 | 191 | command -v w3m >/dev/null |
9da11cd7 | 192 | LC_ALL=C w3m -dump spec-txt.html | ./Tidytxt >$@ |
b32a9711 | 193 | ./SanityTestText spec.txt |
168e428f | 194 | |
263c04a6 | 195 | |
168e428f PH |
196 | # I have not found a way of making docbook2texi write its output anywhere |
197 | # other than the file name that it makes up. The --to-stdout option does not | |
198 | # work. | |
199 | ||
9b371988 PH |
200 | spec.info: spec-info.xml |
201 | docbook2texi spec-info.xml | |
4f578862 | 202 | ./TidyInfo <the_exim_mta.texi >spec.texinfo |
168e428f | 203 | /bin/rm -rf the_exim_mta.texi |
595028e4 | 204 | makeinfo -o spec.info --no-split spec.texinfo |
168e428f PH |
205 | |
206 | ######################################################################## | |
207 | ||
208 | ||
209 | ################################ TEST ################################## | |
210 | ||
211 | # These targets (similar to the above) are for running little tests. | |
212 | ||
9b371988 PH |
213 | test.xml: test.xfpt |
214 | xfpt test.xfpt | |
168e428f | 215 | |
f89d2485 PH |
216 | test-pr.xml: test.xml Pre-xml |
217 | ./Pre-xml <test.xml >test-pr.xml | |
168e428f PH |
218 | |
219 | test-html.xml: test.xml Pre-xml | |
9b371988 | 220 | ./Pre-xml -html -oneindex <test.xml >test-html.xml |
168e428f PH |
221 | |
222 | test-txt.xml: test.xml Pre-xml | |
9b371988 PH |
223 | ./Pre-xml -ascii -html -noindex -quoteinfo \ |
224 | <test.xml >test-txt.xml | |
225 | ||
226 | test-info.xml: test.xml Pre-xml | |
227 | ./Pre-xml -ascii -html -noindex <test.xml >test-info.xml | |
168e428f | 228 | |
f89d2485 | 229 | test.fo: test-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \ |
9b371988 | 230 | MyTitleStyle.xsl |
f89d2485 PH |
231 | /bin/rm -rf test.fo test-pr.fo |
232 | xmlto -x MyStyle-spec-fo.xsl fo test-pr.xml | |
233 | /bin/mv -f test-pr.fo test.fo | |
234 | ||
235 | ### | |
236 | ### PS/PDF generation using fop | |
237 | ### | |
168e428f | 238 | |
deca074a PH |
239 | # Do not use pdf2ps from the PDF version; better PS is generated directly. |
240 | ||
f89d2485 | 241 | fop-test.ps: test.fo |
068aaea8 PH |
242 | fop test.fo -ps test-tmp.ps |
243 | mv test-tmp.ps test.ps | |
168e428f | 244 | |
deca074a PH |
245 | # Do not use ps2pdf from the PS version; better PDF is generated directly. It |
246 | # contains cross links etc. | |
d1e83bff | 247 | |
f89d2485 | 248 | fop-test.pdf: test.fo |
deca074a PH |
249 | fop test.fo -pdf test-tmp.pdf |
250 | mv test-tmp.pdf test.pdf | |
168e428f | 251 | |
f89d2485 PH |
252 | ### |
253 | ### PS/PDF generation using SDoP | |
254 | ### | |
255 | ||
256 | sdop-test.ps: test-pr.xml | |
257 | sdop -o test.ps test-pr.xml | |
258 | ||
4aa45c31 | 259 | sdop-test.pdf: test.ps |
f89d2485 PH |
260 | ps2pdf test.ps test.pdf |
261 | ||
262 | ### | |
263 | ### PS/PDF default setting | |
264 | ### | |
265 | ||
266 | test.ps: sdop-test.ps | |
267 | ||
268 | test.pdf: sdop-test.pdf | |
269 | ||
270 | ### | |
271 | ### | |
272 | ||
273 | ||
9b371988 PH |
274 | test.txt: test-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \ |
275 | MyStyle.xsl | |
168e428f PH |
276 | /bin/rm -rf test-txt.html |
277 | xmlto -x MyStyle-txt-html.xsl html-nochunks test-txt.xml | |
53d77ba6 | 278 | command -v w3m >/dev/null |
168e428f PH |
279 | w3m -dump test-txt.html | Tidytxt >test.txt |
280 | ||
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 | |
283 | # work. | |
284 | ||
9b371988 PH |
285 | test.info: test-info.xml |
286 | docbook2texi test-info.xml | |
4f578862 | 287 | ./TidyInfo <short_title.texi >test.texinfo |
168e428f PH |
288 | /bin/rm -rf short_title.texi |
289 | makeinfo -o test.info test.texinfo | |
290 | ||
291 | ######################################################################## | |
292 | ||
293 | ||
a2119650 NM |
294 | ############################## OS FIXUP ################################ |
295 | ||
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. | |
299 | ||
300 | os-fixup: | |
301 | ./OS-Fixups | |
302 | ||
303 | ######################################################################## | |
304 | ||
305 | ||
168e428f PH |
306 | ################################ CLEAN ################################# |
307 | ||
308 | clean:; /bin/rm -rf exim.8 \ | |
309 | filter*.xml spec*.xml test*.xml \ | |
ca0ff207 TL |
310 | *.fo *.pdf *.ps \ |
311 | filter*.html spec*.html test*.html \ | |
168e428f PH |
312 | filter*.txt spec*.txt test*.txt \ |
313 | *.info* *.texinfo *.texi | |
314 | ||
315 | ######################################################################## |