# $Header: Makefile,v 0.77.1.1 85/03/25 20:33:38 richards Released $
# Upgraded at various times by P. A MacKay.

# Makefile to run the "TRAP" test on MetaFont

TRAPMF=	trapmf

MASTERS=SAVEtrap.log SAVEtrapin.log SAVEtrap.fot SAVEtrap.typ SAVEtrap.pl
DIFFS=	trap.log@DIFF trapin.log@DIFF trap.fot@DIFF trap.typ@DIFF trap.pl@DIFF
GFFILE=	trap.72270gf

${DIFFS}: SAVEtrap.log SAVEtrapin.log SAVEtrap.fot SAVEtrap.typ SAVEtrap.pl \
		trap.log trapin.log trap.fot trap.typ trap.pl
	-diff SAVEtrap.log trap.log > trap.log@DIFF
	-diff SAVEtrapin.log trapin.log > trapin.log@DIFF
	-diff SAVEtrap.fot trap.fot > trap.fot@DIFF
	-diff SAVEtrap.typ trap.typ > trap.typ@DIFF
	-diff SAVEtrap.pl trap.pl > trap.pl@DIFF

SAVEtrap.log: SAVEtrap.log.Z
	cp SAVEtrap.log.Z tmp.Z
	chmod 666 tmp.Z
	uncompress tmp
	mv tmp SAVEtrap.log

SAVEtrap.tex: SAVEtrap.tex.Z
	cp SAVEtrap.tex.Z tmp.Z
	uncompress tmp
	mv tmp SAVEtrap.tex

trapin.log trap.base:	Unix_trapin1 trap.mf ${TRAPMF}
	-${TRAPMF} < Unix_trapin1 | tee trapin.fot
	-mv trap.log trapin.log

trapmf:
	mv ../trapmf trapmf
	cp ../mf.pool mf.pool

trap.mf:	SAVEtrap.mf
	cp SAVEtrap.mf trap.mf

trap.log ${GFFILE} trap.tfm trap.fot: Unix_trapin2 trap.mf trap.base ${TRAPMF}
	-${TRAPMF} < Unix_trapin2 | tee trap.fot

trap.typ: ${GFFILE}
	gftype -m -i ${GFFILE} > trap.typ 

trap.pl: trap.tfm
	tftopl trap.tfm trap.pl

trapman:	trapman.dvi

trapman.dvi: ${MASTERS} SAVEtrap.tex
	sed -e "s/verbatim{/verbatim{SAVE/" SAVEtrap.tex > trapman.tex
	tex trapman

clean:
	rm -f trap.* trapin.*
