44 lines
791 B
Makefile
44 lines
791 B
Makefile
TARGETS += scoreboard-neale.hex
|
|
TARGETS += scoreboard-susan1.hex
|
|
TARGETS += scoreboard-susan2.hex
|
|
TARGETS += scoreboard-std.hex
|
|
|
|
MCU = attiny84
|
|
|
|
CC = avr-gcc
|
|
CFLAGS += -mmcu=$(MCU)
|
|
CFLAGS += -Os
|
|
CFLAGS += -w
|
|
|
|
LDFLAGS += -mmcu=$(MCU)
|
|
|
|
all: $(TARGETS)
|
|
|
|
scoreboard-%.elf: main.c avr.c config.h avr.h
|
|
$(CC) $(CFLAGS) -DVARIANT=$* $(LDFLAGS) -o $@ avr.c main.c
|
|
|
|
%.hex: %.elf
|
|
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
|
|
|
|
clean:
|
|
rm -f *.elf *.o *.hex .upload
|
|
|
|
|
|
|
|
##
|
|
## Helpful targets for development
|
|
##
|
|
|
|
fuses: AVDFLAGS += -p $(MCU)
|
|
fuses: AVDFLAGS += -c usbtiny
|
|
|
|
upload: scoreboard-neale.hex
|
|
avrdude $(AVDFLAGS) -U flash:w:$<
|
|
|
|
fuses: FUSES += -U lfuse:w:0x7f:m
|
|
fuses: FUSES += -U hfuse:w:0xdd:m
|
|
fuses: FUSES += -U efuse:w:0xff:m
|
|
fuses:
|
|
avrdude $(AVDFLAGS) $(FUSES)
|
|
|