From a02f5e86937820c1ab8f435b9a37ead4afdf6e16 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Feb 2022 10:06:39 +0100 Subject: build: fix make scripts --- make-scripts/Common.mk | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) (limited to 'make-scripts/Common.mk') 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 @@ -67,6 +67,31 @@ else 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 @@ -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 -- cgit v1.2.3-18-g5258