From ce235b6bb3465452ebbe6ae257639cc550654287 Mon Sep 17 00:00:00 2001 From: Simon John Date: Fri, 27 Mar 2015 16:11:27 +0000 Subject: Add = to PARSE_BOARD regex to make it less greedy. For instance in the Sparkfun 1.6 core, we have: promicro16.build.vid.0=0x1B4F promicro16.build.vid.1=0x1B4F promicro16.build.vid=0x1B4F So we end up matching all 3 instead of just the last one. Adding the = means we're looking for promicro16.build.vid= so not catching the .0 or .1 version. --- Arduino.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index cc156fc..1d5c6d2 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -552,7 +552,7 @@ endif ifndef PARSE_BOARD # result = $(call READ_BOARD_TXT, 'boardname', 'parameter') - PARSE_BOARD = $(shell grep -v '^\#' $(BOARDS_TXT) | grep $(1).$(2) | cut -d = -f 2 ) + PARSE_BOARD = $(shell grep -v '^\#' $(BOARDS_TXT) | grep $(1).$(2)= | cut -d = -f 2 ) endif # If NO_CORE is set, then we don't have to parse boards.txt file -- cgit v1.2.3 From 8d52840eb86fa45158a8b7387931ea5e43e2b4a6 Mon Sep 17 00:00:00 2001 From: Simon John Date: Fri, 27 Mar 2015 16:57:45 +0000 Subject: Now we know that arduino 1.6.1 uses the ~/.arduino15 directory we can find preferences.txt Still need to find out where it looks on OSX/Cygwin --- Arduino.mk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index 1d5c6d2..c8cd3b2 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -329,10 +329,16 @@ endif ifndef ARDUINO_SKETCHBOOK ifndef ARDUINO_PREFERENCES_PATH + ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1) + AUTO_ARDUINO_PREFERENCES := $(firstword \ + $(call dir_if_exists,$(HOME)/.arduino15/preferences.txt) ) + # TODO: add mac/windows version once known + else + AUTO_ARDUINO_PREFERENCES := $(firstword \ + $(call dir_if_exists,$(HOME)/.arduino/preferences.txt) \ + $(call dir_if_exists,$(HOME)/Library/Arduino/preferences.txt) ) + endif - AUTO_ARDUINO_PREFERENCES := $(firstword \ - $(call dir_if_exists,$(HOME)/.arduino/preferences.txt) \ - $(call dir_if_exists,$(HOME)/Library/Arduino/preferences.txt) ) ifdef AUTO_ARDUINO_PREFERENCES ARDUINO_PREFERENCES_PATH = $(AUTO_ARDUINO_PREFERENCES) $(call show_config_variable,ARDUINO_PREFERENCES_PATH,[AUTODETECTED]) -- cgit v1.2.3