</$objtype/mkfile

TC = ../build/tc

default:V:	txtrn txx ux txopt txpp txinfo

txtrn:	txtrn.t
	$TC txtrn.t

txx:	txx.$O lib.$O txx_ext.h
	$LD -o txx txx.$O lib.$O

txx.$O:	txx.c txx_ext.h
	$CC -B -Dplan9 txx.c

lib.$O:	lib.c
	$CC -B -Dplan9 lib.c

ux:	ux.t
	$TC ux.t

txopt:	txopt.t
	$TC txopt.t

txpp:	txpp.t
	$TC txpp.t

txinfo:	txinfo.t
	$TC txinfo.t

diff:
	./txx ../build/txtrn.tcode <txtrn.t >__stage_1
	./txx __stage_1 <txtrn.t >__stage_2
	cmp __stage_1 __stage_2 && rm __stage_1 __stage_2

hotdiff:
	./txx ../build/txtrn.tcode <txtrn.t >__txtrn.UNOPT
	./txopt <__txtrn.UNOPT >__txtrn
	./txx ../build/txtrn.tcode <txopt.t >__txopt.UNOPT
	./txopt <__txopt.UNOPT >__txopt
	./txx __txtrn < txtrn.t > __txtrn_2.UNOPT
	./txx __txopt <__txtrn_2.UNOPT >__txtrn_2
	cmp __txtrn.UNOPT __txtrn_2.UNOPT
	cmp __txtrn __txtrn_2
	rm -f __txtrn.UNOPT __txtrn __txtrn_2.UNOPT __txtrn_2 \
		__txopt.UNOPT __txopt

clean:
	rm -f *.$O

nuke:	clean
	rm -f txtrn txx ux txopt txpp txinfo
