###########################################################################
#	Makefile for Greenpower CarComputer Test/Example Code
#			T.Barnaby,	2008-02-28
###########################################################################
#

PCC		= sdcc
#PCFLAGS 	= -mpic16 -p18f2420 -I. -Wl,"-s 18f2420.lkr" --ivt-loc=0x0800
#PCFLAGS 	= -mpic16 -p18f2520 -I. -Wl,"-s 18f2520.lkr" --ivt-loc=0x0800
#PCFLAGS 	= -mpic16 -p18f2520 -I. --ivt-loc=0x0000
PCFLAGS 	= -mpic16 -p18f2520 -I.
#PLDFLAGS	= --use-crt=crt0.o

# Optimise flags
PCFLAGS 	+= -V --optimize-cmp --obanksel=2 --opt-code-size --fommit-frame-pointer --denable-peeps
#PCFLAGS 	+= --optimize-goto --optimize-cmp --optimize-df --obanksel=2 --opt-code-size --fommit-frame-pointer --denable-peeps


.SUFFIXES: .hex

.c.hex: picLib3.c
	$(PCC) $(PCFLAGS) $(PLDFLAGS) $<
.c.o:
	$(PCC) $(PCFLAGS) $(PLDFLAGS) -c $<

PROGS	= testLed.hex testSwitch.hex testLcd.hex testTimer.hex
PROGS	+= testSwitches.hex testClock.hex testEeprom.hex
PROGS	+= carLog1.hex

all:	${PROGS}

clean:
	rm -f *.o *.hex *.cod *.lst *.p *.stc *.map *.asm *.cof

###########################################################################
#	Information
###########################################################################
#
# Programming:
#	picProgrammer -w test1.hex
