#******************************************************************************
#* File: Makefile
#* Application: jMileage
#* Revision 1.5
#* Copyright (c) 2001 Jason Shah, jasonshah@yahoo.com
#*
#*  This program is free software; you can redistribute it and/or modify
#*  it under the terms of the GNU General Public License as published by
#*  the Free Software Foundation; either version 2 of the License, or
#*  (at your option) any later version.
#*
#*  This program is distributed in the hope that it will be useful,
#*  but WITHOUT ANY WARRANTY; without even the implied warranty of
#*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#*  GNU General Public License for more details.
#*
#*  You should have received a copy of the GNU General Public License
#*  along with this program; if not, write to the Free Software
#*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#*
#******************************************************************************/



# Makefile for jBtnIntercpt

APP				= jMileage
ICONTEXT		= "jMileage"
APPID			= jMPG
RCP				= $(APP).rcp
RCPMETRIC		= $(APP)Metric.rcp
PRC				= $(APP).prc
PRCMETRIC		= $(APP)Metric.prc
SRC				= $(APP).c

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

# Uncomment for debugging
CFLAGS = -O0 -g -palmos3.5
#CFLAGS = -O2 -g -palmos3.5

all: $(PRC)

metric: $(PRCMETRIC)

$(PRC): grc.stamp bin.stamp
	$(BUILDPRC) $(PRC) $(ICONTEXT) $(APPID) *.grc *.bin
	ls -l *.prc

$(PRCMETRIC): grc.stamp binmetric.stamp
	$(BUILDPRC) $(PRCMETRIC) $(ICONTEXT) $(APPID) *.grc *.bin
	ls -l *.prc

grc.stamp: $(APP)
	$(OBJRES) $(APP)
	touch $@

$(APP): $(SRC:.c=.o)
	$(CC) $(CFLAGS) *.o -o $@

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

binmetric.stamp: $(RCPMETRIC)
	$(PILRC) $^ $(BINDIR)
	touch $@

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

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

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

veryclean: clean
	rm -rf *.prc *.bak



#######################
# Added by Jason Shah #
#######################
jMileage.o: gccfloat.o
