Makefile: helper to print the binary sizes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-10-22 19:44:25 +10:30
parent 2114e617ad
commit 6b50994420

View File

@@ -1093,3 +1093,8 @@ ccan-rune-rune.o: $(CCANDIR)/ccan/rune/rune.c
@$(call VERBOSE, "cc $<", $(CC) $(CFLAGS) -c -o $@ $<)
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}'`