xref: /plan9/sys/lib/man/permind/mkfile (revision b873a79ae9b6942791b873dd7fa2c27224798319)
1BUILTINS=
2< /$objtype/mkfile
3< /sys/man/fonts
4
5out: permindex dopermind mac
6	dopermind > out
7
8permindex:V: $O.ptx1
9	rm -f junk*
10	for (i in /sys/man/[0-9])
11		makind1 $i >> junk0
12	sed 's/0intro/intro/g
13	s/  +/ /g
14	s/ +$//' junk0 > junk1
15	$O.ptx1 -f -w 5.3i -g 0.1i -h 3n -c '.ps 8
16	.fp 1 R LucidaSans
17	.ft 1' -i ignore -b bfile -r junk1 >junk2
18	awk -f dup2.awk junk2 | awk -f dup1.awk | sort -dfut'"' +5 -6 +1 -2 +8 +0 >junk3
19	mv junk3 junk2
20	awk -f dup2.awk junk2 | awk -f dup1.awk | sort -dfut'"' +5 -6 +1 -2 +8 +0 >junk3
21	mv junk3 junk2
22	awk -f dup2.awk junk2 | awk -f dup1.awk | sort -dfut'"' +5 -6 +1 -2 +8 +0 >junk3
23	tr A-Z a-z <toc | awk '{ print "\"" $1 "(" $2 ")\"", $3 }' >junk4
24	awk '	BEGIN { Q = "\""
25			while(getline <"junk4") toc[$1] = $1 " " $2 }
26		{ $NF = toc[$NF]; print }
27	' junk3 >permindex
28
29$O.ptx1: ptx1.c
30	$CC ptx1.c
31	$LD -o $target ptx1.$O -lstdio
32
33clean:V:
34	rm -f junk* ptx1.$O *.ptx1 permindex out
35