summaryrefslogtreecommitdiffstats
path: root/tmk_core/rules.mk
diff options
context:
space:
mode:
authordankm <dan.mcgregor@usask.ca>2018-03-26 14:08:08 -0600
committerJack Humbert <jack.humb@gmail.com>2018-03-26 16:08:08 -0400
commit19a1fbaca2137a9d4cd529e363039a612a4f941d (patch)
tree83f88e254ccb527b2272b012d982ffa80086fb5a /tmk_core/rules.mk
parentae7284edb8bd8ed7fcab29415049bf03baf57f8d (diff)
Better non-Linux support (#2524)
* grep -> $(GREP) Some UNIXy systems (FreeBSD for example) don't use GNU grep by default. Allow the user to specify which grep implementation to use so that GNU grep can be specified. * Allow using versioned avr-gcc command Don't hardcode "avr-gcc", and allow strings such as "avr-gcc8", or "avr-gcc-7.3.0" to match checks for "avr-gcc".
Diffstat (limited to 'tmk_core/rules.mk')
-rw-r--r--tmk_core/rules.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index ff6af4a882..b556c4609b 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -370,9 +370,9 @@ show_path:
@echo SRC=$(SRC)
@echo OBJ=$(OBJ)
-ifeq ($(CC),avr-gcc)
+ifeq ($(findstring avr-gcc,$(CC)),avr-gcc)
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 | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'`; echo $$(($$n)) || echo 0))
+ $(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))
if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \
$(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \