* [PATCH 0/7] More tests/tcg cleanups
@ 2022-06-07 9:40 Paolo Bonzini
2022-06-07 9:40 ` [PATCH 1/7] meson: put cross compiler info in a separate section Paolo Bonzini
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Paolo Bonzini @ 2022-06-07 9:40 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, richard.henderson
Building on the introduction of config-$target.mak, make tests/tcg a
"regular" subdirectory that is entered simply with "make -C", like the
ROMs or the plugins.
The next step could be to unify all the sub-make rules; this series
stops short of that.
Paolo
Paolo Bonzini (7):
meson: put cross compiler info in a separate section
build: include pc-bios/ part in the ROMS variable
configure: allow more host/target combos to use the host compiler
configure: move tests/tcg/Makefile.prereqs to root build directory
configure: store container engine in config-host.mak
tests: simplify Makefile invocation for tests/tcg
tests/tcg: remove -f from Makefile invocation
Makefile | 17 +++----
configure | 90 +++++++++++++++++++++--------------
meson.build | 15 +++---
tests/Makefile.include | 13 ++---
tests/docker/Makefile.include | 2 +-
tests/tcg/Makefile.target | 2 +-
6 files changed, 77 insertions(+), 62 deletions(-)
--
2.36.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/7] meson: put cross compiler info in a separate section
2022-06-07 9:40 [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
@ 2022-06-07 9:40 ` Paolo Bonzini
2022-06-07 9:40 ` [PATCH 2/7] build: include pc-bios/ part in the ROMS variable Paolo Bonzini
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2022-06-07 9:40 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, richard.henderson
While at it, remove a dead assignment and simply inline the value of the
"target" variable, which is used just once.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 21cd949082..3f38b3ee4f 100644
--- a/meson.build
+++ b/meson.build
@@ -3740,21 +3740,24 @@ endif
summary_info += {'strip binaries': get_option('strip')}
summary_info += {'sparse': sparse}
summary_info += {'mingw32 support': targetos == 'windows'}
+summary(summary_info, bool_yn: true, section: 'Compilation')
# snarf the cross-compilation information for tests
+summary_info = {}
+have_cross = false
foreach target: target_dirs
tcg_mak = meson.current_build_dir() / 'tests/tcg' / 'config-' + target + '.mak'
if fs.exists(tcg_mak)
config_cross_tcg = keyval.load(tcg_mak)
- target = config_cross_tcg['TARGET_NAME']
- compiler = ''
if 'CC' in config_cross_tcg
- summary_info += {target + ' tests': config_cross_tcg['CC']}
+ summary_info += {config_cross_tcg['TARGET_NAME']: config_cross_tcg['CC']}
+ have_cross = true
endif
- endif
+ endif
endforeach
-
-summary(summary_info, bool_yn: true, section: 'Compilation')
+if have_cross
+ summary(summary_info, bool_yn: true, section: 'Cross compilers')
+endif
# Targets and accelerators
summary_info = {}
--
2.36.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/7] build: include pc-bios/ part in the ROMS variable
2022-06-07 9:40 [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
2022-06-07 9:40 ` [PATCH 1/7] meson: put cross compiler info in a separate section Paolo Bonzini
@ 2022-06-07 9:40 ` Paolo Bonzini
2022-06-07 9:40 ` [PATCH 3/7] configure: allow more host/target combos to use the host compiler Paolo Bonzini
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2022-06-07 9:40 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, richard.henderson
Include the full path in TARGET_DIR, so that messages from sub-Makefiles
are clearer. Also, prepare for possibly building firmware outside
pc-bios/ from the Makefile,
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 12 +++++-------
configure | 6 +++---
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 3c0d89057e..ec4445db9a 100644
--- a/Makefile
+++ b/Makefile
@@ -186,16 +186,14 @@ include $(SRC_PATH)/tests/Makefile.include
all: recurse-all
-ROM_DIRS = $(addprefix pc-bios/, $(ROMS))
-ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
-# Only keep -O and -g cflags
-.PHONY: $(ROM_DIRS_RULES)
-$(ROM_DIRS_RULES):
+ROMS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROMS)))
+.PHONY: $(ROMS_RULES)
+$(ROMS_RULES):
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
.PHONY: recurse-all recurse-clean
-recurse-all: $(addsuffix /all, $(ROM_DIRS))
-recurse-clean: $(addsuffix /clean, $(ROM_DIRS))
+recurse-all: $(addsuffix /all, $(ROMS))
+recurse-clean: $(addsuffix /clean, $(ROMS))
######################################################################
diff --git a/configure b/configure
index e69537c756..b1aa97e470 100755
--- a/configure
+++ b/configure
@@ -2242,7 +2242,7 @@ if test -n "$target_cc" &&
fi
done
if test -n "$ld_i386_emulation"; then
- roms="optionrom"
+ roms="pc-bios/optionrom"
config_mak=pc-bios/optionrom/config.mak
echo "# Automatically generated by configure - do not modify" > $config_mak
echo "TOPSRC_DIR=$source_path" >> $config_mak
@@ -2253,7 +2253,7 @@ fi
probe_target_compilers ppc ppc64
if test -n "$target_cc" && test "$softmmu" = yes; then
- roms="$roms vof"
+ roms="$roms pc-bios/vof"
config_mak=pc-bios/vof/config.mak
echo "# Automatically generated by configure - do not modify" > $config_mak
echo "SRC_DIR=$source_path/pc-bios/vof" >> $config_mak
@@ -2272,7 +2272,7 @@ if test -n "$target_cc" && test "$softmmu" = yes; then
echo "WARNING: Your compiler does not support the z900!"
echo " The s390-ccw bios will only work with guest CPUs >= z10."
fi
- roms="$roms s390-ccw"
+ roms="$roms pc-bios/s390-ccw"
config_mak=pc-bios/s390-ccw/config-host.mak
echo "# Automatically generated by configure - do not modify" > $config_mak
echo "SRC_PATH=$source_path/pc-bios/s390-ccw" >> $config_mak
--
2.36.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/7] configure: allow more host/target combos to use the host compiler
2022-06-07 9:40 [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
2022-06-07 9:40 ` [PATCH 1/7] meson: put cross compiler info in a separate section Paolo Bonzini
2022-06-07 9:40 ` [PATCH 2/7] build: include pc-bios/ part in the ROMS variable Paolo Bonzini
@ 2022-06-07 9:40 ` Paolo Bonzini
2022-06-07 9:40 ` [PATCH 4/7] configure: move tests/tcg/Makefile.prereqs to root build directory Paolo Bonzini
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2022-06-07 9:40 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, richard.henderson
Do not require a cross-compiler prefix for e.g. i386 on x86_64, or
big endian on little endian.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/configure b/configure
index b1aa97e470..28f8c6188b 100755
--- a/configure
+++ b/configure
@@ -2058,19 +2058,27 @@ probe_target_compiler() {
compute_target_variable $1 target_objcopy objcopy
compute_target_variable $1 target_ranlib ranlib
compute_target_variable $1 target_strip strip
- if test "$1" = $cpu; then
- : ${target_cc:=$cc}
- : ${target_ccas:=$ccas}
- : ${target_as:=$as}
- : ${target_ld:=$ld}
- : ${target_ar:=$ar}
- : ${target_as:=$as}
- : ${target_ld:=$ld}
- : ${target_nm:=$nm}
- : ${target_objcopy:=$objcopy}
- : ${target_ranlib:=$ranlib}
- : ${target_strip:=$strip}
- fi
+ case "$1:$cpu" in
+ aarch64:aarch64_be | aarch64_be:aarch64 | \
+ arm:armeb | armeb:arm | \
+ i386:x86_64 | \
+ ppc:ppc64* | \
+ ppc64*:ppc64* | \
+ sparc:sparc64 | \
+ "$cpu:$cpu")
+ : ${target_cc:=$cc}
+ : ${target_ccas:=$ccas}
+ : ${target_as:=$as}
+ : ${target_ld:=$ld}
+ : ${target_ar:=$ar}
+ : ${target_as:=$as}
+ : ${target_ld:=$ld}
+ : ${target_nm:=$nm}
+ : ${target_objcopy:=$objcopy}
+ : ${target_ranlib:=$ranlib}
+ : ${target_strip:=$strip}
+ ;;
+ esac
if test -n "$target_cc"; then
case $1 in
i386|x86_64)
--
2.36.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/7] configure: move tests/tcg/Makefile.prereqs to root build directory
2022-06-07 9:40 [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
` (2 preceding siblings ...)
2022-06-07 9:40 ` [PATCH 3/7] configure: allow more host/target combos to use the host compiler Paolo Bonzini
@ 2022-06-07 9:40 ` Paolo Bonzini
2022-06-07 9:40 ` [PATCH 5/7] configure: store container engine in config-host.mak Paolo Bonzini
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2022-06-07 9:40 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, richard.henderson
It will not be specific to tests/tcg anymore once it will be possible to
build firmware using container-based cross compilers too. Prepare for that
already, after all Makefile.prereqs is not _used_ by tests/tcg.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 5 ++++-
configure | 15 +++++++--------
tests/Makefile.include | 3 ---
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/Makefile b/Makefile
index ec4445db9a..9fc750ee70 100644
--- a/Makefile
+++ b/Makefile
@@ -42,6 +42,9 @@ configure: ;
ifneq ($(wildcard config-host.mak),)
include config-host.mak
+include Makefile.prereqs
+Makefile.prereqs: config-host.mak
+
git-submodule-update:
.git-submodule-status: git-submodule-update config-host.mak
Makefile: .git-submodule-status
@@ -216,7 +219,7 @@ qemu-%.tar.bz2:
distclean: clean
-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean -g || :
- rm -f config-host.mak
+ rm -f config-host.mak Makefile.prereqs
rm -f tests/tcg/config-*.mak
rm -f config.status
rm -f roms/seabios/config.mak
diff --git a/configure b/configure
index 28f8c6188b..6b38b0815c 100755
--- a/configure
+++ b/configure
@@ -2126,6 +2126,7 @@ write_target_makefile() {
}
write_container_target_makefile() {
+ echo "$1: docker-image-$container_image" >> Makefile.prereqs
if test -n "$container_cross_cc"; then
echo "CC=\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
echo "CCAS=\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
@@ -2234,6 +2235,8 @@ for f in $LINKS ; do
fi
done
+echo "# Automatically generated by configure - do not modify" > Makefile.prereqs
+
# Mac OS X ships with a broken assembler
roms=
probe_target_compilers i386 x86_64
@@ -2471,10 +2474,7 @@ if test "$safe_stack" = "yes"; then
fi
# tests/tcg configuration
-(makefile=tests/tcg/Makefile.prereqs
-echo "# Automatically generated by configure - do not modify" > $makefile
-
-config_host_mak=tests/tcg/config-host.mak
+(config_host_mak=tests/tcg/config-host.mak
echo "# Automatically generated by configure - do not modify" > $config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
echo "HOST_CC=$host_cc" >> $config_host_mak
@@ -2570,9 +2570,8 @@ for target in $target_list; do
;;
esac
elif test -n "$container_image"; then
- echo "build-tcg-tests-$target: docker-image-$container_image" >> $makefile
echo "BUILD_STATIC=y" >> $config_target_mak
- write_container_target_makefile >> $config_target_mak
+ write_container_target_makefile build-tcg-tests-$target >> $config_target_mak
case $target in
aarch64-*)
echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak
@@ -2595,11 +2594,11 @@ for target in $target_list; do
mkdir -p tests/tcg/$target
echo "QEMU=$PWD/$qemu" >> $config_target_mak
echo "EXTRA_CFLAGS=$target_cflags" >> $config_target_mak
- echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> $makefile
+ echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> Makefile.prereqs
tcg_tests_targets="$tcg_tests_targets $target"
fi
done
-echo "TCG_TESTS_TARGETS=$tcg_tests_targets" >> $makefile)
+echo "TCG_TESTS_TARGETS=$tcg_tests_targets" >> config-host.mak)
if test "$skip_meson" = no; then
cross="config-meson.cross.new"
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 3accb83b13..f4ba4027ea 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -36,9 +36,6 @@ export SRC_PATH
SPEED = quick
--include tests/tcg/Makefile.prereqs
-tests/tcg/Makefile.prereqs: config-host.mak
-
# Per guest TCG tests
BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TCG_TESTS_TARGETS))
CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TCG_TESTS_TARGETS))
--
2.36.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/7] configure: store container engine in config-host.mak
2022-06-07 9:40 [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
` (3 preceding siblings ...)
2022-06-07 9:40 ` [PATCH 4/7] configure: move tests/tcg/Makefile.prereqs to root build directory Paolo Bonzini
@ 2022-06-07 9:40 ` Paolo Bonzini
2022-06-07 9:40 ` [PATCH 6/7] tests: simplify Makefile invocation for tests/tcg Paolo Bonzini
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2022-06-07 9:40 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, richard.henderson
In preparation for removing $(DOCKER_SCRIPT) from the tests/tcg configuration
files, have Make use the same container engine that had been probed at
configure time.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 11 ++++++++---
tests/docker/Makefile.include | 2 +-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 6b38b0815c..0fd5a3cfad 100755
--- a/configure
+++ b/configure
@@ -1819,9 +1819,11 @@ esac
container="no"
if test $use_containers = "yes"; then
- if has "docker" || has "podman"; then
- container=$($python $source_path/tests/docker/docker.py probe)
- fi
+ case $($python $source_path/tests/docker/docker.py probe) in
+ *docker) container=docker ;;
+ podman) container=podman ;;
+ no) container=no ;;
+ esac
fi
# cross compilers defaults, can be overridden with --cross-cc-ARCH
@@ -2401,6 +2403,9 @@ if test -n "$gdb_bin"; then
fi
fi
+if test "$container" != no; then
+ echo "ENGINE=$container" >> $config_host_mak
+fi
echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
echo "PYTHON=$python" >> $config_host_mak
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index e68f91b853..d9b6ab7b41 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -14,7 +14,7 @@ DOCKER_DEFAULT_REGISTRY := registry.gitlab.com/qemu-project/qemu
endif
DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTRY))
-ENGINE := auto
+ENGINE ?= auto
DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE)
CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
--
2.36.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 6/7] tests: simplify Makefile invocation for tests/tcg
2022-06-07 9:40 [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
` (4 preceding siblings ...)
2022-06-07 9:40 ` [PATCH 5/7] configure: store container engine in config-host.mak Paolo Bonzini
@ 2022-06-07 9:40 ` Paolo Bonzini
2022-06-07 9:40 ` [PATCH 7/7] tests/tcg: remove -f from Makefile invocation Paolo Bonzini
2022-06-07 10:00 ` [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
7 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2022-06-07 9:40 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, richard.henderson
The tests/tcg Makefile invocation contains the paths to DOCKER_SCRIPT
and TARGET.
One can just resolve the path to docker.py in configure so that submakes
do not need the DOCKER_SCRIPT variable. In order to remove the TARGET
variable, create a config-target.mak file in tests/tcg/$TARGET. For now
config-$target.mak is created before the check for compiler presence,
while tests/tcg/$TARGET is created afterwards. This is temporary.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 23 ++++++++++++++---------
tests/Makefile.include | 9 +++------
tests/tcg/Makefile.target | 2 +-
3 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/configure b/configure
index 0fd5a3cfad..9d49ea4c5b 100755
--- a/configure
+++ b/configure
@@ -1824,6 +1824,9 @@ if test $use_containers = "yes"; then
podman) container=podman ;;
no) container=no ;;
esac
+ if test "$container" != "no"; then
+ docker_py="$python $source_path/tests/docker/docker.py --engine $container"
+ fi
fi
# cross compilers defaults, can be overridden with --cross-cc-ARCH
@@ -2130,16 +2133,16 @@ write_target_makefile() {
write_container_target_makefile() {
echo "$1: docker-image-$container_image" >> Makefile.prereqs
if test -n "$container_cross_cc"; then
- echo "CC=\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
- echo "CCAS=\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
+ echo "CC=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
+ echo "CCAS=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
fi
- echo "AR=\$(DOCKER_SCRIPT) cc --cc $container_cross_ar -i qemu/$container_image -s $source_path --"
- echo "AS=\$(DOCKER_SCRIPT) cc --cc $container_cross_as -i qemu/$container_image -s $source_path --"
- echo "LD=\$(DOCKER_SCRIPT) cc --cc $container_cross_ld -i qemu/$container_image -s $source_path --"
- echo "NM=\$(DOCKER_SCRIPT) cc --cc $container_cross_nm -i qemu/$container_image -s $source_path --"
- echo "OBJCOPY=\$(DOCKER_SCRIPT) cc --cc $container_cross_objcopy -i qemu/$container_image -s $source_path --"
- echo "RANLIB=\$(DOCKER_SCRIPT) cc --cc $container_cross_ranlib -i qemu/$container_image -s $source_path --"
- echo "STRIP=\$(DOCKER_SCRIPT) cc --cc $container_cross_strip -i qemu/$container_image -s $source_path --"
+ echo "AR=$docker_py cc --cc $container_cross_ar -i qemu/$container_image -s $source_path --"
+ echo "AS=$docker_py cc --cc $container_cross_as -i qemu/$container_image -s $source_path --"
+ echo "LD=$docker_py cc --cc $container_cross_ld -i qemu/$container_image -s $source_path --"
+ echo "NM=$docker_py cc --cc $container_cross_nm -i qemu/$container_image -s $source_path --"
+ echo "OBJCOPY=$docker_py cc --cc $container_cross_objcopy -i qemu/$container_image -s $source_path --"
+ echo "RANLIB=$docker_py cc --cc $container_cross_ranlib -i qemu/$container_image -s $source_path --"
+ echo "STRIP=$docker_py cc --cc $container_cross_strip -i qemu/$container_image -s $source_path --"
}
@@ -2597,6 +2600,8 @@ for target in $target_list; do
fi
if test $got_cross_cc = yes; then
mkdir -p tests/tcg/$target
+ ln -sf ../config-$target.mak tests/tcg/$target/config-target.mak
+ echo "TARGET=$target" >> $config_target_mak
echo "QEMU=$PWD/$qemu" >> $config_target_mak
echo "EXTRA_CFLAGS=$target_cflags" >> $config_target_mak
echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> Makefile.prereqs
diff --git a/tests/Makefile.include b/tests/Makefile.include
index f4ba4027ea..f2182ead1e 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -47,23 +47,20 @@ $(foreach TARGET,$(TCG_TESTS_TARGETS), \
.PHONY: $(TCG_TESTS_TARGETS:%=build-tcg-tests-%)
$(TCG_TESTS_TARGETS:%=build-tcg-tests-%): build-tcg-tests-%: $(BUILD_DIR)/tests/tcg/config-%.mak
$(call quiet-command, \
- $(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS) \
- DOCKER_SCRIPT="$(DOCKER_SCRIPT)" \
- TARGET="$*" SRC_PATH="$(SRC_PATH)", \
+ $(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS), \
"BUILD","$* guest-tests")
.PHONY: $(TCG_TESTS_TARGETS:%=run-tcg-tests-%)
$(TCG_TESTS_TARGETS:%=run-tcg-tests-%): run-tcg-tests-%: build-tcg-tests-%
$(call quiet-command, \
$(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS) \
- TARGET="$*" SRC_PATH="$(SRC_PATH)" SPEED=$(SPEED) run, \
+ SPEED=$(SPEED) run, \
"RUN", "$* guest-tests")
.PHONY: $(TCG_TESTS_TARGETS:%=clean-tcg-tests-%)
$(TCG_TESTS_TARGETS:%=clean-tcg-tests-%): clean-tcg-tests-%:
$(call quiet-command, \
- $(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS) \
- TARGET="$*" SRC_PATH="$(SRC_PATH)" clean, \
+ $(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS) clean, \
"CLEAN", "$* guest-tests")
.PHONY: build-tcg
diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index f427a0304e..1e1c7097c6 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -31,7 +31,7 @@
all:
-include ../config-host.mak
--include ../config-$(TARGET).mak
+-include config-target.mak
# Get semihosting definitions for user-mode emulation
ifeq ($(filter %-softmmu, $(TARGET)),)
--
2.36.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 7/7] tests/tcg: remove -f from Makefile invocation
2022-06-07 9:40 [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
` (5 preceding siblings ...)
2022-06-07 9:40 ` [PATCH 6/7] tests: simplify Makefile invocation for tests/tcg Paolo Bonzini
@ 2022-06-07 9:40 ` Paolo Bonzini
2022-06-07 10:00 ` [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
7 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2022-06-07 9:40 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, richard.henderson
Name the symbolic link "Makefile" and place it in the target subdirectory.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 3 ++-
tests/Makefile.include | 7 +++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/configure b/configure
index 9d49ea4c5b..f35847c3cd 100755
--- a/configure
+++ b/configure
@@ -2224,7 +2224,6 @@ fi
# tests might fail. Prefer to keep the relevant files in their own
# directory and symlink the directory instead.
LINKS="Makefile"
-LINKS="$LINKS tests/tcg/Makefile.target"
LINKS="$LINKS pc-bios/optionrom/Makefile"
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
LINKS="$LINKS pc-bios/vof/Makefile"
@@ -2483,6 +2482,7 @@ fi
# tests/tcg configuration
(config_host_mak=tests/tcg/config-host.mak
+mkdir -p tests/tcg
echo "# Automatically generated by configure - do not modify" > $config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
echo "HOST_CC=$host_cc" >> $config_host_mak
@@ -2600,6 +2600,7 @@ for target in $target_list; do
fi
if test $got_cross_cc = yes; then
mkdir -p tests/tcg/$target
+ ln -sf $source_path/tests/tcg/Makefile.target tests/tcg/$target/Makefile
ln -sf ../config-$target.mak tests/tcg/$target/config-target.mak
echo "TARGET=$target" >> $config_target_mak
echo "QEMU=$PWD/$qemu" >> $config_target_mak
diff --git a/tests/Makefile.include b/tests/Makefile.include
index f2182ead1e..8f44a20da3 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -47,20 +47,19 @@ $(foreach TARGET,$(TCG_TESTS_TARGETS), \
.PHONY: $(TCG_TESTS_TARGETS:%=build-tcg-tests-%)
$(TCG_TESTS_TARGETS:%=build-tcg-tests-%): build-tcg-tests-%: $(BUILD_DIR)/tests/tcg/config-%.mak
$(call quiet-command, \
- $(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS), \
+ $(MAKE) -C tests/tcg/$* $(SUBDIR_MAKEFLAGS), \
"BUILD","$* guest-tests")
.PHONY: $(TCG_TESTS_TARGETS:%=run-tcg-tests-%)
$(TCG_TESTS_TARGETS:%=run-tcg-tests-%): run-tcg-tests-%: build-tcg-tests-%
$(call quiet-command, \
- $(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS) \
- SPEED=$(SPEED) run, \
+ $(MAKE) -C tests/tcg/$* $(SUBDIR_MAKEFLAGS) SPEED=$(SPEED) run, \
"RUN", "$* guest-tests")
.PHONY: $(TCG_TESTS_TARGETS:%=clean-tcg-tests-%)
$(TCG_TESTS_TARGETS:%=clean-tcg-tests-%): clean-tcg-tests-%:
$(call quiet-command, \
- $(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS) clean, \
+ $(MAKE) -C tests/tcg/$* $(SUBDIR_MAKEFLAGS) clean, \
"CLEAN", "$* guest-tests")
.PHONY: build-tcg
--
2.36.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 0/7] More tests/tcg cleanups
2022-06-07 9:40 [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
` (6 preceding siblings ...)
2022-06-07 9:40 ` [PATCH 7/7] tests/tcg: remove -f from Makefile invocation Paolo Bonzini
@ 2022-06-07 10:00 ` Paolo Bonzini
7 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2022-06-07 10:00 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, richard.henderson
On 6/7/22 11:40, Paolo Bonzini wrote:
> Building on the introduction of config-$target.mak
Brain fart, or perhaps selective amnesia: building on the removal of
Makefile.qemu.
Paolo
> , make tests/tcg a
> "regular" subdirectory that is entered simply with "make -C", like the
> ROMs or the plugins.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-06-07 10:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-07 9:40 [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
2022-06-07 9:40 ` [PATCH 1/7] meson: put cross compiler info in a separate section Paolo Bonzini
2022-06-07 9:40 ` [PATCH 2/7] build: include pc-bios/ part in the ROMS variable Paolo Bonzini
2022-06-07 9:40 ` [PATCH 3/7] configure: allow more host/target combos to use the host compiler Paolo Bonzini
2022-06-07 9:40 ` [PATCH 4/7] configure: move tests/tcg/Makefile.prereqs to root build directory Paolo Bonzini
2022-06-07 9:40 ` [PATCH 5/7] configure: store container engine in config-host.mak Paolo Bonzini
2022-06-07 9:40 ` [PATCH 6/7] tests: simplify Makefile invocation for tests/tcg Paolo Bonzini
2022-06-07 9:40 ` [PATCH 7/7] tests/tcg: remove -f from Makefile invocation Paolo Bonzini
2022-06-07 10:00 ` [PATCH 0/7] More tests/tcg cleanups Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).