From c8eb54be48ae99d80c124c6fd9d83281f14fcd35 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 27 Jan 2026 09:36:23 +1030 Subject: [PATCH] Makefile: improve print-binary-sizes to be more meaningful. Users care about memory more than disk, and they care about programs they run more than our test programs and tools. Also, fix dependencies on print-binary-sizes, as spotted by https://github.com/Lagrang3 Signed-off-by: Rusty Russell --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e2baaa58f..0b7b88f86 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