Makefile: add possibility to print obj size
The only place where the build system is certain
to have the target available is the link rule.
Add an option to run size on the result produced.
This will be useful for tracking how changes affect
binary sizes.
@@ -467,6 +467,9 @@ endif
$(TRACE_LD)
$(Q)$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out $(LDSCRIPT) %.a,$^} \
${filter %.a,$^} $(TARGET_LIBEXTRAS) -o $(LIBNAME)
+ifdef BINARY_SIZE_LOGFILE
+ $(Q)$(SIZE) $(LIBNAME) | grep $(BUILD_DIR_BOARD) >> $(BINARY_SIZE_LOGFILE)
+endif
endif
%.$(TARGET): $(BUILD_DIR_BOARD)/%.$(TARGET)
