diff mbox

[RFC/POC,4/4] tests/tcg/Makefile: use docker target for arm-tcg-tests

Message ID 20161214171244.26813-5-alex.bennee@linaro.org
State New
Headers show

Commit Message

Alex Bennée Dec. 14, 2016, 5:12 p.m. UTC
This means we can type:

  make arm-tcg-tests

And through the power of docker and Debian's emdebian cross tools we
build the misc and arm TCG targets.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 tests/tcg/Makefile.include | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

-- 
2.11.0
diff mbox

Patch

diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include
index 3eff12527c..6d8d666203 100644
--- a/tests/tcg/Makefile.include
+++ b/tests/tcg/Makefile.include
@@ -8,6 +8,7 @@  BUILD_DIR?=$(CURDIR)
 include $(BUILD_DIR)/config-host.mak	# brings in SRC_PATH
 
 UNAME_M := $(shell uname -m)
+BUILD_UID = $(shell id -u)
 
 tests-tcg: prepare $(UNAME_M)
 
@@ -22,9 +23,22 @@  i386:
 	cd $(BUILD_DIR)/i386-linux-user/tests/ && \
 	make -f $(SRC_PATH)/tests/tcg/i386/Makefile
 
-arm:
-	cd $(BUILD_DIR)/arm-linux-user/tests/ && \
-	make -f $(SRC_PATH)/tests/tcg/arm/Makefile
+arm-tcg-tests: docker-image-debian-multiarch-cross
+	mkdir -p $(BUILD_DIR)/arm-linux-user/tests
+	docker run --rm -it -v $(SRC_PATH):$(SRC_PATH) \
+		-v $(BUILD_DIR):$(BUILD_DIR) \
+		--user $(BUILD_ID):$(BUILD_ID) \
+		-w $(BUILD_DIR)/arm-linux-user/tests \
+		-e CROSS_CC="arm-linux-gnueabihf-gcc" \
+		qemu:debian-multiarch-cross \
+		make -f ../../tests/tcg/misc/Makefile
+	docker run --rm -it -v $(SRC_PATH):$(SRC_PATH) \
+		-v $(BUILD_DIR):$(BUILD_DIR) \
+		--user $(BUILD_ID):$(BUILD_ID) \
+		-w $(BUILD_DIR)/arm-linux-user/tests \
+		-e CROSS_CC="arm-linux-gnueabihf-gcc" \
+		qemu:debian-multiarch-cross \
+		make -f ../../tests/tcg/arm/Makefile
 
 aarch64:
 	cd $(BUILD_DIR)/aarch64-linux-user/tests/ && \