Update Manufacturer Design Guidelines.md
[betaflight.git] / make / macosx.mk
blobd2ccc3fa13f46158dc2cecf99a0579dc253c495b
1 # macosx.mk
3 # Goals:
4 # Configure an environment that will allow Taulabs GCS and firmware to be built
5 # on a Mac OSX system. The environment will support the current version of the
6 # ARM toolchain installed to either their respective default installation
7 # locations, the tools directory or made available on the system path.
9 # First look for `python3`. If `which` doesn't return a null value, then it exists!
10 ifneq ($(shell which python3), "")
11 PYTHON:=python3
12 else
13 # Get Python version, separate major/minor/patch, then put into wordlist
14 PYTHON_VERSION_=$(wordlist 2,4,$(subst ., ,$(shell python -V 2>&1)))
15 # Get major version from aforementioned list
16 PYTHON_MAJOR_VERSION_=$(word 1,$(PYTHON_VERSION_))
17 # Just in case Make has some weird scope stuff
18 PYTHON=0
19 # If the major Python version is the one we want..
20 ifeq ($(PYTHON_MAJOR_VERSION_),3)
21 # Then we can just use the normal Python executable
22 PYTHON:=python
23 else
24 # And if it doesn't exist, let's use the default Python, and warn the user.
25 # PYTHON NOT FOUND.
26 PYTHON:=python
27 echo "Python not found."
28 endif
29 endif
31 export PYTHON