SHELL       	= /bin/sh

DISTY	    	= ../../demodata/
TARGET      	= tinfish

VU1TSM  = 	runonce.tsm padread.tsm camera.tsm \
		clear.tsm fback.tsm \
		init.tsm update0.tsm update1.tsm update2.tsm \
		draw.tsm

VCL_OBJS 	= shell.o		

OBJS = $(VCL_OBJS)

RM          = /bin/rm -f
VCL	    = vcl

VCLOPT      = -g -f -Ii/  

.SUFFIXES:  ..o .vcl .tsm

vpath %.o 	obj
vpath %.vcl 	vcl
vpath %.tsm 	tsm

all: $(TARGET).bin

$(TARGET).bin: $(OBJS)
	objcopy -O binary obj/shell.o tinfish.bin
	cp -f tinfish.bin $(DISTY)/
	cp -f data/tinfish.dat $(DISTY)/
	cp -f data/tinfish.hlp $(DISTY)/
	cp -f data/tinfish.inf $(DISTY)/

.vcl.tsm:
	mkdir -p tmp
	mkdir -p tsm
	$(VCL) $(VCLOPT) -otmp/$*.tsm $<  
	grep -v ".vu" tmp/$*.tsm > tsm/$*.tsm

shell.o: $(VU1TSM)
	mkdir -p obj
	ee-dvp-as -Ii/ asm/shell.vsm -o obj/shell.o

clean:
	$(RM) obj/*.o *.map tmp/* obj/*.lst  tsm/*  *.dis *.elf *.o lst/*.lst tinfish.* 



