diff options
| author | John Whittington <git@jbrengineering.co.uk> | 2020-08-05 18:22:29 +0200 |
|---|---|---|
| committer | John Whittington <git@jbrengineering.co.uk> | 2020-08-05 18:22:29 +0200 |
| commit | 517fe4a632b57a6c4ee2754bbb06470055427a5e (patch) | |
| tree | 982ca56447615221c9a66de551cb2f79e4fc973d /Common.mk | |
| parent | 26e34cd6f2471f04ba097001a215caed12a8574a (diff) | |
| parent | 88dc641c8d582f28243141052517fe03e92e6687 (diff) | |
Merge remote-tracking branch 'sej7278/python3'
Diffstat (limited to 'Common.mk')
| -rw-r--r-- | Common.mk | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |
