aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeffkowalski <jeff.kowalski@gmail.com>2012-08-18 19:24:07 -0700
committerjeffkowalski <jeff.kowalski@gmail.com>2012-08-18 19:24:07 -0700
commitd09a316d7ae990bdfbd3630a289b27f2dfeb5ec3 (patch)
treeac06fbbf993f3ab51aaff8e378fd74c8e398595b
parenteef73003c939e418a0cb09ca1dcaac9b86c2c5d9 (diff)
Added autodetection of ARDUINO_SKETCHBOOK, by looking to match IDE's
setting in $(HOME)/.arduino/preferences.txt before setting default of $(HOME)/sketchbook.
-rw-r--r--arduino-mk/Arduino.mk14
1 files changed, 13 insertions, 1 deletions
diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk
index 9cd973f..e08fd62 100644
--- a/arduino-mk/Arduino.mk
+++ b/arduino-mk/Arduino.mk
@@ -405,7 +405,19 @@ endif
# Miscellanea
#
ifndef ARDUINO_SKETCHBOOK
- ARDUINO_SKETCHBOOK = $(HOME)/sketchbook
+ ifneq ($(wildcard $(HOME)/.arduino/preferences.txt),)
+ ARDUINO_SKETCHBOOK = $(shell grep --max-count=1 --regexp="sketchbook.path=" \
+ $(HOME)/.arduino/preferences.txt | \
+ sed -e 's/sketchbook.path=//' )
+ endif
+ ifneq ($(ARDUINO_SKETCHBOOK),)
+ $(call show_config_variable,ARDUINO_SKETCHBOOK,[AUTODETECTED],(in arduino preferences file))
+ else
+ ARDUINO_SKETCHBOOK = $(HOME)/sketchbook
+ $(call show_config_variable,ARDUINO_SKETCHBOOK,[DEFAULT])
+ endif
+else
+ $(call show_config_variable,ARDUINO_SKETCHBOOK)
endif
ifndef USER_LIB_PATH