# Example Makefile for test project
# Copied from http://www.enteract.com/~rneswold/avr/x421.html
# with "clean" an "install" added.

CC=avr-gcc
OBJCOPY=avr-objcopy

#CFLAGS=-g -mmcu=at90s8515
CFLAGS=-mmcu=at90s8515 -save-temps

rom.hex : test.out
	$(OBJCOPY) -j .text -O ihex test.out rom.hex

test.out : test.o
	$(CC) $(CFLAGS) -o test.out -Wl,-Map,test.map test.o

test.o : test.S
	$(CC) $(CFLAGS) -Wall -Wextra -c -o test.o test.S

clean:
	rm -f *.o *.out *.map *.hex *.s

install: rom.hex
	avrdude -P /dev/ttyS0 -p m8515 -c stk500v2 -e -U rom.hex 

