This repository has been archived on 2026-07-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
il-clock/src/Makefile
T
2025-12-26 16:07:17 +01:00

29 lines
615 B
Makefile

MCU = attiny85
F_CPU = 1000000UL
TARGET = clockinator
SRCS = $(TARGET).S
CC = avr-gcc
OBJCOPY = avr-objcopy
PORT = /dev/tty.usbmodem101
BAUD = 19200
PROGRAMMER = usbasp
AVRDUDE = avrdude -P $(PORT) -b $(BAUD)
CFLAGS = -mmcu=$(MCU) -Wall -Os -DF_CPU=$(F_CPU)
all: $(TARGET).hex
$(TARGET).elf: $(SRCS)
$(CC) $(CFLAGS) -o $@ $<
$(TARGET).hex: $(TARGET).elf
$(OBJCOPY) -j .text -j .data -O ihex $< $@
# Flash to MCU
install: $(TARGET).hex
$(AVRDUDE) -c $(PROGRAMMER) -p $(MCU) -U flash:w:$(TARGET).hex:i -v
clean:
rm -f *.elf *.hex
.PHONY: all install clean