OBJS = pilrctst.o

CC = m68k-palmos-coff-gcc

CSFLAGS = -O2 -S
CFLAGS = -O2 -g

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

ICONTEXT = "PilRC Test"
APPID = pIlr

all: pilrctst.prc

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

.c.s:
	$(CC) $(CSFLAGS) $<
	
pilrctst.o: resource.h

pilrctst.prc: code0000.pilrctst.bin code0001.pilrctst.bin data0000.pilrctst.bin resource.h
	$(BUILDPRC) pilrctst.prc $(ICONTEXT) $(APPID) code0001.pilrctst.grc code0000.pilrctst.grc data0000.pilrctst.grc *.bin pref0000.pilrctst.grc

code0000.pilrctst.bin: pilrctst
	$(OBJRES) pilrctst

code0001.pilrctst.bin: code0000.pilrctst.bin

data0000.pilrctst.bin: code0000.pilrctst.bin

resource.h: pilrctst.rcp
	$(PILRC) -h resource.h pilrctst.rcp .
	touch bin.res

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

clean:
	rm -rf *.[oa] pilrctst *.bin bin.res *.[pg]rc resource.h
