summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b3e7d33..c082c6f 100644
--- a/Makefile
+++ b/Makefile
@@ -11,13 +11,18 @@ CFLAGS_LD=-Wl,-T,avr4-signature.x
CFLAGS=${CFLAGS_WARN} ${CFLAGS_OPT} ${CFLAGS_LD}
MCU_door=48
MCU_lightctrl=88
+AVRDUDE=avrdude
love: $(foreach target,$(TARGETS),$(target).elf)
avr-size $^
ifdef TARGET
flash: ${TARGET}.flash
- avrdude -p m$(MCU_$(basename $<)) -c stk500v2 -P avrdoper -y -U flash:w:$<
+ $(AVRDUDE) -p m$(MCU_$(basename $<)) -c stk500v2 -P avrdoper -y \
+ -U eeprom:r:eeprom:r
+ $(AVRDUDE) -p m$(MCU_$(basename $<)) -c stk500v2 -P avrdoper -y \
+ -U flash:w:$< \
+ -U eeprom:w:eeprom:r
else
flash:
@echo the flash target is available only with TARGET set to something. use e.g. \"make flash TARGET=door\" >&2