SRC = main.c twi.c motor.c HDR = twi.h motor.h paint: paint.hex @ %.hex: %.elf avr-objcopy -j .text -j .data -O ihex $< $@ paint.elf: $(SRC) $(HDR) avr-gcc -mmcu=atmega168 -DF_CPU=8000000UL $(SRC) -o paint.elf -Os download: paint.hex avrdude -c avrispmkII -p m168 -P usb -B 1 -U flash:w:paint.hex clean: rm -f paint.elf paint.hex