Determine preferences file location dynamically.
This commit is contained in:
parent
de2b5273ec
commit
83e94515e3
1 changed files with 17 additions and 1 deletions
|
@ -183,6 +183,8 @@ endif
|
|||
# Some paths
|
||||
#
|
||||
|
||||
OSTYPE := $(shell uname)
|
||||
|
||||
ifneq (ARDUINO_DIR,)
|
||||
|
||||
ifndef AVR_TOOLS_PATH
|
||||
|
@ -201,8 +203,22 @@ ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries
|
|||
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/arduino/cores/arduino
|
||||
ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/arduino/variants
|
||||
|
||||
ifndef ARDUINO_PREFERENCES_PATH
|
||||
|
||||
ifeq ($(OSTYPE),Linux)
|
||||
ARDUINO_PREFERENCES_PATH = $(HOME)/.arduino/preferences.txt
|
||||
else
|
||||
ARDUINO_PREFERENCES_PATH = $(HOME)/Library/Arduino/preferences.txt
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(wildcard $(ARDUINO_PREFERENCES_PATH)),)
|
||||
$(error "Error: run the IDE once to initialize preferences sketchbook path")
|
||||
endif
|
||||
|
||||
ifndef ARDUINO_SKETCHBOOK
|
||||
ARDUINO_SKETCHBOOK = $(HOME)/sketchbook
|
||||
ARDUINO_SKETCHBOOK = $(shell grep sketchbook.path $(wildcard $(ARDUINO_PREFERENCES_PATH)) | cut -d = -f 2)
|
||||
endif
|
||||
|
||||
ifndef USER_LIB_PATH
|
||||
|
|
Loading…
Reference in a new issue