Blob Blame History Raw
From 6156198f2378eee7912a5e5395bd799e13f8aae9 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Tue, 24 Sep 2019 04:50:25 -0400
Subject: [PATCH 4/4] Allow overridding Python used for generators.

Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
 Makefile | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 90c9efc..65d407d 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@
 all: tinygo
 tinygo: build/tinygo
 
+PYTHON ?= python
 # Default build and source directories, as created by `make llvm-build`.
 LLVM_BUILDDIR ?= llvm-build
 CLANG_SRC ?= llvm-project/clang
@@ -44,24 +45,24 @@ fmt-check:
 gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-sifive
 
 gen-device-avr:
-	./tools/gen-device-avr.py lib/avr/packs/atmega src/device/avr/
-	./tools/gen-device-avr.py lib/avr/packs/tiny src/device/avr/
+	$(PYTHON) ./tools/gen-device-avr.py lib/avr/packs/atmega src/device/avr/
+	$(PYTHON) ./tools/gen-device-avr.py lib/avr/packs/tiny src/device/avr/
 	go fmt ./src/device/avr
 
 gen-device-nrf:
-	./tools/gen-device-svd.py lib/nrfx/mdk/ src/device/nrf/ --source=https://github.com/NordicSemiconductor/nrfx/tree/master/mdk
+	$(PYTHON) ./tools/gen-device-svd.py lib/nrfx/mdk/ src/device/nrf/ --source=https://github.com/NordicSemiconductor/nrfx/tree/master/mdk
 	go fmt ./src/device/nrf
 
 gen-device-sam:
-	./tools/gen-device-svd.py lib/cmsis-svd/data/Atmel/ src/device/sam/ --source=https://github.com/posborne/cmsis-svd/tree/master/data/Atmel
+	$(PYTHON) ./tools/gen-device-svd.py lib/cmsis-svd/data/Atmel/ src/device/sam/ --source=https://github.com/posborne/cmsis-svd/tree/master/data/Atmel
 	go fmt ./src/device/sam
 
 gen-device-sifive:
-	./tools/gen-device-svd.py lib/cmsis-svd/data/SiFive-Community/ src/device/sifive/ --source=https://github.com/AdaCore/svd2ada/tree/master/CMSIS-SVD/SiFive-Community
+	$(PYTHON) ./tools/gen-device-svd.py lib/cmsis-svd/data/SiFive-Community/ src/device/sifive/ --source=https://github.com/AdaCore/svd2ada/tree/master/CMSIS-SVD/SiFive-Community
 	go fmt ./src/device/sifive
 
 gen-device-stm32:
-	./tools/gen-device-svd.py lib/cmsis-svd/data/STMicro/ src/device/stm32/ --source=https://github.com/posborne/cmsis-svd/tree/master/data/STMicro
+	$(PYTHON) ./tools/gen-device-svd.py lib/cmsis-svd/data/STMicro/ src/device/stm32/ --source=https://github.com/posborne/cmsis-svd/tree/master/data/STMicro
 	go fmt ./src/device/stm32
 
 
-- 
2.21.0