From 77949a52f64365aa603ad64a7c2d68f091fbfe13 Mon Sep 17 00:00:00 2001 From: Erick Ahmed Date: Sat, 20 Dec 2025 18:41:12 +0100 Subject: [PATCH] Add Makefile --- src/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/Makefile 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