< /sys/doc/fonts
NPROC = 1
FILES = \
	title.ps \
	trademarks.ps \
	contents.ps \
	9.ps \
	acid.ps \
	acidpaper.ps \
	ape.ps \
	asm.ps \
	auth.ps \
	comp.ps \
	compiler.ps \
	lexnames.ps \
	libmach.ps \
	lp.ps \
	mk.ps \
	mkfiles.ps \
	names.ps \
	plumb.ps \
	port.ps \
	rc.ps \
	sleep.ps \
	spin.ps \
	troff.ps \
	utf.ps \
	colophon.ps \
	release4.ps \
	prog4.ps\

DIRS = \
	8½ \
	acme \
	fs \
	venti \
	il \
	net \
	sam \

all:V: dirs

print:V: \
	title.ps \
	trademarks.ps \
	contents.ps\
	9.ps \
	names.ps \
	net/net.ps \
	auth.ps \
	comp.ps \
	prog4.ps \
	ape.ps \
	acidpaper.ps \
	acid.ps \
	mk.ps \
	mkfiles.ps \
	asm.ps \
	8½/8½.ps \
	rc.ps \
	sam/sam.ps \
	acme/acme.ps \
	plumb.ps \
	utf.ps \
	compiler.ps \
	libmach.ps \
	fs/fs.ps \
	venti/venti.ps \
	il/il.ps \
	sleep.ps \
	lexnames.ps \
	lp.ps \
	troff.ps \
	spin.ps \
	port.ps \
	colophon.ps
	lp -dfn -H -i0 $prereq

html:V: \
	9.html \
	names.html \
	net/net.html \
	auth.html \
	comp.html \
	prog4.html \
	ape.html \
	acidpaper.html \
	acid.html \
	mk.html \
	mkfiles.html \
	asm.html \
	8½/8½.html \
	rc.html \
	sam/sam.html \
	acme/acme.html \
	plumb.html \
	utf.html \
	compiler.html \
	libmach.html \
	fs/fs.html \
	il/il.html \
	sleep.html \
	lexnames.html \
	lp.html \
	troff.html \
	spin.html \
	port.html \
	release4.html
	cp index.htm index.html

dirs:V:	$FILES $DIRS
	for(i in $DIRS) @{
		cd $i
		mk
	}

title.ps:D:	title
	troff $prereq | lp -dstdout > $target
	cleanps $target

contents.ps:D:	contents.ms
	{ echo $FONTS; cat $prereq } | troff -ms -mnihongo | lp -dstdout > $target
	cleanps $target

trademarks.ps:D:	/sys/lib/man/trademarks
	troff $prereq | lp -dstdout > $target
	cleanps $target

colophon.ps:D:	/sys/lib/man/colophon
	troff $prereq | lp -dstdout > $target
	cleanps $target

%.page:D:	%.ps
	page -w $stem.ps

%.ps:D:	%.ms
	{ echo $FONTS; cat $stem.ms } | tbl | troff -ms | lp -dstdout > $target
	cleanps $target

%.trout:D:	%.ms
	{ echo $FONTS; cat $stem.ms } | tbl | troff -ms > $stem.trout

troff.trout:D:	troff.ms
	{ echo $FONTS; cat $prereq } | tbl | eqn | troff -ms > $target

troff.ps:D:	troff.ms
	echo this gets some scary-looking errors, but they''''re fine
	{ echo $FONTS; cat $prereq } | tbl | eqn | troff -ms | lp -dstdout > $target
	cleanps $target

fossil.ps:D: fossil.ms
	{ echo $FONTS; cat $prereq } | pic | troff -ms | lp -dstdout >$target
	cleanps $target

auth.ps:D:	auth.ms
	{ echo $FONTS; cat $prereq } | pic | tbl | eqn  | troff -ms | lp -dstdout > $target
	cleanps $target

plumb.ps:D:	plumb.ms
	{ echo $FONTS; cat $prereq } | pic | troff -ms | lp -dstdout > $target
	cleanps $target

comp.ps:D:	comp.ms
	{ echo $FONTS; cat $prereq } | tbl | troff -ms -mnihongo | lp -dstdout > $target
	cleanps $target

utf.ps:D:	utf.ms
	{ echo $FONTS; cat $prereq } | tbl | troff -ms -mnihongo | lp -dstdout > $target
	cleanps $target

9.ps:D:	9.ms network.pic
	{ echo $FONTS; cat 9.ms } | tbl | pic | troff -ms -mnihongo | lp -dstdout > $target
	cleanps $target

9.trout:D:	9.ms network.pic
	{ echo $FONTS; cat 9.ms } | tbl | pic | troff -ms -mnihongo > $target

spin.ps:D:	spin.ms
	{ echo $FONTS; cat $prereq } | eqn | tbl | troff -ms | lp -dstdout > $target
	cleanps $target

%.html:D:	%.ms
	{ echo $FONTS; cat $stem.ms } | tbl | ms2html > $target

troff.html:D:	troff.ms
	{ echo $FONTS; cat $prereq } | tbl | eqn | ms2html > $target

plumb.html:D:	plumb.ms
	{ echo $FONTS; cat $prereq } | pic | ms2html > $target

auth.html:D:	auth.ms
	{ echo $FONTS; cat $prereq } | pic |eqn | tbl | ms2html > $target

comp.html:D:	comp.ms
	{ echo $FONTS; cat $prereq } | tbl | ms2html > $target

utf.html:D:	utf.ms
	{ echo $FONTS; cat $prereq } | tbl | ms2html > $target

9.html:D:	9.ms network.pic
	{ echo $FONTS; cat 9.ms } | tbl | pic | ms2html > $target

spin.html:D:	spin.ms
	{ echo $FONTS; cat $prereq } | eqn | tbl | ms2html > $target

gfx.html:D:	gfx.ms
	{ echo $FONTS; cat $prereq } | tbl | pic | ms2html > $target

fs/fs.html:
	cd fs
	mk fs.html

net/net.html:
	cd net
	mk net.html

sam/sam.html:
	cd sam
	mk sam.html

acme/acme.html:
	cd acme
	mk acme.html

venti/venti.html:
	cd venti
	mk venti.html

il/il.html:
	cd il
	mk il.html

release4.html:	release4.ms
	# remove all those extra blank lines
	{ echo $FONTS; cat release4.ms } | tbl | ms2html | uniq > $target

%.pdf: %.ps
	{ cat docfonts $stem.ps } >_$stem.ps
	distill _$stem.ps
	mv _$stem.pdf $stem.pdf

%.all:V:
	mk $stem.ps $stem.pdf $stem.html

