hw-rollerderby-scoreboard/Makefile

46 lines
799 B
Makefile
Raw Permalink Normal View History

2014-02-02 16:58:54 -07:00
TARGETS += scoreboard-neale.hex
TARGETS += scoreboard-susan1.hex
TARGETS += scoreboard-susan2.hex
TARGETS += scoreboard-std.hex
2013-03-27 22:47:17 -06:00
2013-06-30 14:57:44 -06:00
MCU = attiny84
2013-05-04 19:46:18 -06:00
2013-06-30 14:57:44 -06:00
CC = avr-gcc
CFLAGS += -mmcu=$(MCU)
CFLAGS += -Os
CFLAGS += -w
2013-03-07 23:55:05 -07:00
2013-06-30 14:57:44 -06:00
LDFLAGS += -mmcu=$(MCU)
2014-02-02 16:58:54 -07:00
all: $(TARGETS)
2013-06-30 14:57:44 -06:00
2014-02-02 16:58:54 -07:00
scoreboard-%.elf: main.c avr.c config.h avr.h
$(CC) $(CFLAGS) -DVARIANT=$* $(LDFLAGS) -o $@ avr.c main.c
2013-06-30 14:57:44 -06:00
2014-02-02 16:58:54 -07:00
%.hex: %.elf
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
2014-01-11 21:02:24 -07:00
2014-02-02 16:58:54 -07:00
clean:
rm -f *.elf *.o *.hex .upload
2013-06-30 14:57:44 -06:00
2014-02-02 16:58:54 -07:00
##
## Helpful targets for development
##
2013-06-30 14:57:44 -06:00
2014-02-02 17:06:46 -07:00
VARIANT = neale
2013-06-30 14:57:44 -06:00
2014-02-02 17:06:46 -07:00
AVDFLAGS += -p $(MCU)
AVDFLAGS += -c usbtiny
upload: scoreboard-$(VARIANT).hex
2014-02-02 16:58:54 -07:00
avrdude $(AVDFLAGS) -U flash:w:$<
2013-06-30 14:57:44 -06:00
2014-02-02 16:58:54 -07:00
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)
2013-06-30 14:57:44 -06:00