OBJS = filexfer.o

CC = m68k-palmos-coff-gcc

#uncomment this if you want to build a gdb debuggable version
#DEFINES = -DDEBUG

INCLUDES =  

CSFLAGS = -O2 -S $(DEFINES) $(INCLUDES)
CFLAGS = -O2 -g $(DEFINES) $(INCLUDES)

LIBS = 

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

ICONTEXT = "File-X-Fer"
APPID = SPFX
PRC = filexfer.prc

all: $(PRC)

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

.c.s:
	$(CC) $(CSFLAGS) $<

$(PRC): code.stamp bin.stamp resource.h
	$(BUILDPRC) $@ $(ICONTEXT) $(APPID) *.grc *.bin

code.stamp: filexfer
	$(OBJRES) filexfer
	touch code.stamp

bin.stamp: filexfer.rcp
	$(PILRC) filexfer.rcp
	touch bin.stamp

filexfer: $(OBJS) filexfer.h filexferdb.h strings.h resource.h
	$(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $@

clean:
	cp *.prc ../filexfer
	rm -rf filexfer *.[oa] *.bin *.stamp *.[pg]rc
