Blame


1 7b4d8efb 2022-02-04 op #!/bin/sh
2 7b4d8efb 2022-02-04 op #
3 7b4d8efb 2022-02-04 op # stuff we should do in the makefile
4 7ae13e25 2022-02-04 op # but can't for portability reasons.
5 7ae13e25 2022-02-04 op # public domain
6 7b4d8efb 2022-02-04 op
7 7b4d8efb 2022-02-04 op pair()
8 7b4d8efb 2022-02-04 op {
9 7b4d8efb 2022-02-04 op files="$files $2"
10 7b4d8efb 2022-02-04 op dotfiles="\${HOME}/$1 $dotfiles"
11 6b8ba66c 2022-02-04 op xxxfiles="${2%.lp} $xxxfiles"
12 7b4d8efb 2022-02-04 op cat <<EOF >> Makefile.local
13 7b4d8efb 2022-02-04 op \${HOME}/$1: $2
14 7b4d8efb 2022-02-04 op ./lpp \$? > \$@
15 7b4d8efb 2022-02-04 op
16 7b4d8efb 2022-02-04 op EOF
17 7b4d8efb 2022-02-04 op }
18 7b4d8efb 2022-02-04 op
19 6b8ba66c 2022-02-04 op conv()
20 6b8ba66c 2022-02-04 op {
21 6b8ba66c 2022-02-04 op gemfiles="gem/$1.gmi $gemfiles"
22 6b8ba66c 2022-02-04 op wwwfiles="www/$1.html $wwwfiles"
23 6b8ba66c 2022-02-04 op cat <<EOF >> Makefile.local
24 6b8ba66c 2022-02-04 op gem/$1.gmi: $2
25 6b8ba66c 2022-02-04 op sed 's/EXT/gmi'/ $2 | ./unpar | ./gc > \$@
26 6b8ba66c 2022-02-04 op
27 6b8ba66c 2022-02-04 op www/$1.html: gem/$1.gmi header.html footer.html
28 6b8ba66c 2022-02-04 op sed 's!TITLE!$1!' header.html > \$@
29 6b8ba66c 2022-02-04 op sed 's/EXT/html/' $2 | ./unpar | ./gc | ./gem2html >> \$@
30 6b8ba66c 2022-02-04 op cat footer.html >> \$@
31 6b8ba66c 2022-02-04 op
32 6b8ba66c 2022-02-04 op EOF
33 6b8ba66c 2022-02-04 op }
34 6b8ba66c 2022-02-04 op
35 7b4d8efb 2022-02-04 op rm -f Makefile.local
36 7b4d8efb 2022-02-04 op
37 7b4d8efb 2022-02-04 op pair .profile profile.lp
38 7b4d8efb 2022-02-04 op pair .kshrc kshrc.lp
39 7b4d8efb 2022-02-04 op
40 6b8ba66c 2022-02-04 op conv index index.lp
41 7b4d8efb 2022-02-04 op for file in $files; do
42 6b8ba66c 2022-02-04 op conv "${file%.lp}" "$file"
43 7b4d8efb 2022-02-04 op done
44 7b4d8efb 2022-02-04 op
45 7b4d8efb 2022-02-04 op cat <<EOF >> Makefile.local
46 6b8ba66c 2022-02-04 op DOTFILES = $dotfiles
47 7b4d8efb 2022-02-04 op GEMFILES = $gemfiles
48 7b4d8efb 2022-02-04 op WWWFILES = $wwwfiles
49 6b8ba66c 2022-02-04 op XXXFILES = $(printf "%s\n" $xxxfiles | sort | xargs echo)
50 7b4d8efb 2022-02-04 op EOF