aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
authormtei <2170248+mtei@users.noreply.github.com>2018-08-16 21:35:24 +0900
committerJack Humbert <jack.humb@gmail.com>2018-08-16 12:04:35 -0400
commitfe0683938a355f3b7662fb384058ce4c96f10c64 (patch)
treec226bcd94a3b80dda55f4f4adee87cc38a545225 /tmk_core
parent15a73f4f64a3b2b109e63cf1eeb37c9875c3d870 (diff)
downloadfirmware-fe0683938a355f3b7662fb384058ce4c96f10c64.tar.gz
firmware-fe0683938a355f3b7662fb384058ce4c96f10c64.tar.bz2
firmware-fe0683938a355f3b7662fb384058ce4c96f10c64.zip
change messege at 'check-size' target
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/rules.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index b556c4609..5b1858b71 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -374,6 +374,8 @@ ifeq ($(findstring avr-gcc,$(CC)),avr-gcc)
check-size:
$(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/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)))
if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \
$(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \
if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then $(PRINT_WARNING_PLAIN); $(SILENT) || printf " * $(MSG_FILE_TOO_BIG)" ; else $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; fi \