# 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
# see below for recipe of 'all' target
#
@echo "make all - Build app, bootloader, partition table"
@echo "make flash - Flash all components to a fresh chip"
@echo "make clean - Remove all build output"
+ @echo "make size - Display the memory footprint of the app"
@echo ""
@echo "make app - Build just the app"
@echo "make app-flash - Flash just the app"
HOSTLD := $(LD)
HOSTAR := $(AR)
HOSTOBJCOPY := $(OBJCOPY)
-export HOSTCC HOSTLD HOSTAR HOSTOBJCOPY
+HOSTSIZE := $(SIZE)
+export HOSTCC HOSTLD HOSTAR HOSTOBJCOPY SIZE
# Set target compiler. Defaults to whatever the user has
# configured as prefix + ye olde gcc commands
LD := $(call dequote,$(CONFIG_TOOLPREFIX))ld
AR := $(call dequote,$(CONFIG_TOOLPREFIX))ar
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))
app-clean: $(addsuffix -clean,$(notdir $(COMPONENT_PATHS_BUILDABLE)))
$(summary) RM $(APP_ELF)
rm -f $(APP_ELF) $(APP_BIN) $(APP_MAP)
+
+size: $(APP_ELF)
+ $(SIZE) $(APP_ELF)
# NB: this ordering is deliberate (app-clean before config-clean),
# so config remains valid during all component clean targets