code: plan9front

ref: 403149d7de4dbe4cc4b1fd9cb3a164e51dbccc15
dir: /sys/doc/mkfile/

View raw version
# Changes made in this directory are invisible to the
# external web server.  To publish changed documents
# to the external web server, mk install or name.install
# To publish changed ps/pdf files, see the install rule.

< /sys/doc/fonts
NPROC = 1

ALL=\
	title\
	trademarks\
	contents\
	9\
	names\
	net/net\
	auth\
	comp\
	prog4\
	ape\
	acidpaper\
	acid\
	mk\
	mkfiles\
	asm\
	8½/8½\
	rc\
	sam/sam\
	acme/acme\
	plumb\
	utf\
	compiler\
	libmach\
	fs/fs\
	venti/venti\
	il/il\
	lexnames\
	sleep\
	lp\
	troff\
	spin\
	port\
	colophon\
	nupas/nupas\

ALLPS=${ALL:%=%.ps}
HTML=${ALL:%=%.html} release3.html release4.html
PDF=${ALL:%=%.pdf} release3.pdf release4.pdf
FILES=`{mkfilelist $ALL}
DIRS=`{mkdirlist $ALL}
NAMES=$FILES $DIRS

all:V: ${FILES:%=%.ps} dirs

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

print:V: $ALLPS
	lp -H -i0 $prereq

title.ps:D:	title
	troff $prereq | 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

# troff gets some scary-looking errors but they're okay
&.ps:D:	&.ms
	mac=(-ms)
	if(~ $stem comp utf 9 contents) mac=(-ms -mnihongo)
	{ echo $FONTS; cat $stem.ms } | pic | tbl | eqn | 
		troff $mac | lp -dstdout > $target
	cleanps $target

%.trout:D:	%.ms
	mac=(-ms)
	if(~ $stem comp utf 9 contents) mac=($mac -mnihongo)
	{ echo $FONTS; cat $stem.ms } | pic | tbl | eqn | 
		troff $mac > $target

html:V: $HTML

9.trout 9.ps 9.html: network.pic

%.html: /$objtype/bin/htmlroff /sys/lib/tmac/tmac.s

index.html: contents.html
	cp contents.html index.html

&.html:D:	&.ms
	pic $stem.ms | tbl | eqn | htmlroff -ms -mhtml >$target

&.pdf:D:	&.ps
	cat docfonts $stem.ps >_$stem.ps
	# distill _$stem.ps && mv _$stem.pdf $stem.pdf
	ps2pdf _$stem.ps $stem.pdf && rm -f _$stem.ps

pdf:V: $PDF

^(8½|acme|fs|il|net|sam|venti)/([^/]*\.(pdf|ps|html))'$':R:
	cd $stem1
	mk $stem2

^(8½|acme|fs|il|net|sam|venti)\.html'$':R: \1/\1.html
	cp $stem1/$stem1.html .

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

%.install:V: %.html
	9fs other
	files=`{ls $stem.html $stem^*.png $stem/*.png $stem/*.html >[2]/dev/null}
	whatis stem
	whatis files
	cp $files /n/other/crp/sources.copy/sys/doc

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

install:V: ${NAMES:%=%.install} release4.install release3.install

# ignore these
IGNHTML=title trademarks colophon troff
IGN=${IGNHTML:%=%.html} ${IGNHTML:%=%.install}

$IGN:QV:
	# nothing