file=opsytest
aflags=-f -l -s -I ../system/
includefiles=../system/mcx.inc ../system/mcxuser.inc 
system=../system/system.o ../system/clkdrivr.o ../system/mcx.o
mem=-b _CODE=0xc000 -b _DATA=0xde00 -b STACK=0x6000 -b ZEROPAGE=0x0002

$(file).s19: $(file).o $(system) crt.o mcxif.o mcxconf.o Makefile
	aslink -f link.cnf

$(file).o: $(file).c mcxif.h
	icc11 -S -A -A $(file).c 
	asmfil $(file).s $(file).asm
	del $(file).s
	as6811 $(aflags) $(file).asm  -o $(file).o

crt.o: crt.asm
	as6811 $(aflags) crt.asm  -o crt.o
		
mcxif.o: mcxif.asm
	as6811 $(aflags) mcxif.asm  -o mcxif.o

mcxconf.o: mcxconf.asm
	as6811 $(aflags) mcxconf.asm  -o mcxconf.o
		
clean:
	del *.o 
	del $(file).asm 
	del *.lst 
	del *.map 
	del $(file).s19 
	del *.sym		
	del *.bak
