996
|
1 #
|
|
2 # Makefile for the Intercal documentation
|
|
3 #
|
|
4
|
|
5 # Making the original manual:
|
|
6 # To see the Revised Manual, generate intercal.txt or intercal.ps
|
|
7 # To see the original INTERCAL-72 manual, generate original.txt or original.ps.
|
|
8
|
|
9 # Making the Revamped Manual:
|
|
10 # generate ick.inf, ickhtml (will be placed into a directory),
|
|
11 # ick.htm (all in one file), ick.pdf, or ick.txt.
|
|
12
|
|
13 # We make two passes in order to resolve SETR/GETNH references.
|
|
14 # The sed hackery strips the trailing dots from level 1 section references.
|
|
15
|
|
16 x.txt: x.mm
|
|
17 groff -dc=y -Tascii -p -t -mm x.mm >x.txt
|
|
18
|
|
19 all: allorig allnew
|
|
20
|
|
21 allorig: intercal.ps intercal.txt original.ps original.txt
|
|
22
|
|
23 allnew: ick.inf ickhtml ick.htm ick.txt ick.pdf
|
|
24
|
|
25 intercal.ps: intercal.mm
|
|
26 groff -dc=y -Tps -p -t -mm intercal.mm >intercal.refs.tmp
|
|
27 sed <intercal.refs.tmp -e '/hn \([0-9]*\)\.$$/s//hn \1/' >tmp.refs;
|
|
28 mv tmp.refs intercal.refs.tmp
|
|
29 groff -dc=y -Tps -p -t -mm intercal.mm >intercal.ps
|
|
30 -rm intercal.refs.qrf
|
|
31
|
|
32 original.ps: intercal.mm
|
|
33 groff -dc=n -Tps -p -t -mm intercal.mm >intercal.refs.tmp
|
|
34 sed <intercal.refs.tmp -e '/hn \([0-9]*\)\.$$/s//hn \1/' >tmp.refs;
|
|
35 mv tmp.refs intercal.refs.tmp
|
|
36 groff -dc=n -Tps -p -t -mm intercal.mm >original.ps
|
|
37 -rm intercal.refs.qrf
|
|
38
|
|
39 intercal.txt: intercal.mm
|
|
40 groff -dc=y -Tascii -p -t -mm intercal.mm >/dev/null
|
|
41 sed <intercal.refs.tmp -e '/hn \([0-9]*\)\.$$/s//hn \1/' >tmp.refs;
|
|
42 mv tmp.refs intercal.refs.tmp
|
|
43 GROFF_NO_SGR=1 groff -dc=y -Tascii -p -t -mm intercal.mm >intercal.txt
|
|
44 -rm intercal.refs.qrf
|
|
45
|
|
46 original.txt: intercal.mm
|
|
47 groff -dc=n -Tascii -p -t -mm intercal.mm >/dev/null
|
|
48 sed <intercal.refs.tmp -e '/hn \([0-9]*\)\.$$/s//hn \1/' >tmp.refs;
|
|
49 mv tmp.refs intercal.refs.tmp
|
|
50 GROFF_NO_SGR=1 groff -dc=n -Tascii -p -t -mm intercal.mm >original.txt
|
|
51 -rm intercal.refs.qrf
|
|
52
|
|
53 clean:
|
|
54 rm -f *.ps *.txt *.refs* ick.in* ick.txt ick.htm ick.pdf
|
|
55 rm -rf html
|
|
56
|
|
57 ick.inf: ick.txi fdl-1-2.txi
|
|
58 makeinfo -o ick.info ick.txi
|
|
59 -mv ick.info ick.inf
|
|
60
|
|
61 # The --css-include is skipped here because it seems to cause makeinfo
|
|
62 # to leak open file space, and it fails with an EMFILE error. Instead,
|
|
63 # fix83.pl (which changes filenames to 8.3 format, among other things)
|
|
64 # is used to add the styling. Tidy is run to clean up the output if
|
|
65 # available, but if it isn't, that isn't a problem; there will just be
|
|
66 # a harmless warning.
|
|
67 ickhtml:html/index.htm
|
|
68
|
|
69 html/index.htm: ick.txi ickstyle.css fdl-1-2.txi tidy.cfg
|
|
70 rm -rf html
|
|
71 makeinfo --html -o html ick.txi
|
|
72 ls -1 html | perl -w fix83.pl | sh
|
|
73 perl -i.tmp -w fix83.pl html/*.htm
|
|
74 chmod u+w html/*.htm
|
|
75 -tidy -config tidy.cfg -m html/*.htm || :
|
|
76 rm html/*.tmp
|
|
77
|
|
78 # fixtoc.pl is used here to reformat the TOC to look good under the
|
|
79 # multiple-part system (which makeinfo doesn't really know about).
|
|
80 ick.htm: ick.txi ickstyle.css fdl-1-2.txi tidy.cfg
|
|
81 makeinfo --html --no-split --no-header --css-include=ickstyle.css -D notsplit -o ick.htm ick.txi
|
|
82 -perl -i.tmp -w fixtoc.pl ick.htm
|
|
83 rm ick*.tmp
|
|
84 chmod u+w ick.htm
|
|
85 -tidy -config tidy.cfg -m ick.htm || :
|
|
86
|
|
87 # For some reason, ick.htm comes out of this readonly sometimes, which
|
|
88 # is why the chmod seems to be needed. No idea why, though.
|
|
89
|
|
90 ick.txt: ick.txi fdl-1-2.txi
|
|
91 makeinfo --plaintext -D notsplit -o ick.txt ick.txi
|
|
92 ick.pdf: ick.txi fdl-1-2.txi
|
|
93 -texi2dvi -b -c -e -p -q ick.txi
|