summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorMichael F. Lamb <mike@datagrok.org>2018-02-06 12:05:48 -0800
committerJack Humbert <jack.humb@gmail.com>2018-02-08 16:47:18 -0500
commitfae81322959a2e6877238ca4e542cac805a2e7c2 (patch)
tree6b739ae0e5365b401c9080bb91a4f930a327fc3b /tmk_core
parent6835ae82095427b2b5d5b3839a8d54845244169b (diff)
make check_size work across platforms
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/rules.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index a1df7fc28b..18aef8d8ca 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -371,7 +371,7 @@ show_path:
@echo OBJ=$(OBJ)
check-size:
- $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | perl -ne 'print "$&\n" if /(?<=AVR_SIZE: ).+/'`; echo $$(($$n)) || echo 0))
+ $(eval MAX_SIZE=$(shell n=`avr-gcc -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))
if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \
$(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \