#PART=m328p #MCU=atmega328 PART=t85 MCU=attiny85 PROG=avrispMKII F_CPU=1000000 SRC=bom.c tiny-twi.c HDR= FLAGS=-mmcu=$(MCU) -DF_CPU=$(F_CPU)UL -funsigned-char -Os -fpack-struct -Wall default: bom.hex %.hex: %.elf avr-objcopy -j .text -j .data -O ihex $< $@ bom.elf: $(SRC) $(HDR) avr-g++ $(FLAGS) $(SRC) -o $@ %.s: %.c avr-gcc $(FLAGS) -S $< -o $@ program: bom.hex avrdude -p $(PART) -c $(PROG) -P usb -B 5 -U flash:w:bom.hex