diff options
author | Joel Challis <[email protected]> | 2023-09-12 05:16:39 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-09-12 05:16:39 +0100 |
commit | 06cec720dde5e4c9acfb476cbdf3e098a2172eee (patch) | |
tree | f2dd40ad9a08a2061520d950c19d68a5459a7182 /builddefs/common_rules.mk | |
parent | ad4fc42e6be5da5c12e64b60f53839d951532a19 (diff) | |
download | qmk_firmware-06cec720dde5e4c9acfb476cbdf3e098a2172eee.tar.gz qmk_firmware-06cec720dde5e4c9acfb476cbdf3e098a2172eee.zip |
Remove 'Firmware size check does not yet support' message (#21977)
Diffstat (limited to 'builddefs/common_rules.mk')
-rw-r--r-- | builddefs/common_rules.mk | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/builddefs/common_rules.mk b/builddefs/common_rules.mk index d20e9ad74d..261ab7da02 100644 --- a/builddefs/common_rules.mk +++ b/builddefs/common_rules.mk @@ -380,33 +380,9 @@ dump_vars: objs-size: for i in $(OBJ); do echo $$i; done | sort | xargs $(SIZE) -ifeq ($(findstring avr-gcc,$(CC)),avr-gcc) -SIZE_MARGIN = 1024 +# size check optionally implemented in its platform.mk check-size: - $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | $(SED) -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) - $(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 \ - $(REMOVE) $(TARGET).$(FIRMWARE_FORMAT); \ - $(REMOVE) $(BUILD_DIR)/$(TARGET).{hex,bin,uf2}; \ - printf "\n * $(MSG_FILE_TOO_BIG)"; $(PRINT_ERROR_PLAIN); \ - else \ - if [ $(FREE_SIZE) -lt $(SIZE_MARGIN) ]; then \ - $(PRINT_WARNING_PLAIN); printf " * $(MSG_FILE_NEAR_LIMIT)"; \ - else \ - $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; \ - fi ; \ - fi ; \ - fi -else -check-size: - $(SILENT) || echo "$(MSG_CHECK_FILESIZE_SKIPPED)" -endif check-md5: $(MD5SUM) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT) |