#Makefile for gcc PalmPilot crosscompiler m68k-palmos-coff-gcc package.
# Change the strings from APP to BUILDPRC to match your own
# system configuration.
# Place the file into the developping directory.
# "make clean" removes all generated files, even the ".prc".
APP             =StripCS
ICONTEXT        ="Strip CS"
APPID           =SJLM
RCP             =$(APP).rcp
PRC             =$(APP).prc
SRC             =$(APP).c
GRC             =$(APP).grc
BIN             =$(APP).bin

CC              =m68k-palmos-coff-gcc
PILRC           =pilrc
TXT2BITM        =txt2bitm
OBJRES          =m68k-palmos-coff-obj-res
BUILDPRC        =build-prc
OTHERFILES = md5PalmDriver.c  tw.c twDriver.c idea.c ideaDriver.c desPalmDriver.c
# uncomment this if you want to build a gdb debuggable version
# -On: n=Optimization-level (0=none), -g: needed for debugging
CFLAGS          =-O2 $(DEFINES) $(INCLUDES)
#CFLAGS          =-g $(DEFINES) $(INCLUDES)

all:            $(PRC)

$(PRC):       grc.stamp bin.stamp;
	$(BUILDPRC) $(PRC) $(ICONTEXT) $(APPID) *.grc *.bin $(LINKFILES) 
	ls -l *.prc
	rm -rf *.o *.bin *.grc *.stamp *~ *.BAK
	tar cvf ../StripCSExportLatest.tar ./*
	
grc.stamp:    $(APP) ;
	$(OBJRES) $(APP)
	touch $@

$(APP):       $(SRC:.c=.o) ;
	$(CC) $(CFLAGS) $^ $(OTHERFILES)  -o $@ 

bin.stamp:    $(RCP) ;
	$(PILRC) $^ $(BINDIR)
	touch $@

%.o:  %.c ;
	$(CC) $(CFLAGS) -c $< -o $@
	               touch $<
	# enable this line if you want to compile EVERY time.

depend dep: ;
	$(CC) -M $(SRC) > .dependencies


clean:
	rm -rf *.o $(APP) *.bin *.grc *.prc *.stamp *~ *.BAK
