]> Git Repo - qemu.git/blame - tests/tcg/Makefile.qemu
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20191220-pull-request' into...
[qemu.git] / tests / tcg / Makefile.qemu
CommitLineData
c722a9e4
AB
1# -*- Mode: makefile -*-
2#
3# TCG tests (per-target rules)
4#
fc76c56d
PB
5# This Makefile fragment is included from the build-tcg target, once
6# for each target we build. We have two options for compiling, either
7# using a configured guest compiler or calling one of our docker images
8# to do it for us.
c722a9e4
AB
9#
10
2038f8c8
PB
11include $(SRC_PATH)/rules.mak
12
13# The configure script fills in extra information about
c722a9e4
AB
14# useful docker images or alternative compiler flags.
15
2038f8c8
PB
16CROSS_CC_GUEST:=
17DOCKER_IMAGE:=
18-include $(BUILD_DIR)/tests/tcg/config-$(TARGET).mak
c722a9e4
AB
19
20GUEST_BUILD=
fc76c56d 21TCG_MAKE=../Makefile.target
2038f8c8
PB
22
23# We also need the Docker make rules to depend on
24SKIP_DOCKER_BUILD=1
25include $(SRC_PATH)/tests/docker/Makefile.include
26
c722a9e4
AB
27# Support installed Cross Compilers
28
29ifdef CROSS_CC_GUEST
30
31.PHONY: cross-build-guest-tests
32cross-build-guest-tests:
33 $(call quiet-command, \
2038f8c8
PB
34 (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
35 $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC="$(CROSS_CC_GUEST)" \
fc76c56d 36 SRC_PATH="$(SRC_PATH)" BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \
2038f8c8
PB
37 EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
38 "BUILD","$(TARGET) guest-tests with $(CROSS_CC_GUEST)")
c722a9e4
AB
39
40GUEST_BUILD=cross-build-guest-tests
41
42endif
43
44# Support building with Docker
45
c722a9e4
AB
46ifneq ($(DOCKER_IMAGE),)
47
71ebbe09 48DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
2038f8c8 49 --cc $(DOCKER_CROSS_CC_GUEST) \
c722a9e4
AB
50 -i qemu:$(DOCKER_IMAGE) \
51 -s $(SRC_PATH) -- "
c722a9e4
AB
52
53.PHONY: docker-build-guest-tests
fc76c56d 54docker-build-guest-tests: docker-image-$(DOCKER_IMAGE)
c722a9e4 55 $(call quiet-command, \
2038f8c8
PB
56 (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
57 $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \
fc76c56d 58 SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
2038f8c8
PB
59 EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
60 "BUILD","$(TARGET) guest-tests with docker qemu:$(DOCKER_IMAGE)")
c722a9e4
AB
61
62GUEST_BUILD=docker-build-guest-tests
63
c722a9e4
AB
64endif
65
66# Final targets
fc76c56d
PB
67all:
68 @echo "Do not invoke this Makefile directly"; exit 1
69
c722a9e4
AB
70.PHONY: guest-tests
71
72ifneq ($(GUEST_BUILD),)
73guest-tests: $(GUEST_BUILD)
74
fc76c56d 75run-guest-tests: guest-tests
c722a9e4 76 $(call quiet-command, \
2038f8c8
PB
77 (cd tests/tcg/$(TARGET) && \
78 $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" \
fc76c56d 79 SRC_PATH="$(SRC_PATH)" SPEED=$(SPEED) run), \
c722a9e4
AB
80 "RUN", "tests for $(TARGET_NAME)")
81
82else
83guest-tests:
84 $(call quiet-command, /bin/true, "BUILD", \
2038f8c8 85 "$(TARGET) guest-tests SKIPPED")
c722a9e4
AB
86
87run-guest-tests:
88 $(call quiet-command, /bin/true, "RUN", \
2038f8c8 89 "tests for $(TARGET) SKIPPED")
c722a9e4
AB
90endif
91
92# It doesn't matter if these don't exits
93.PHONY: clean-guest-tests
94clean-guest-tests:
2038f8c8 95 rm -rf tests/tcg/$(TARGET)
This page took 0.140491 seconds and 4 git commands to generate.