galileo: Print elf sections sizes after build

This patch changes Galileo's buildsystem to print the elf sections
sizes after a new image is built. This way we can easily track how
these sections increase or decrease after any change.

To achieve that, we define a custom linking rule which is pretty much
the same as the default linking rule define in Makefile.include, but
we run 'size' command after the image is built.
This commit is contained in:
Andre Guedes 2015-07-01 18:20:20 -03:00 committed by Jesus Sanchez-Palencia
parent e820a8b03b
commit 7e13081776
2 changed files with 8 additions and 0 deletions

View file

@ -7,6 +7,7 @@ CC = gcc
LD = gcc LD = gcc
AS = as AS = as
OBJCOPY = objcopy OBJCOPY = objcopy
SIZE = size
STRIP = strip STRIP = strip
CFLAGSNO = -Wall -g -I/usr/local/include CFLAGSNO = -Wall -g -I/usr/local/include
CFLAGS += $(CFLAGSNO) CFLAGS += $(CFLAGSNO)

View file

@ -6,3 +6,10 @@ OPENOCD_SCRIPTS = $(CONTIKI)/platform/galileo/bsp/openocd-scripts
debug: $(CONTIKI_PROJECT).$(TARGET) debug: $(CONTIKI_PROJECT).$(TARGET)
@openocd -s $(OPENOCD_SCRIPTS) -f debug.cfg &> $(shell pwd)/LOG_OPENOCD & @openocd -s $(OPENOCD_SCRIPTS) -f debug.cfg &> $(shell pwd)/LOG_OPENOCD &
@$(GDB) $< -ex "target remote :3333" @$(GDB) $< -ex "target remote :3333"
CUSTOM_RULE_LINK=1
%.$(TARGET): %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a
$(TRACE_LD)
$(Q)$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out %.a,$^} \
${filter %.a,$^} $(TARGET_LIBFILES) -o $@
@$(SIZE) $@