CFILES = main.c
OFILES = $(CFILES:.c=.o)

GCC=m68k-palmos-gcc -I/usr/local/palmdev/include
RES=m68k-palmos-obj-res

all: prc

debug: prc-debug

prc: code
	build-prc ege.prc 'GameEdit' EnGE *.grc *.bin

prc-debug: code-debug
	build-prc ege.prc 'GameEdit' EnGE *.grc *.bin

code: res $(OFILES)
	$(GCC) $(OFILES) -o ege
	$(RES) ege

code-debug: res $(OFILES)
	$(GCC) -g $(OFILES) -o ege
	$(RES) ege
res:
	pilrc28 mainscreen.rcp
	pilrc28 simscreen.rcp
	pilrc28 questscreen.rcp
	pilrc28 knightscreen.rcp
	pilrc28 spacescreen.rcp
	pilrc28 realmscreen.rcp
	pilrc28 solskiascreen.rcp
	pilrc28 bebopscreen.rcp
	pilrc28 menu.rcp

clean:
	rm -f *.bin *.o ege ege.prc *.grc

%.o: %.c
	$(GCC) -c $<

