hw-rollerderby-scoreboard/Makefile

42 lines
586 B
Makefile

PROG = main
MCU = attiny84
CC = avr-gcc
CFLAGS += -mmcu=$(MCU)
CFLAGS += -Os
CFLAGS += -w
LDFLAGS += -mmcu=$(MCU)
AVDFLAGS += -p $(MCU)
AVDFLAGS += -c usbtiny
CLOCK_HZ = 1600000
FUSES += -U lfuse:w:0x7f:m
FUSES += -U hfuse:w:0xdd:m
FUSES += -U efuse:w:0xff:m
upload: .upload
.upload: $(PROG).hex
avrdude $(AVDFLAGS) -U flash:w:$<
touch $@
fuses:
avrdude $(AVDFLAGS) $(FUSES)
main: main.o avr.o
avr.o: CFLAGS += -DCLOCK_HZ=$(CLOCK_HZ)
$(PROG).hex: $(PROG)
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
clean:
rm -f $(PROG) *.o *.hex .upload