]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Use perl directly instead of grep -P
authorErin Call <hello@erincall.com>
Mon, 22 Jan 2018 22:11:46 +0000 (14:11 -0800)
committerJack Humbert <jack.humb@gmail.com>
Fri, 2 Feb 2018 06:10:57 +0000 (01:10 -0500)
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.

tmk_core/rules.mk

index 7a282caccd3ee07f7cdaa40d34e1d4f8a16dcd66..a1df7fc28b7ade3689cc16f50227fde0ab238062 100644 (file)
@@ -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); \