</$objtype/mkfile

TC = ../build/tc

default:V:	libtx.$O txcgg txcgc.boot txcg386 txcg86a txcg86t txcgc \
		txtrn txopt txpp

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

txcgg:	txcgg.t
	$TC -P txcgg.t

txcgc.boot:	cgc.def txcg_hll_frame
	cp txcg_hll_frame txcg_frame
	./txcgg <cgc.def >txcgc.t
	$TC -P txcgc.t && mv txcgc txcgc.boot
	rm txcg_frame

txcg386:	cg386.def txcg_asm_frame
	./makegen.rc -asm 386

txcg86t:	cg86t.def txcg_asm_frame
	./makegen.rc -asm 86t

txcg86a:	cg86a.def txcg_asm_frame
	./makegen.rc -asm 86a

txcgc:	cgc.def txcg_hll_frame
	./makegen.rc -hll c

txtrn:	../compiler/txtrn.t
	./txboot.rc -o txtrn ../compiler/txtrn.t

txopt:	../compiler/txopt.t
	./txboot.rc -o txopt ../compiler/txopt.t

txpp:	../compiler/txpp.t
	./txboot.rc -o txpp ../compiler/txpp.t

diff:
	../compiler/txtrn <../compiler/txtrn.t >__t3
	./txtrn <../compiler/txtrn.t >__t3x
	cmp __t3 __t3x
	../compiler/txx ../build/txcgc.tcode <__t3 >__c
	./txcgc <__t3x >__cN
	cmp __c __cN
	rm __t3 __t3x __c __cN

clean:
	rm -f *.$O *.tcode

nuke:	clean
	rm -f txcgg txcgc.boot txcg386 txcg386.t txcg86a txcg86a.t \
	txcg86t txcg86.t txcgc libtx.$O \
	txtrn txopt txpp
