BIN = /global/jaywalks/shirriff/gnu/bin

CFLAGS += -O2
install: tv.prc
	cp tv.prc $(HOME)/.pilotmgr/Installer

tv.prc: code0001.tv.grc tfrm03e8.bin
	$(BIN)/build-prc  tv.prc "Tiny Viewer" KStv *.grc *.bin
	ls -l *.prc


tfrm03e8.bin: tv.rcp tv.h
	$(BIN)/pilrc tv.rcp 
	$(BIN)/txt2bitm tv.pbitm

code0001.tv.grc: tv.c tv.h
	$(BIN)/m68k-palmos-coff-gcc -O1 -c tv.c -o tv.o 
	$(BIN)/m68k-palmos-coff-gcc -v -v -O1 tv.o -o tv
	$(BIN)/m68k-palmos-coff-obj-res tv

clean:
	rm -f tv *.bin *.o *.grc *.prc

MSG = "TinyViewer by Ken Shirriff, shirriff@eng.sun.com, http://www.sunlabs.com/~shirriff/pilot"

zip:
	echo $(MSG) | zip -z tvsrc tv.prc readme tv.pbitm tv.c tv.h tv.rcp Makefile
	echo $(MSG) | zip -z tv tv.prc
	cp tvsrc.zip tv.zip $(HOME)/public_html/pilot

lint:
	lint -I/global/jaywalks/shirriff/gnu/m68k-palmos-coff/include/PalmOS tv.c

