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