aboutsummaryrefslogtreecommitdiff
path: root/Common.mk
diff options
context:
space:
mode:
Diffstat (limited to 'Common.mk')
-rw-r--r--Common.mk21
1 files changed, 21 insertions, 0 deletions
diff --git a/Common.mk b/Common.mk
index 27d2135..5421b96 100644
--- a/Common.mk
+++ b/Common.mk
@@ -107,3 +107,24 @@ ifeq ($(CURRENT_OS),WINDOWS)
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
+else
+ $(call show_config_variable,PYTHON_CMD,[USER])
+endif