Don't use ps2pdf to make PDF (or vice versa). Information is lost.
[exim.git] / doc / doc-docbook / Makefile
CommitLineData
deca074a 1# $Cambridge: exim/doc/doc-docbook/Makefile,v 1.6 2005/12/20 15:45:02 ph10 Exp $
168e428f
PH
2
3# Make file for Exim documentation from Asciidoc source.
4
5notarget:; @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'."
7 @echo "** One other possible target is 'exim.8'".
8 exit 1
9
10
11############################## MAN PAGE ################################
12
13exim.8: spec.xml
14 ./x2man
15
16########################################################################
17
18
19############################### FILTER #################################
20
21filter.xml: filter.ascd MyAsciidoc.conf
22 asciidoc -d book -b docbook -f MyAsciidoc.conf filter.ascd
23
24filter-fo.xml: filter.xml Pre-xml
25a321c8 25 ./Pre-xml -bookinfo <filter.xml >filter-fo.xml
168e428f
PH
26
27filter-html.xml: filter.xml Pre-xml
25a321c8 28 ./Pre-xml -html <filter.xml >filter-html.xml
168e428f
PH
29
30filter-txt.xml: filter.xml Pre-xml
25a321c8 31 ./Pre-xml -ascii -html <filter.xml >filter-txt.xml
168e428f
PH
32
33filter.fo: filter-fo.xml MyStyle-filter-fo.xsl MyStyle-fo.xsl MyStyle.xsl
34 /bin/rm -rf filter.fo filter-fo.fo
35 xmlto -x MyStyle-filter-fo.xsl fo filter-fo.xml
36 /bin/mv -f filter-fo.fo filter.fo
37
deca074a
PH
38# Do not use pdf2ps from the PDF version; better PS is generated directly.
39
168e428f 40filter.ps: filter.fo
068aaea8
PH
41 fop filter.fo -ps filter-tmp.ps
42 mv filter-tmp.ps filter.ps
168e428f 43
deca074a
PH
44# Do not use ps2pdf from the PS version; better PDF is generated directly. It
45# contains cross links etc.
d1e83bff 46
deca074a
PH
47filter.pdf: filter.fo
48 fop filter.fo -pdf filter-tmp.pdf
49 mv filter-tmp.pdf filter.pdf
168e428f
PH
50
51filter.html: filter-html.xml TidyHTML-filter MyStyle-nochunk-html.xsl MyStyle-html.xsl MyStyle.xsl
52 /bin/rm -rf filter.html filter-html.html
53 xmlto -x MyStyle-nochunk-html.xsl html-nochunks filter-html.xml
54 /bin/mv -f filter-html.html filter.html
068aaea8 55 ./TidyHTML-filter
168e428f
PH
56
57filter.txt: filter-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl MyStyle.xsl
58 /bin/rm -rf filter-txt.html
59 xmlto -x MyStyle-txt-html.xsl html-nochunks filter-txt.xml
60 w3m -dump filter-txt.html >filter.txt
61
62# I have not found a way of making docbook2texi write its output anywhere
63# other than the file name that it makes up. The --to-stdout option does not
64# work.
65
66filter.info: filter-txt.xml
67 docbook2texi filter-txt.xml
68 perl -ne 's/conceptindex/cindex/;s/optionindex/findex/;print;' \
69 <exim_filtering.texi | Tidytxt >filter.texinfo
70 /bin/rm -rf exim_filtering.texi
71 makeinfo -o filter.info filter.texinfo
72
73########################################################################
74
75
76################################ SPEC ##################################
77
78spec.xml: spec.ascd MyAsciidoc.conf
79 asciidoc -d book -b docbook -f MyAsciidoc.conf spec.ascd
80
81spec-fo.xml: spec.xml Pre-xml
25a321c8 82 ./Pre-xml <spec.xml >spec-fo.xml
168e428f
PH
83
84spec-html.xml: spec.xml Pre-xml
25a321c8 85 ./Pre-xml -abstract -html -oneindex <spec.xml >spec-html.xml
168e428f
PH
86
87spec-txt.xml: spec.xml Pre-xml
25a321c8 88 ./Pre-xml -abstract -ascii -html -noindex <spec.xml >spec-txt.xml
168e428f
PH
89
90spec.fo: spec-fo.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl MyTitleStyle.xsl
91 /bin/rm -rf spec.fo spec-fo.fo
92 xmlto -x MyStyle-spec-fo.xsl fo spec-fo.xml
93 /bin/mv -f spec-fo.fo spec.fo
94
deca074a
PH
95# Do not use pdf2ps from the PDF version; better PS is generated directly.
96
168e428f 97spec.ps: spec.fo
068aaea8
PH
98 FOP_OPTS=-Xmx512m fop spec.fo -ps spec-tmp.ps
99 mv spec-tmp.ps spec.ps
168e428f 100
deca074a
PH
101# Do not use ps2pdf from the PS version; better PDF is generated directly. It
102# contains cross links etc.
d1e83bff 103
deca074a
PH
104spec.pdf: spec.fo
105 FOP_OPTS=-Xmx512m fop spec.fo -pdf spec-tmp.pdf
106 mv spec-tmp.pdf spec.pdf
168e428f
PH
107
108spec.html: spec-html.xml TidyHTML-spec MyStyle-chunk-html.xsl MyStyle-html.xsl MyStyle.xsl
109 /bin/rm -rf spec.html
110 xmlto -x MyStyle-chunk-html.xsl -o spec.html html spec-html.xml
111 ./TidyHTML-spec
112
113spec.txt: spec-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl MyStyle.xsl
114 /bin/rm -rf spec-txt.html
115 xmlto -x MyStyle-txt-html.xsl html-nochunks spec-txt.xml
116 w3m -dump spec-txt.html | Tidytxt >spec.txt
117
118# I have not found a way of making docbook2texi write its output anywhere
119# other than the file name that it makes up. The --to-stdout option does not
120# work.
121
122spec.info: spec-txt.xml
123 docbook2texi spec-txt.xml
124 perl -ne 's/conceptindex/cindex/;s/optionindex/findex/;print;' \
125 <the_exim_mta.texi >spec.texinfo
126 /bin/rm -rf the_exim_mta.texi
127 makeinfo -o spec.info spec.texinfo
128
129########################################################################
130
131
132################################ TEST ##################################
133
134# These targets (similar to the above) are for running little tests.
135
136test.xml: test.ascd MyAsciidoc.conf
137 asciidoc -d book -b docbook -f MyAsciidoc.conf test.ascd
138
139test-fo.xml: test.xml Pre-xml
140 ./Pre-xml <test.xml >test-fo.xml
141
142test-html.xml: test.xml Pre-xml
068aaea8 143 ./Pre-xml -abstract -html -oneindex <test.xml >test-html.xml
168e428f
PH
144
145test-txt.xml: test.xml Pre-xml
068aaea8 146 ./Pre-xml -abstract -ascii -html -noindex <test.xml >test-txt.xml
168e428f
PH
147
148test.fo: test-fo.xml MyStyle-spec-fo.xsl MyStyle-fo.xsl MyStyle.xsl MyTitleStyle.xsl
149 /bin/rm -rf test.fo test-fo.fo
150 xmlto -x MyStyle-spec-fo.xsl fo test-fo.xml
151 /bin/mv -f test-fo.fo test.fo
152
deca074a
PH
153# Do not use pdf2ps from the PDF version; better PS is generated directly.
154
168e428f 155test.ps: test.fo
068aaea8
PH
156 fop test.fo -ps test-tmp.ps
157 mv test-tmp.ps test.ps
168e428f 158
deca074a
PH
159# Do not use ps2pdf from the PS version; better PDF is generated directly. It
160# contains cross links etc.
d1e83bff 161
deca074a
PH
162test.pdf: test.fo
163 fop test.fo -pdf test-tmp.pdf
164 mv test-tmp.pdf test.pdf
168e428f
PH
165
166test.html: test-html.xml MyStyle-nochunk-html.xsl MyStyle-html.xsl MyStyle.xsl
167 /bin/rm -rf test.html test-html.html
168 xmlto -x MyStyle-nochunk-html.xsl html-nochunks test-html.xml
169 /bin/mv -f test-html.html test.html
170
171test.txt: test-txt.xml Tidytxt MyStyle-txt-html.xsl MyStyle-html.xsl MyStyle.xsl
172 /bin/rm -rf test-txt.html
173 xmlto -x MyStyle-txt-html.xsl html-nochunks test-txt.xml
174 w3m -dump test-txt.html | Tidytxt >test.txt
175
176# I have not found a way of making docbook2texi write its output anywhere
177# other than the file name that it makes up. The --to-stdout option does not
178# work.
179
180test.info: test-txt.xml
181 docbook2texi test-txt.xml
182 perl -ne 's/conceptindex/cindex/;s/optionindex/findex/;print;' \
183 <short_title.texi >test.texinfo
184 /bin/rm -rf short_title.texi
185 makeinfo -o test.info test.texinfo
186
187########################################################################
188
189
190################################ CLEAN #################################
191
192clean:; /bin/rm -rf exim.8 \
193 filter*.xml spec*.xml test*.xml \
194 *.fo *.html *.pdf *.ps \
195 filter*.txt spec*.txt test*.txt \
196 *.info* *.texinfo *.texi
197
198########################################################################