]> Git Repo - qemu.git/blame - tests/tcg/Makefile.qemu
tests/tcg: cleanup Makefile inclusions
[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
11# The per ARCH makefile, if it exists, holds extra information about
12# useful docker images or alternative compiler flags.
13
fc76c56d
PB
14include $(TARGET_DIR)config-target.mak
15include $(SRC_PATH)/rules.mak
16include $(wildcard \
17 $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.include \
18 $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include)
c722a9e4
AB
19
20GUEST_BUILD=
fc76c56d 21TCG_MAKE=../Makefile.target
c722a9e4
AB
22# Support installed Cross Compilers
23
24ifdef CROSS_CC_GUEST
25
26.PHONY: cross-build-guest-tests
27cross-build-guest-tests:
28 $(call quiet-command, \
fc76c56d
PB
29 (mkdir -p tests/tcg/$(TARGET_DIR) && cd tests/tcg/$(TARGET_DIR) && \
30 $(MAKE) -f $(TCG_MAKE) TARGET_DIR="$(TARGET_DIR)" CC="$(CROSS_CC_GUEST)" \
31 SRC_PATH="$(SRC_PATH)" BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \
c722a9e4
AB
32 EXTRA_CFLAGS=$(CROSS_CC_GUEST_CFLAGS)), \
33 "BUILD","$(TARGET_NAME) guest-tests with $(CROSS_CC_GUEST)")
34
35GUEST_BUILD=cross-build-guest-tests
36
37endif
38
39# Support building with Docker
40
41ifeq ($(HAVE_USER_DOCKER)$(GUEST_BUILD),y)
42ifneq ($(DOCKER_IMAGE),)
43
44# We also need the Docker make rules to depend on
fc76c56d 45SKIP_DOCKER_BUILD=1
c722a9e4
AB
46include $(SRC_PATH)/tests/docker/Makefile.include
47
71ebbe09 48DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
c722a9e4
AB
49 --cc $(DOCKER_CROSS_COMPILER) \
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, \
fc76c56d
PB
56 (mkdir -p tests/tcg/$(TARGET_DIR) && cd tests/tcg/$(TARGET_DIR) && \
57 $(MAKE) -f $(TCG_MAKE) TARGET_DIR="$(TARGET_DIR)" CC=$(DOCKER_COMPILE_CMD) \
58 SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
c722a9e4
AB
59 EXTRA_CFLAGS=$(DOCKER_CROSS_COMPILER_CFLAGS)), \
60 "BUILD","$(TARGET_NAME) guest-tests with docker qemu:$(DOCKER_IMAGE)")
61
62GUEST_BUILD=docker-build-guest-tests
63
64endif
65endif
66
67# Final targets
fc76c56d
PB
68all:
69 @echo "Do not invoke this Makefile directly"; exit 1
70
c722a9e4
AB
71.PHONY: guest-tests
72
73ifneq ($(GUEST_BUILD),)
74guest-tests: $(GUEST_BUILD)
75
fc76c56d 76run-guest-tests: guest-tests
c722a9e4 77 $(call quiet-command, \
fc76c56d
PB
78 (cd tests/tcg/$(TARGET_DIR) && \
79 $(MAKE) -f $(TCG_MAKE) TARGET_DIR="$(TARGET_DIR)" \
80 SRC_PATH="$(SRC_PATH)" SPEED=$(SPEED) run), \
c722a9e4
AB
81 "RUN", "tests for $(TARGET_NAME)")
82
83else
84guest-tests:
85 $(call quiet-command, /bin/true, "BUILD", \
fc76c56d 86 "$(TARGET_DIR) guest-tests SKIPPED")
c722a9e4
AB
87
88run-guest-tests:
89 $(call quiet-command, /bin/true, "RUN", \
fc76c56d 90 "tests for $(TARGET_DIR) SKIPPED")
c722a9e4
AB
91endif
92
93# It doesn't matter if these don't exits
94.PHONY: clean-guest-tests
95clean-guest-tests:
fc76c56d 96 rm -rf tests/tcg/$(TARGET_DIR)
This page took 0.133858 seconds and 4 git commands to generate.