common.mk: add PYTHON3 variable

Add PYTHON3 variable and replace python calls in common makefiles and in
trusted-services.mk. This way the Python interpreter can be selected
externally.

Signed-off-by: Imre Kis <imre.kis@arm.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
diff --git a/common.mk b/common.mk
index 937e9c9..8fa8cca 100644
--- a/common.mk
+++ b/common.mk
@@ -24,6 +24,7 @@
 
 SHELL := bash
 BASH ?= bash
+PYTHON3 ?= python3
 ROOT ?= $(shell pwd)/..
 
 UNAME_M				:= $(shell uname -m)
@@ -344,7 +345,7 @@
 	@rm -f ../out-br/build/optee_*/.stamp_*
 	@rm -f ../out-br/extra.conf
 	@$(call append-br2-vars,../out-br/extra.conf)
-	@(cd .. && python build/br-ext/scripts/make_def_config.py \
+	@(cd .. && $(PYTHON3) build/br-ext/scripts/make_def_config.py \
 		--br buildroot --out out-br --br-ext build/br-ext \
 		--top-dir "$(ROOT)" \
 		--br-defconfig build/br-ext/configs/optee_$(BUILDROOT_ARCH) \
@@ -373,7 +374,7 @@
 	@rm -f ../out-br-domu/build/optee_*/.stamp_*
 	@rm -f ../out-br-domu/extra.conf
 	@$(call append-br2-vars,../out-br-domu/extra.conf)
-	@(cd .. && python build/br-ext/scripts/make_def_config.py \
+	@(cd .. && $(PYTHON3) build/br-ext/scripts/make_def_config.py \
 		--br buildroot --out out-br-domu --br-ext build/br-ext \
 		--top-dir "$(ROOT)" \
 		--br-defconfig build/br-ext/configs/optee_$(BUILDROOT_ARCH) \