aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/rules.mk
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/rules.mk
parent6835ae82095427b2b5d5b3839a8d54845244169b (diff)
downloadfirmware-fae81322959a2e6877238ca4e542cac805a2e7c2.tar.gz
firmware-fae81322959a2e6877238ca4e542cac805a2e7c2.tar.bz2
firmware-fae81322959a2e6877238ca4e542cac805a2e7c2.zip
make check_size work across platforms
Diffstat (limited to 'tmk_core/rules.mk')
-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 a1df7fc28..18aef8d8c 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); \