aboutsummaryrefslogtreecommitdiff
path: root/Common.mk
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2014-10-24 09:02:51 +0530
committerSudar <sudar@sudarmuthu.com>2014-10-24 09:02:51 +0530
commit3eee9851bb176d0695d3dd091d6ebf8412ac382f (patch)
tree8df90c03c25ecc0a83eb21af64846b135223401a /Common.mk
parent8d443f62c88e4f211dbfeab33df876887fa0f53b (diff)
parentdaacad1d77306a37d3df5423feca27d3f5d730f7 (diff)
Merge pull request #281 from stepcut/teensy.mk
Add support for Teensyduino 3.x
Diffstat (limited to 'Common.mk')
-rw-r--r--Common.mk23
1 files changed, 23 insertions, 0 deletions
diff --git a/Common.mk b/Common.mk
index 0c1bc0b..65a487a 100644
--- a/Common.mk
+++ b/Common.mk
@@ -61,3 +61,26 @@ ifneq ($(TEST),)
ARDUINO_DIR = $(DEPENDENCIES_ARDUINO_DIR)
endif
endif
+
+########################################################################
+# Arduino Directory
+
+ifndef ARDUINO_DIR
+ AUTO_ARDUINO_DIR := $(firstword \
+ $(call dir_if_exists,/usr/share/arduino) \
+ $(call dir_if_exists,/Applications/Arduino.app/Contents/Resources/Java) )
+ ifdef AUTO_ARDUINO_DIR
+ ARDUINO_DIR = $(AUTO_ARDUINO_DIR)
+ $(call show_config_variable,ARDUINO_DIR,[AUTODETECTED])
+ else
+ echo $(error "ARDUINO_DIR is not defined")
+ endif
+else
+ $(call show_config_variable,ARDUINO_DIR,[USER])
+endif
+
+ifeq ($(CURRENT_OS),WINDOWS)
+ ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),)
+ echo $(error On Windows, ARDUINO_DIR must be a relative path)
+ endif
+endif