diff options
-rw-r--r-- | Makefile.rules | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/Makefile.rules b/Makefile.rules index 4a6cca7542..84c0178641 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -170,12 +170,8 @@ buildall: build_boards $(MAKE) runtests @touch .tests-passed @echo "$@ completed successfully!" - @echo "Tightest boards' RW flash images, bytes free:" - @grep . build/*/RW/space_free_flash.txt | \ - sed 's,build/\([^/]*\)/RW/space_free_flash.txt:\(.*\)$$,\2 \1,' | \ - sort -n | head -3 | while read size board; do \ - printf "%-10s: %6d\n" $$board $$size; \ - done + $(call cmd_stats,RO) + $(call cmd_stats,RW) @echo "Tightest boards' RW RAM images, bytes free:" @grep . build/*/RW/space_free_ram.txt | \ sed 's,build/\([^/]*\)/RW/space_free_ram.txt:\(.*\)$$,\2 \1,' | \ @@ -340,6 +336,7 @@ cmd_report_cov=genhtml -q -o build/host/coverage_rpt -t \ # Unless V is set to 0 we always want the 'size:' target to report its output, # there is no point in generating a short form command trace when calculating # size. +# $1: 'RO' or 'RW' ifeq ($(V),0) cmd_size= else @@ -348,16 +345,27 @@ cmd_size=$(Q)awk '\ /^FLASH/ {flash_size = strtonum($$3)} \ /__ram_free =/ {ram_free = strtonum($$1)} \ END {room_free = flash_size - image_size; \ - print ram_free > "$(out)/RW/space_free_ram.txt"; \ + print ram_free > "$(out)/$(1)/space_free_ram.txt"; \ printf " *** "; \ if (flash_size > 0) { \ - print room_free > "$(out)/RW/space_free_flash.txt"; \ + print room_free > "$(out)/$(1)/space_free_flash.txt"; \ printf ("%s bytes in flash and ", room_free);\ } \ printf ("%s bytes in RAM still available on $(BOARD) ****\n", ram_free) \ - }' $(out)/RW/$(PROJECT).RW.map + }' $(out)/$(1)/$(PROJECT).$(1).map endif +# List the smallest free flash spaces +# $1: 'RO' or 'RW' +cmd_stats= \ + $(Q)echo "Smallest free spaces in $(1) flash (bytes):"; \ + grep . build/*/$(1)/space_free_flash.txt | \ + sed 's,build/\([^/]*\)/$(1)/space_free_flash.txt:\(.*\)$$,\2 \1,' | \ + sort -n | head -3 | \ + while read size board; do \ + printf "%-10s: %6d\n" $$board $$size; \ + done + build/host/%.info: run-% $(call quiet,lcov,COV ) @@ -740,7 +748,10 @@ analyzestack: $(out)/util/export_taskinfo.so # Calculate size of remaining room in flash, using variables generated by # linker. size: $(out)/$(PROJECT).bin - $(call cmd_size) +ifneq ($(CONFIG_FW_INCLUDE_RO),) + $(call cmd_size,RO) +endif + $(call cmd_size,RW) .SECONDARY: |