summaryrefslogtreecommitdiffhomepage
path: root/digital/avr/make
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-28 00:48:25 +0200
committerNicolas Schodet2011-05-29 09:57:32 +0200
commit4c89145944e6f3bdedf5a85011e9b3087e51414b (patch)
tree0e1736ddb5623230b98fe2cd42227a3a467adf0e /digital/avr/make
parent4882fbefaeca9cc5292cec9a2f93d34f04e67b5c (diff)
digital/avr/make: add size report for AVR
Diffstat (limited to 'digital/avr/make')
-rw-r--r--digital/avr/make/Makefile.avr7
1 files changed, 6 insertions, 1 deletions
diff --git a/digital/avr/make/Makefile.avr b/digital/avr/make/Makefile.avr
index bffca25a..1fe5ff31 100644
--- a/digital/avr/make/Makefile.avr
+++ b/digital/avr/make/Makefile.avr
@@ -11,6 +11,7 @@ AVR_LDLIBS := $(LDLIBS) $(AVR_LIBS)
AVR_CC := avr-gcc
AVR_OBJCOPY := avr-objcopy
AVR_OBJDUMP := avr-objdump
+AVR_SIZE := avr-size --mcu=$(AVR_MCU) -C
AVR_COMPILE.c = $(AVR_CC) $(AVR_CFLAGS) $(AVR_CPPFLAGS) -c
ifdef L
AVR_COMPILE.c += -Wa,-adhlns=$(@:%.avr.o=%.c.avr.lst)
@@ -20,7 +21,7 @@ AVR_LINK.o := $(AVR_CC) $(AVR_CFLAGS) $(AVR_LDFLAGS)
# Main rules.
-avr: elf lst hex
+avr: elf lst hex size
simu: simuelf
@@ -90,6 +91,7 @@ text: hex
hex: $(AVR_PROGS:%=%.hex)
bin: $(AVR_PROGS:%=%.bin)
srec: $(AVR_PROGS:%=%.srec)
+size: $(AVR_PROGS:%=%.size)
%.hex: %.avr.elf
$(AVR_OBJCOPY) -j .text -j .data -O ihex $< $@
@@ -100,6 +102,9 @@ srec: $(AVR_PROGS:%=%.srec)
%.bin: %.avr.elf
$(AVR_OBJCOPY) -j .text -j .data -O binary $< $@
+%.size: %.avr.elf
+ $(AVR_SIZE) $< | grep Full
+
# Rules for building the .eeprom rom images.
EEPROMS := $(AVR_PROGS:%=%_eeprom.hex) $(AVR_PROGS:%=%_eeprom.bin) \