From 4c89145944e6f3bdedf5a85011e9b3087e51414b Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sat, 28 May 2011 00:48:25 +0200 Subject: digital/avr/make: add size report for AVR --- digital/avr/make/Makefile.avr | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'digital/avr') 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) \ -- cgit v1.2.3