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