Added autodetection of ARDUINO_SKETCHBOOK, by looking to match IDE's

setting in $(HOME)/.arduino/preferences.txt before setting default of
$(HOME)/sketchbook.
This commit is contained in:
jeffkowalski 2012-08-18 19:24:07 -07:00
parent eef73003c9
commit d09a316d7a

View file

@ -405,7 +405,19 @@ endif
# Miscellanea
#
ifndef ARDUINO_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