Add Makefile
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user