From 6534cf8f15e64df55bb98576e43fb46855bdbd2a Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 22 Oct 2014 15:27:59 -0500 Subject: move ARDUINO_DIR auto-detection into Common.mk. This allows Teensy.mk to use auto-detected location. --- Common.mk | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Common.mk') diff --git a/Common.mk b/Common.mk index 0c1bc0b..b77c644 100644 --- a/Common.mk +++ b/Common.mk @@ -45,6 +45,29 @@ else endif $(call show_config_variable,CURRENT_OS,[AUTODETECTED]) +######################################################################## +# 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 + ######################################################################## # # Travis-CI -- cgit v1.2.3 From f162d8fee325cd4c31f17d8b3bcc8670fd5004a4 Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 22 Oct 2014 15:43:01 -0500 Subject: put ARDUINO_DIR block after Travis-CI block else travis will fail. --- Common.mk | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'Common.mk') diff --git a/Common.mk b/Common.mk index b77c644..65a487a 100644 --- a/Common.mk +++ b/Common.mk @@ -45,6 +45,23 @@ else endif $(call show_config_variable,CURRENT_OS,[AUTODETECTED]) +######################################################################## +# +# Travis-CI +ifneq ($(TEST),) + DEPENDENCIES_DIR = /var/tmp/Arduino-Makefile-testing-dependencies + + DEPENDENCIES_MPIDE_DIR = $(DEPENDENCIES_DIR)/mpide-0023-linux64-20130817-test + ifeq ($(MPIDE_DIR),) + MPIDE_DIR = $(DEPENDENCIES_MPIDE_DIR) + endif + + DEPENDENCIES_ARDUINO_DIR = $(DEPENDENCIES_DIR)/arduino-1.0.6 + ifeq ($(ARDUINO_DIR),) + ARDUINO_DIR = $(DEPENDENCIES_ARDUINO_DIR) + endif +endif + ######################################################################## # Arduino Directory @@ -67,20 +84,3 @@ ifeq ($(CURRENT_OS),WINDOWS) echo $(error On Windows, ARDUINO_DIR must be a relative path) endif endif - -######################################################################## -# -# Travis-CI -ifneq ($(TEST),) - DEPENDENCIES_DIR = /var/tmp/Arduino-Makefile-testing-dependencies - - DEPENDENCIES_MPIDE_DIR = $(DEPENDENCIES_DIR)/mpide-0023-linux64-20130817-test - ifeq ($(MPIDE_DIR),) - MPIDE_DIR = $(DEPENDENCIES_MPIDE_DIR) - endif - - DEPENDENCIES_ARDUINO_DIR = $(DEPENDENCIES_DIR)/arduino-1.0.6 - ifeq ($(ARDUINO_DIR),) - ARDUINO_DIR = $(DEPENDENCIES_ARDUINO_DIR) - endif -endif -- cgit v1.2.3