Compiling and Flashing

A Simple MakeFile:

build: blink.hex

blink.hex: blink.elf

avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex

blink.elf:

avr-gcc -Wall -Os -mmcu=attiny45 -I/usr/lib/avr/include/ -o blink.elf blink.c

install: blink.hex

avrdude -P usb -c usbasp -p t45 -U flash:w:blink.hex

refresh: clean install

debug:

avr-objdump -h -S blink.elf > blink.lst

clean:

rm -f blink.elf blink.lst blink.hex