diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..2d553b4 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,21 @@ +MCU = attiny85 +# TODO: change frequency after moving to external oscillator +F_CPU = 1000000UL +TARGET = main + +CC = avr-gcc +OBJCOPY = avr-objcopy + +# check if this is legit with assembly code only +CFLAGS = -mmcu=$(MCU) -Wall -Os -DF_CPU=$(F_CPU) + +all: $(TARGET).hex + +$(TARGET).elf: $(TARGET).S + $(CC) $(CFLAGS) -o $@ $< + +$(TARGET).hex: $(TARGET).elf + $(OBJCOPY) -j .text -j .data -O ihex $< $@ + +clean: + rm -f *.elf *.hex