TXDIR=C:\V\T3XR5
BINDIR=$(TXDIR)
TC=command /e:2048 /c ..\build\tc.bat
TX=tx -O
TXCMD=command /e:2048 /c $(TX) -s86

PROGS =	cvexe.exe cvimg.exe hd.exe rmsym.exe s86.exe s86b.exe s86q.exe \
	sld.exe snm.exe sz.exe xo.exe

.SUFFIXES:	.t .exe

all:	$(PROGS) libtx86.o libvio.o

boot:
	$(TC) s86b
	$(TC) sld
	$(TC) cvexe
	echo. >boot

boot2:	all
	$(TXCMD) s86b
	$(TXCMD) sld
	cp cvexe.t _.t
	$(TXCMD) _
	del _.t
	-del cvexe.exe
	ren _.exe cvexe.exe
	echo. >boot2

libtx86.o:	libtx86.s
	.\s86 <libtx86.s >libtx86.o

libvio.o:	libvio.s
	.\s86 <libvio.s >libvio.o

.t.exe:
	$(TXCMD) $*

install:
	copy s86b.exe $(BINDIR)
	copy s86q.exe $(BINDIR)
	copy cvexe.exe $(BINDIR)
	copy cvimg.exe $(BINDIR)
	copy sld.exe $(BINDIR)
	copy snm.exe $(BINDIR)
	copy s86.exe $(BINDIR)
	copy sz.exe $(BINDIR)
	copy rmsym.exe $(BINDIR)
	copy xo.exe $(BINDIR)
	copy libtx86.o $(BINDIR)
	copy libvio.o $(BINDIR)
	copy tx-s86.bat $(BINDIR)

clean:
	-del *.o
	-del _PASS2
	-del _DATA
	-del _TEXT
	-del _RELOC
	-del _LDDATA
	-del _LDTEXT
	-del x.out
	-del x.exe
	-del boot
	-del boot2

clobber:	clean
	command /c for %i in ($(PROGS)) do del %i
