diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-14 10:06:39 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-14 10:06:39 +0100 |
commit | a02f5e86937820c1ab8f435b9a37ead4afdf6e16 (patch) | |
tree | 72bce667d0e903e187f2d8d31d582cac2a22043f /make-scripts/Common.mk | |
parent | a8049bb66f7bc62c9a33488615d0990e0a920520 (diff) |
build: fix make scripts
Diffstat (limited to 'make-scripts/Common.mk')
-rw-r--r-- | make-scripts/Common.mk | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/make-scripts/Common.mk b/make-scripts/Common.mk index fa3f9f0..decb19d 100644 --- a/make-scripts/Common.mk +++ b/make-scripts/Common.mk @@ -68,6 +68,31 @@ endif $(call show_config_variable,CURRENT_OS,[AUTODETECTED]) ######################################################################## +# +# Travis-CI +ifneq ($(TEST),) + DEPENDENCIES_DIR = /var/tmp/Arduino-Makefile-testing-dependencies + + DEPENDENCIES_MPIDE_DIR := $(shell find $(DEPENDENCIES_DIR) -name 'mpide-0023-*' -type d -exec ls -dt {} + | head -n 1) + + ifeq ($(MPIDE_DIR),) + MPIDE_DIR = $(DEPENDENCIES_MPIDE_DIR) + endif + + ifndef ARDUINO_IDE_DIR + ifeq ($(CURRENT_OS),MAC) + ARDUINO_IDE_DIR = Arduino.app/Contents/Resources/Java + else + ARDUINO_IDE_DIR := $(shell basename $(basename $(basename $(lastword $(wildcard $(DEPENDENCIES_DIR)/arduino*))))) + endif + endif + DEPENDENCIES_ARDUINO_DIR = $(DEPENDENCIES_DIR)/$(ARDUINO_IDE_DIR) + ifeq ($(ARDUINO_DIR),) + ARDUINO_DIR = $(DEPENDENCIES_ARDUINO_DIR) + endif +endif + +######################################################################## # Arduino Directory ifndef ARDUINO_DIR @@ -85,23 +110,19 @@ else $(call show_config_variable,ARDUINO_DIR,[USER]) endif +ifeq ($(CURRENT_OS),WINDOWS) + ifneq ($(shell echo $(ARDUINO_DIR) | egrep '\\|[[:space:]]|cygdrive'),) + echo $(error On Windows, ARDUINO_DIR and other defines must use forward slash and not contain spaces, special characters or be cygdrive relative) + endif +endif + ######################################################################## # System Python ifndef PYTHON_CMD # try for Python 3 first - PYTHON_CMD := $(shell which python3 2> /dev/null) - ifdef PYTHON_CMD - $(call show_config_variable,PYTHON_CMD,[AUTODETECTED]) - else - # fall-back to any Python - PYTHON_CMD := $(shell which python 2> /dev/null) - ifdef PYTHON_CMD - $(call show_config_variable,PYTHON_CMD,[AUTODETECTED]) - else - echo $(error "Unable to find system Python! Utility scipts won't work. Override this error by defining PYTHON_CMD") - endif - endif + PYTHON_CMD := python3.9 #.exe + $(call show_config_variable,PYTHON_CMD,[AUTODETECTED]) else $(call show_config_variable,PYTHON_CMD,[USER]) endif |