# Polyathlon bot makefile April 23 2009
#
CC = avr-gcc
OC = avr-objcopy
#
name = Polyathlon
#
$(name).hex : $(name).out
	$(OC) -O ihex $(name).out $(name).hex
	
$(name).out : $(name).o
	$(CC) -mmcu=atmega8535 -o $(name).out $(name).o 
	
$(name).o : $(name).c
	$(CC) -c -O2 -Wall -mmcu=atmega8535 $(name).c -o $(name).o
	
	 
clean:
	rm -f $(name).o $(name).out $(name).hex

# avrdude driver for AVRISP MkII USB programmer
# fuses set for brownout protection and protect eeprom from erase

pgm:
	avrdude -c avrispmkii -p ATMEGA8535 -P usb -e -U flash:w:$(name).hex -U hfuse:w:0x41:m -U lfuse:w:0xbe:m

lst:
	avr-objdump -d $(name).o | less



