27bbed4f789f77eadfe33c97309d1be90dbcc075
[exim.git] / doc / doc-docbook / Makefile
1 # Make file for Exim documentation from xfpt source.
2 export LC_ALL=C
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'."
6               @echo "** One other possible targets 'exim.8', 'spec.utf8'".
7               exit 1
8
9
10 ############################# EVERYTHING ###############################
11 #
12 # Generate all the documentation files...
13 #
14 ## removed info files as I cannot generate them -  spec.info filter.info
15 ## removed html files as superseded by new website code
16 everything:             spec.pdf        spec.ps         spec.txt \
17                                 filter.pdf      filter.ps filter.txt \
18                                 exim.8
19
20 ############################## MAN PAGE ################################
21
22 exim.8:       spec.xml x2man
23               ./x2man
24
25 ########################################################################
26
27 # .PHONY doesn't work here, because it forces a rebuild of all dependent
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; \
37         cmp -s $@ $$tmp || mv -f $$tmp $@
38
39 ############################### FILTER #################################
40
41 filter.xml:      local_params filter.xfpt
42                  xfpt filter.xfpt
43
44 filter-pr.xml:   filter.xml Pre-xml
45                  ./Pre-xml -bookinfo <filter.xml >filter-pr.xml
46
47 filter-txt.xml:  filter.xml Pre-xml
48                  ./Pre-xml -ascii -html -quoteliteral <filter.xml >filter-txt.xml
49
50 filter-info.xml: filter.xml Pre-xml
51                  ./Pre-xml -ascii -html <filter.xml >filter-info.xml
52
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
57
58 # Do not use pdf2ps from the PDF version; better PS is generated directly.
59
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
67
68 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
69 # contains cross links etc.
70
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
82 sdop-filter.pdf: filter.ps
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 ###
95
96 filter.txt:   filter-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
97                 MyStyle.xsl
98               /bin/rm -rf filter-txt.html
99               xmlto -x MyStyle-txt-html.xsl html-nochunks filter-txt.xml
100               command -v w3m >/dev/null
101               LC_ALL=C w3m -dump filter-txt.html | ./Tidytxt >filter.txt
102               ./SanityTestText filter.txt
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
108 filter.info:  filter-info.xml
109               docbook2texi filter-info.xml
110               perl -ne 's/conceptindex/cindex/;s/optionindex/findex/;print;' \
111                 <exim_filtering.texi | ./Tidytxt >filter.texinfo
112               /bin/rm -rf exim_filtering.texi
113               makeinfo -o filter.info filter.texinfo
114
115 ########################################################################
116
117
118 ################################ SPEC ##################################
119
120 spec.xml:      spec.xfpt local_params
121                xfpt spec.xfpt
122
123 spec-pr.xml:   spec.xml Pre-xml
124                ./Pre-xml -optbreak <spec.xml >spec-pr.xml
125
126 spec-txt.xml:  spec.xml Pre-xml
127                ./Pre-xml -ascii -html -noindex -quoteliteral \
128                  <spec.xml >spec-txt.xml
129
130 spec-info.xml: spec.xml Pre-xml
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
138
139 ###
140 ### PS/PDF generation using fop
141 ###
142
143 # Do not use pdf2ps from the PDF version; better PS is generated directly.
144
145 fop-spec.ps:  spec.fo
146               FOP_OPTS=-Xmx512m fop spec.fo -ps spec-tmp.ps
147               mv spec-tmp.ps spec.ps
148
149 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
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.
152
153 fop-spec.pdf: spec.fo PageLabelPDF
154               FOP_OPTS=-Xmx512m fop spec.fo -pdf spec-tmp.pdf
155               ./PageLabelPDF 12 <spec-tmp.pdf >spec.pdf
156
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
164 sdop-spec.pdf: spec.ps
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
178 spec-txt.html:     spec-txt.xml \
179                 MyStyle-txt-html.xsl MyStyle-html.xsl MyStyle.xsl
180               xmlto -x MyStyle-txt-html.xsl html-nochunks spec-txt.xml
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; }
186                 command -v w3m >/dev/null
187                 w3m -dump spec-txt.html | ./Tidytxt -utf8 >$@
188
189 spec.txt: spec-txt.html Tidytxt
190               command -v w3m >/dev/null
191               LC_ALL=C w3m -dump spec-txt.html | ./Tidytxt >$@
192               ./SanityTestText spec.txt
193
194
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
199 spec.info:    spec-info.xml
200               docbook2texi spec-info.xml
201               ./TidyInfo <the_exim_mta.texi >spec.texinfo
202               /bin/rm -rf the_exim_mta.texi
203               makeinfo -o spec.info --no-split spec.texinfo
204
205 ########################################################################
206
207
208 ################################ TEST ##################################
209
210 # These targets (similar to the above)  are for running little tests.
211
212 test.xml:     test.xfpt
213               xfpt test.xfpt
214
215 test-pr.xml:  test.xml Pre-xml
216               ./Pre-xml <test.xml >test-pr.xml
217
218 test-html.xml: test.xml Pre-xml
219               ./Pre-xml -html -oneindex <test.xml >test-html.xml
220
221 test-txt.xml: test.xml Pre-xml
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
227
228 test.fo:      test-pr.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl \
229                 MyTitleStyle.xsl
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 ###
237
238 # Do not use pdf2ps from the PDF version; better PS is generated directly.
239
240 fop-test.ps:  test.fo
241               fop test.fo -ps test-tmp.ps
242               mv test-tmp.ps test.ps
243
244 # Do not use ps2pdf from the PS version; better PDF is generated directly. It
245 # contains cross links etc.
246
247 fop-test.pdf: test.fo
248               fop test.fo -pdf test-tmp.pdf
249               mv test-tmp.pdf test.pdf
250
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
258 sdop-test.pdf: test.ps
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
273 test.txt:     test-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl \
274                 MyStyle.xsl
275               /bin/rm -rf test-txt.html
276               xmlto -x MyStyle-txt-html.xsl html-nochunks test-txt.xml
277               command -v w3m >/dev/null
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
284 test.info:    test-info.xml
285               docbook2texi test-info.xml
286               ./TidyInfo <short_title.texi >test.texinfo
287               /bin/rm -rf short_title.texi
288               makeinfo -o test.info test.texinfo
289
290 ########################################################################
291
292
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
305 ################################ CLEAN #################################
306
307 clean:; /bin/rm -rf exim.8 \
308               filter*.xml spec*.xml test*.xml \
309               *.fo *.pdf *.ps \
310               filter*.html spec*.html test*.html \
311               filter*.txt spec*.txt test*.txt \
312               *.info* *.texinfo *.texi
313
314 ########################################################################