Merge branch 'feature/make_size' into 'master'

Add the size target to project Makefile

Github pull request https://github.com/espressif/esp-idf/pull/154

See merge request !305
This commit is contained in:
Angus Gratton 2016-12-13 07:25:35 +08:00
commit 311b7040d5

View File

@ -10,7 +10,7 @@
# where this file is located. # where this file is located.
# #
.PHONY: build-components menuconfig defconfig all build clean all_binaries check-submodules .PHONY: build-components menuconfig defconfig all build clean all_binaries check-submodules size
all: all_binaries all: all_binaries
# see below for recipe of 'all' target # see below for recipe of 'all' target
# #
@ -28,6 +28,7 @@ help:
@echo "make all - Build app, bootloader, partition table" @echo "make all - Build app, bootloader, partition table"
@echo "make flash - Flash all components to a fresh chip" @echo "make flash - Flash all components to a fresh chip"
@echo "make clean - Remove all build output" @echo "make clean - Remove all build output"
@echo "make size - Display the memory footprint of the app"
@echo "" @echo ""
@echo "make app - Build just the app" @echo "make app - Build just the app"
@echo "make app-flash - Flash just the app" @echo "make app-flash - Flash just the app"
@ -232,7 +233,8 @@ HOSTCC := $(CC)
HOSTLD := $(LD) HOSTLD := $(LD)
HOSTAR := $(AR) HOSTAR := $(AR)
HOSTOBJCOPY := $(OBJCOPY) HOSTOBJCOPY := $(OBJCOPY)
export HOSTCC HOSTLD HOSTAR HOSTOBJCOPY HOSTSIZE := $(SIZE)
export HOSTCC HOSTLD HOSTAR HOSTOBJCOPY SIZE
# Set target compiler. Defaults to whatever the user has # Set target compiler. Defaults to whatever the user has
# configured as prefix + ye olde gcc commands # configured as prefix + ye olde gcc commands
@ -241,7 +243,8 @@ CXX := $(call dequote,$(CONFIG_TOOLPREFIX))c++
LD := $(call dequote,$(CONFIG_TOOLPREFIX))ld LD := $(call dequote,$(CONFIG_TOOLPREFIX))ld
AR := $(call dequote,$(CONFIG_TOOLPREFIX))ar AR := $(call dequote,$(CONFIG_TOOLPREFIX))ar
OBJCOPY := $(call dequote,$(CONFIG_TOOLPREFIX))objcopy OBJCOPY := $(call dequote,$(CONFIG_TOOLPREFIX))objcopy
export CC CXX LD AR OBJCOPY SIZE := $(call dequote,$(CONFIG_TOOLPREFIX))size
export CC CXX LD AR OBJCOPY SIZE
PYTHON=$(call dequote,$(CONFIG_PYTHON)) PYTHON=$(call dequote,$(CONFIG_PYTHON))
@ -343,6 +346,9 @@ app-clean: $(addsuffix -clean,$(notdir $(COMPONENT_PATHS_BUILDABLE)))
$(summary) RM $(APP_ELF) $(summary) RM $(APP_ELF)
rm -f $(APP_ELF) $(APP_BIN) $(APP_MAP) rm -f $(APP_ELF) $(APP_BIN) $(APP_MAP)
size: $(APP_ELF)
$(SIZE) $(APP_ELF)
# NB: this ordering is deliberate (app-clean before config-clean), # NB: this ordering is deliberate (app-clean before config-clean),
# so config remains valid during all component clean targets # so config remains valid during all component clean targets
config-clean: app-clean config-clean: app-clean