build: Include a summary of text/data/bss sizes.

This commit is contained in:
Solomon Peachy 2013-08-04 08:47:31 -04:00
parent df82d67764
commit b56572dfa2
2 changed files with 7 additions and 3 deletions

View File

@ -4,12 +4,14 @@
include Makefile.common include Makefile.common
# Now for the image definition # Now for the image definition
IMAGE = $(MCU)-main.bin IMAGE = $(MCU)-main
all: .toolchain version $(IMAGE) all: .toolchain version $(IMAGE).bin
.PHONY: clean distclean version dep .PHONY: clean distclean version dep
.PRECIOUS: %.elf
# Include library target # Include library target
include libs/$(MCU).mk include libs/$(MCU).mk
include src/build.mk include src/build.mk
@ -45,12 +47,13 @@ $(MCU).ld: libs/$(MCU).ld.in inc/$(MCU)_hw.h
-Wl,--no-whole-archive $(LIBRARIES) \ -Wl,--no-whole-archive $(LIBRARIES) \
-Wl,--build-id=none \ -Wl,--build-id=none \
-flto=$(JLEVEL) -flto=$(JLEVEL)
$(Q)$(SIZE) $@
# -Wl,-allow-multiple-definition # -Wl,-allow-multiple-definition
# Cleaning up.. # Cleaning up..
clean: clean:
@$(E) " CLEAN " @$(E) " CLEAN "
$(Q)${RM} -f $(SRC_OBJS) libs/*.o src/*.a $(MCU).ld $(Q)${RM} -f $(SRC_OBJS) libs/*.a libs/*.o src/*.a $(MCU).ld $(IMAGE).bin $(IMAGE).elf
distclean: clean distclean: clean
@$(E) " DISTCLEAN" @$(E) " DISTCLEAN"

View File

@ -15,6 +15,7 @@ OBJCOPY=$(CROSS_COMPILE)objcopy
AR=$(CROSS_COMPILE)ar AR=$(CROSS_COMPILE)ar
AS=$(CROSS_COMPILE)as AS=$(CROSS_COMPILE)as
GDB=$(CROSS_COMPILE)gdb GDB=$(CROSS_COMPILE)gdb
SIZE=$(CROSS_COMPILE)size
RM=rm RM=rm
ECHO=echo ECHO=echo
HOSTCC ?= gcc HOSTCC ?= gcc