Makefile: improve print-binary-sizes to be more meaningful.
What changed, and why it matters
This commit changes a Makefile helper target that prints the sizes of compiled programs. It switches from reporting disk file sizes to reporting memory sizes (using the 'size' tool), includes additional binary categories, and fixes a build dependency. There is no security relevance in the change itself.
No security action needed. Treat as a normal build-system improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies the ‘print-binary-sizes’ target in the top-level Makefile. It adds $(BIN_PROGRAMS) to the dependency list, replaces ‘find -printf %s’ output with ‘size -t’ output for user-facing programs (PKGLIBEXEC_PROGRAMS, BIN_PROGRAMS minus tools/reckless, and PLUGINS), and then prints a total line for all programs and tests. This is a build/observability improvement with no runtime code changes.
Changed components
MakefileInspect captured patch +5 / −4
diff --git a/Makefile b/Makefile
index e2baaa58..0b7b88f8 100644
--- a/Makefile
+++ b/Makefile
@@ -1152,7 +1152,8 @@ ccan-rune-rune.o: $(CCANDIR)/ccan/rune/rune.c
ccan-rune-coding.o: $(CCANDIR)/ccan/rune/coding.c
@$(call VERBOSE, "cc $<", $(CC) $(CFLAGS) -c -o $@ $<)
-print-binary-sizes: $(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS)
- @find $(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS) -printf '%p\t%s\n'
- @echo 'Total program size: '`find $(ALL_PROGRAMS) -printf '%s\n' | awk '{TOTAL+= $$1} END {print TOTAL}'`
- @echo 'Total tests size: '`find $(ALL_TEST_PROGRAMS) -printf '%s\n' | awk '{TOTAL+= $$1} END {print TOTAL}'`
+print-binary-sizes: $(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS) $(BIN_PROGRAMS)
+ @echo User programs:
+ @size -t $(PKGLIBEXEC_PROGRAMS) $(filter-out tools/reckless,$(BIN_PROGRAMS)) $(PLUGINS)
+ @echo All programs:
+ @size -t $(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS) | tail -n1
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.