OBJS = sweetheart.o greyscale.o
CC = m68k-palmos-coff-gcc

CFLAGS = -O2 -Wall 

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

ICONTEXT = "Sweetheart"
APPID = Shrt

all: sweetheart.prc

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

sweetheart.prc: code0000.sweetheart.bin code0001.sweetheart.bin data0000.sweetheart.bin bin.res
	$(BUILDPRC) sweetheart.prc $(ICONTEXT) $(APPID) code0001.sweetheart.grc code0000.sweetheart.grc data0000.sweetheart.grc *.bin  pref0000.sweetheart.grc 

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

code0001.sweetheart.bin: code0000.sweetheart.bin

data0000.sweetheart.bin: code0000.sweetheart.bin

bin.res: icon.txt
	$(TXT2BITM) icon.txt
	touch bin.res

sweetheart: $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) -o sweetheart -lc

clean:
	rm -rf *.[oa] sweetheart *.bin *.[pg]rc bin.res
