
all: bu5004fw.hex bu5004fw2.hex 

clean:
	rm -f *.hex *.elf *.c0 *.s *~

bu5004fw.hex: bu5004fw.c char_data.h frame_data.h Makefile
	avr-gcc -mmcu=attiny2313 -Wall -Os -o bu5004fw.elf bu5004fw.c 
	avr-gcc -mmcu=attiny2313 -Os -S -o bu5004fw.s bu5004fw.c 
	avr-objcopy --output-target=ihex bu5004fw.elf bu5004fw.hex

bu5004fw2.hex: bu5004fw.c char_data.h frame_data.h Makefile
	avr-gcc -mmcu=attiny2313 -Wall -D USE_DIRECT_PROG_MODE -Os -o bu5004fw2.elf bu5004fw.c 
	avr-gcc -mmcu=attiny2313 -D USE_DIRECT_PROG_MODE -Os -S -o bu5004fw2.s bu5004fw.c 
	avr-objcopy --output-target=ihex bu5004fw2.elf bu5004fw2.hex
