BINDIR=/usr/local/palmpilot/bin
CC = ${BINDIR}/m68k-palmos-coff-gcc

CFLAGS = -O2 -g

.SUFFIXES: .xbm .asc

PILRC = ${BINDIR}/pilrc
TXT2BITM = ${BINDIR}/txt2bitm
OBJRES = ${BINDIR}/obj-res
BUILDPRC = ${BINDIR}/build-prc

sntp.prc: code0001.sntp.grc tFRM03e8.bin tAIB03e8.bin
	$(BUILDPRC) sntp.prc "sntp" sNTP *.grc *.bin
	ls -l *.prc

tFRM03e8.bin: sntp.rcp sntp.h
	$(PILRC) sntp.rcp 

sntp:	sntp.o
	$(CC) $(CFLAGS) sntp.o -static -o sntp

code0001.sntp.grc: sntp
	$(OBJRES) sntp

tAIB03e8.bin: sntp.asc
	${BINDIR}/txt2bitm sntp.asc

.xbm.asc:
	bmtoa <$< >$@

tarball:
	tar cfvz sntp.tar.gz Makefile sntp.asc sntp.c sntp.h sntp.prc sntp.rcp sntp.xbm

clean:
	rm -f sntp *.o *.bin *.grc
