From 8e348c427d2b8dc670a2967e6cb8d2de4f897f7a Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 12 Jul 2019 05:05:13 +1000 Subject: Display firmware size percentage (#6307) --- tmk_core/rules.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'tmk_core') diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 8f876a383c..96b6e3a271 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -398,6 +398,7 @@ check-size: $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) $(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE))) $(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE))) + $(eval PERCENT_SIZE=$(shell expr $(CURRENT_SIZE) \* 100 / $(MAX_SIZE))) if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \ $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then \ -- cgit v1.2.3