include makeconfig

OBJS = $(PNAME).o

PILRC = pilrc
TXT2BITM = txt2bitm
OBJRES = m68k-palmos-coff-obj-res
BUILDPRC = build-prc
CC = m68k-palmos-coff-gcc
CFLAGS = -Wall -fno-builtin -g -O2 $(DEFINES)
LIBS =

GRCS =	code0000.$(PNAME).grc	\
	code0001.$(PNAME).grc	\
	data0000.$(PNAME).grc	\
	pref0000.$(PNAME).grc

all: $(PNAME).prc

install: all
	pilot-xfer -i $(PNAME).prc

$(OBJS):: $(PNAME).h $(PNAME)id.h

$(PNAME): $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) -o $(PNAME) $(LIBS)

$(GRCS): $(PNAME)
	$(OBJRES) $(PNAME)

bin.res: $(PNAME).rcp $(PNAME).pbitm $(PNAME)id.h
	$(PILRC) $(PNAME).rcp .
	$(TXT2BITM) $(PNAME).pbitm
	touch bin.res

$(PNAME).prc: $(GRCS) bin.res
	$(BUILDPRC) $(PNAME).prc $(ICONTEXT) $(APPID) $(GRCS) *.bin

clean:
	rm -f *.o $(PNAME) *.bin bin.res $(GRCS)

spotless: clean
	rm -f $(PNAME).prc
