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