diff options
author | fauxpark <fauxpark@gmail.com> | 2019-07-12 05:05:13 +1000 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-07-11 12:05:13 -0700 |
commit | 8e348c427d2b8dc670a2967e6cb8d2de4f897f7a (patch) | |
tree | 53c0ef97a35b5aa262bcd4391672ef2b7b7a2398 /tmk_core | |
parent | 2bbbfc61543053f297e38fd070d8b18ee380bff5 (diff) | |
download | qmk_firmware-8e348c427d2b8dc670a2967e6cb8d2de4f897f7a.tar.gz qmk_firmware-8e348c427d2b8dc670a2967e6cb8d2de4f897f7a.zip |
Display firmware size percentage (#6307)
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/rules.mk | 1 |
1 files changed, 1 insertions, 0 deletions
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 \ |