all: eeprom_rw	eeprom_rw_128

CC=avr-gcc

CFLAGS = -g -O2

eeprom_rw: main.c
	avr-gcc -g main.c \
		-Wl,--section-start=.myeeprom1=0x810020 \
		-Wl,--section-start=.myeeprom2=0x810010 \
		-mmcu=at90s8515 -o eeprom_rw

eeprom_rw_128: main128.c
	avr-gcc -g main128.c \
		-Wl,--section-start=.myeeprom1=0x810020 \
		-Wl,--section-start=.myeeprom2=0x810010 \
		-mmcu=atmega128 -o eeprom_rw_128

clean: 
	rm -f *.o
	rm -f eeprom_rw
	rm -f eeprom_rw_128
	rm -f trace*

t128: eeprom_rw_128
	../../src/simulavr -datmega128 -f eeprom_rw_128 -t trace128

t: eeprom_rw
	../../src/simulavr -dat90s8515 -f eeprom_rw -t trace



