aboutsummaryrefslogtreecommitdiff
path: root/Common.mk
diff options
context:
space:
mode:
authorJohn Whittington <git@jbrengineering.co.uk>2020-08-05 18:22:29 +0200
committerJohn Whittington <git@jbrengineering.co.uk>2020-08-05 18:22:29 +0200
commit517fe4a632b57a6c4ee2754bbb06470055427a5e (patch)
tree982ca56447615221c9a66de551cb2f79e4fc973d /Common.mk
parent26e34cd6f2471f04ba097001a215caed12a8574a (diff)
parent88dc641c8d582f28243141052517fe03e92e6687 (diff)
Merge remote-tracking branch 'sej7278/python3'
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