diff mbox series

[RFC,01/13] tests/tcg: add softmmu awareness to Makefile

Message ID 20181210152829.29271-2-alex.bennee@linaro.org
State Superseded
Headers show
Series Enabling tcg/tests for xtensa, mips and cris | expand

Commit Message

Alex Bennée Dec. 10, 2018, 3:28 p.m. UTC
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 tests/tcg/Makefile         | 17 ++++++++++++++++-
 tests/tcg/Makefile.include |  2 +-
 2 files changed, 17 insertions(+), 2 deletions(-)

-- 
2.17.1

Comments

Richard Henderson Dec. 11, 2018, 1:38 p.m. UTC | #1
On 12/10/18 9:28 AM, Alex Bennée wrote:
> +# For softmmu targets we inculde a different Makefile fragement as the


include.

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>



r~
diff mbox series

Patch

diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile
index bf06415390..d6a7fee2e7 100644
--- a/tests/tcg/Makefile
+++ b/tests/tcg/Makefile
@@ -26,7 +26,7 @@ 
 #
 # We also accept SPEED=slow to enable slower running tests
 #
-# We also expect to be in the tests build dir for the FOO-linux-user.
+# We also expect to be in the tests build dir for the FOO-(linux-user|softmmu).
 #
 
 -include ../../config-host.mak
@@ -52,7 +52,11 @@  QEMU_CFLAGS=
 LDFLAGS=
 
 # The QEMU for this TARGET
+ifdef CONFIG_USER_ONLY
 QEMU=../qemu-$(TARGET_NAME)
+else
+QEMU=../qemu-system-$(TARGET_NAME)
+endif
 
 # If TCG debugging is enabled things are a lot slower
 ifeq ($(CONFIG_DEBUG_TCG),y)
@@ -61,6 +65,7 @@  else
 TIMEOUT=15
 endif
 
+ifdef CONFIG_USER_ONLY
 # The order we include is important. We include multiarch, base arch
 # and finally arch if it's not the same as base arch.
 -include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target
@@ -77,6 +82,16 @@  endif
 
 %: %.c
 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+else
+# For softmmu targets we inculde a different Makefile fragement as the
+# build options for bare programs are usually pretty different. They
+# are expected to provide their own build recipes.
+-include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.softmmu-target
+ifneq ($(TARGET_BASE_ARCH),$(TARGET_NAME))
+-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.softmmu-target
+endif
+
+endif
 
 all: $(TESTS)
 
diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include
index c581bd6ffc..73b5626fc5 100644
--- a/tests/tcg/Makefile.include
+++ b/tests/tcg/Makefile.include
@@ -67,7 +67,7 @@  endif
 ifneq ($(GUEST_BUILD),)
 guest-tests: $(GUEST_BUILD)
 
-run-guest-tests: guest-tests qemu-$(TARGET_NAME)
+run-guest-tests: guest-tests qemu-$(subst y,system-,$(CONFIG_SOFTMMU))$(TARGET_NAME)
 	$(call quiet-command, \
 	(cd tests && $(MAKE) -f $(TCG_MAKE) SPEED=$(SPEED) run), \
 	"RUN", "tests for $(TARGET_NAME)")