Add Makefile

This commit is contained in:
2025-12-20 18:41:12 +01:00
parent cd46376f77
commit 77949a52f6
+21
View File
@@ -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