OBJS = step.o

CC = m68k-palmos-coff-gcc

CSFLAGS = -O2 -S

CFLAGS = -O2 -fomit-frame-pointer

PILRC = pilrc
OBJRES = m68k-palmos-coff-obj-res
BUILDPRC = build-prc

ICONTEXT = "StepCount"
APPID = StCt

all: step.prc
	cd tilt_p3; make

step.o: step.c stepRsc.h

.S.o:
	$(CC) $(TARGETFLAGS) -c $<

.c.s:
	$(CC) $(CSFLAGS) $<

step.prc: res.stamp obj.stamp
	$(BUILDPRC) step.prc $(ICONTEXT) $(APPID) *.grc *.bin

install: step.prc
	pilot-xfer -i step.prc 

obj.stamp: step
	$(OBJRES) step
	touch obj.stamp

res.stamp: step.rcp stepRsc.h step.pbm
	$(PILRC) step.rcp .
	touch res.stamp

step: $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) -o step

clean:
	rm -rf *.[oa] step *.bin *.stamp *.grc *~ step.zip
	cd tilt_p3; make clean

dist:
	rm -rf ../step*.zip
	make all
	zip ../step_prc.zip step.prc tilt_p3/tilt_p3.prc
	make clean
	cd ..; zip step.zip -r step/*

disk:
	make dist
	mcopy -o ../step*.zip a:

www:
	make dist
	cp ../step*.zip /usr/home/harbaum/WWW/pilot/

