Skip to content

Commit 3fe7bd0

Browse files
committed
Github Actions - Link Artifacts in PR comments
1 parent 0ba84b8 commit 3fe7bd0

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

make/linux.mk

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,26 @@
66
# and the ARM toolchain installed to either the Taulabs/tools directory, their
77
# respective default installation locations, or made available on the system path.
88

9-
# Check for and find Python 2
10-
11-
# Get Python version, separate major/minor/patch, then put into wordlist
12-
PYTHON_VERSION_=$(wordlist 2,4,$(subst ., ,$(shell python -V 2>&1)))
13-
# Get major version from aforementioned list
14-
PYTHON_MAJOR_VERSION_=$(word 1,$(PYTHON_VERSION_))
15-
# Just in case Make has some weird scope stuff
16-
PYTHON=0
17-
# If the major Python version is the one we want..
18-
ifeq ($(PYTHON_MAJOR_VERSION_),2)
19-
# Then we can just use the normal Python executable
20-
PYTHON:=python
9+
# First look for `python3`. If `which` doesn't return a null value, then it exists!
10+
ifneq ($(shell which python3), "")
11+
PYTHON:=python3
2112
else
22-
# However, this isn't always the case..
23-
# Let's look for `python2`. If `which` doesn't return a null value, then
24-
# it exists!
25-
ifneq ($(shell which python2), "")
26-
PYTHON:=python2
27-
else
28-
# And if it doesn't exist, let's use the default Python, and warn the user.
29-
# PYTHON NOT FOUND.
30-
PYTHON:=python
31-
echo "Python not found."
32-
endif
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
3329
endif
3430

3531
export PYTHON

0 commit comments

Comments
 (0)