#
# to compile and build, you need TASM and TC 2.01
#
# building with TCPP 1.0 should be possible, but requires 
# a different LIBM.LIB (this one was taken from FreeDOS kernel)
# and hasn't been tried
#
# if you use different compiler/assembler/linker
# please don't complain
#

TCC=$(TCBASE)\tcc -G- -w -r -N- -O -Z -k- -g1

all: ..\emm386.exe emmtest.exe ..\himem.exe


..\emm386.exe: emm386.exe
	copy emm386.exe ..

..\himem.exe: himem.exe
	copy himem.exe  ..

emm386.exe: emm386.obj emm386c.obj prf.obj useful.obj
	$(TCBASE)\tlink /3 /m emm386 emm386c prf useful libm.lib


emm386.obj: emm386.asm
	tasm /l /m2 /zi $*.asm;

emm386c.obj: emm386c.c
	$(TCC) -c emm386c.c
	
prf.obj: prf.c
	$(TCC) -c prf.c
	
useful.obj: useful.c
	$(TCC) -c useful.c


emmtest.exe: emmtest.c
	$(TCC) -L$(TCBASE)\lib -I$(TCBASE)\include emmtest.c




himem.exe : himem.obj himemc.obj prf.obj useful.obj xmstest.obj
	$(TCBASE)\tlink /3 /m himem himemc xmstest prf useful libm.lib



himem.obj: himem.asm
	$(TASM) /m2 /l himem.asm


himemC.obj: himemC.C
	$(TCC) -c -w -g1 himemC.C


#xmstest.exe: xmstest.c
#	$(TCC) -I$(TCBASE)\include xmstest.c

xmstest.obj: xmstest.c
	$(TCC) -c -w -g1 xmstest.c
