summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorErin Call <hello@erincall.com>2018-01-22 14:11:46 -0800
committerJack Humbert <jack.humb@gmail.com>2018-02-02 01:10:57 -0500
commit904b1b3f99201f4bead195e2b777a71cb25736d8 (patch)
tree566fd8ef5bbcfccde504e9e4c1e96d673f430e60 /tmk_core
parent0310eafdcf3fd372f6804f209d42b5baf927eee3 (diff)
Use perl directly instead of grep -P
BSD grep (the one on OSX) lacks a -P flag. The grep -P command thus fails and prints a usage message to the terminal. This fixes that.
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 7a282caccd..a1df7fc28b 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 | grep -oP "(?<=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 | perl -ne 'print "$&\n" if /(?<=AVR_SIZE: ).+/'`; 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); \