#	Makefile for DOS & S86

TC=		tx -s86 -O
TX=		tx -s86 -O
TCCMD=		command /e:2048 /c $(TC)
TXCMD=		command /e:2048 /c $(TX) -s86
MAKEGEN=	command /e:2048 /c makegen

default:	txcgg.exe txcgboot.exe txcg386.exe txcg386e.exe \
		txcg86t.exe txcg86a.exe txcgc.exe txtrn.exe txopt.exe \
		txpp.exe ux.exe txinfo.exe

boot:	txcgg.exe txcgboot.exe

txcgg.exe:	txcgg.t
	$(TCCMD) -P txcgg

txcgboot.exe:	txcg_asm_frame cg86a.def
	copy txcg_asm_frame txcg_frame
	.\txcgg <cg86a.def >txcg86a.t
	del txcg_frame
	$(TCCMD) -P txcg86a
	command /c if exist txcgboot.exe del txcgboot.exe
	ren txcg86a.exe txcgboot.exe

txcg386.exe:	cg386.def
	$(MAKEGEN) -s86 -asm 386

txcg386e.exe:	cg386e.def
	$(MAKEGEN) -s86 -asm 386e

txcg86t.exe:	cg86t.def
	$(MAKEGEN) -s86 -asm 86t

txcg86a.exe:	cg86a.def
	$(MAKEGEN) -s86 -asm 86a

txcgc.exe:	cgc.def
	$(MAKEGEN) -s86 -hll c

txtrn.exe:	../compiler/txtrn.t
	copy ..\compiler\txtrn.t .
	$(TXCMD) txtrn
	del txtrn.t

txopt.exe:	../compiler/txopt.t
	copy ..\compiler\txopt.t .
	$(TXCMD) txopt
	del txopt.t

txpp.exe:	../compiler/txpp.t
	copy ..\compiler\txpp.t .
	$(TXCMD) txpp
	del txpp.t

ux.exe:	../compiler/ux.t
	copy ..\compiler\ux.t .
	$(TXCMD) ux
	del ux.t

txinfo.exe:	../compiler/txinfo.t
	copy ..\compiler\txinfo.t .
	$(TXCMD) txinfo
	del txinfo.t

diff:
	..\s86kit\s86 <..\native\libtx86.s >..\build\libtx86.o
	.\txtrn <..\compiler\txtrn.t >__u
	.\txopt <__u >__t
	.\txcg86a <__t >__s
	..\s86kit\s86b <__s >__o
	command /c echo -o __x >__l
	command /c echo __o >>__l
	command /c echo ../build/libtx86.o >>__l
	..\s86kit\sld <<__l
	..\s86kit\cvexe <__x >__.exe
	.\__.exe <..\compiler\txtrn.t >__u
	.\txopt <__u >__t
	.\txcg86a <__t >__s
	..\s86kit\s86b <__s >__o
	command /c echo -o __x >__l
	command /c echo __o >>__l
	command /c echo ../build/libtx86.o >>__l
	..\s86kit\sld <<__l
	..\s86kit\cvexe <__x >__.2
	-comp __.exe __.2
	-del __u
	-del __t
	-del __s
	-del __o
	-del __x
	-del __l
	-del __.exe
	-del __.2

clean:
	-del *.obj
	-del *.ERR

clobber:	clean
	-del txcgg.exe
	-del txcgboot.exe
	-del txcg386.exe
	-del txcg386.t
	-del txcg386e.exe
	-del txcg386e.t
	-del txcg86t.exe
	-del txcg86t.t
	-del txcg86a.exe
	-del txcg86a.t
	-del txcgc.exe
	-del txcgc.t
	-del libtx.lib
	-del txtrn.exe
	-del txopt.exe
	-del txpp.exe
	-del ux.exe
	-del txinfo.exe

