Be able to autodetect ARDUINO_DIR in some cases

This commit is contained in:
Ryan Pavlik 2012-06-28 18:28:22 -05:00
parent 409823d061
commit 854a7aa8c0

View file

@ -263,6 +263,23 @@
# #
######################################################################## ########################################################################
dir_if_exists = $(shell test -e $(1)$(2) && echo $(1) || true)
ifndef ARDUINO_DIR
NIX_DEFAULT_ARDUINO_DIR := $(call dir_if_exists,/usr/share/arduino)
ifdef NIX_DEFAULT_ARDUINO_DIR
ARDUINO_DIR = $(NIX_DEFAULT_ARDUINO_DIR)
endif
MAC_DEFAULT_ARDUINO_DIR := $(call dir_if_exists,/Applications/Arduino.app/Contents/Resources/Java)
ifdef MAC_DEFAULT_ARDUINO_DIR
ARDUINO_DIR = $(MAC_DEFAULT_ARDUINO_DIR)
endif
ifdef ARDUINO_DIR
$(info Using autodetected ARDUINO_DIR '$(ARDUINO_DIR)')
endif
endif
######################################################################## ########################################################################
# #
# Default TARGET to cwd (ex Daniele Vergini) # Default TARGET to cwd (ex Daniele Vergini)