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