[Qemu-devel] [PATCH v2] tests/docker/Makefile.include: handle empty TARGET_LIST

Alex Bennée posted 1 patch 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180521103504.26432-1-alex.bennee@linaro.org
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
rules.mak                     | 3 +++
tests/docker/Makefile.include | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
[Qemu-devel] [PATCH v2] tests/docker/Makefile.include: handle empty TARGET_LIST
Posted by Alex Bennée 5 years, 10 months ago
If the user doesn't specify a TARGET_LIST they get the current
configuration but with spaces and hilarity ensues. This adds some make
magic to turn the TARGET_LIST back into a comma separated list.

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

---
v2
  - use common $(SPACE) and $(COMMA) in rules.mak
---
 rules.mak                     | 3 +++
 tests/docker/Makefile.include | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/rules.mak b/rules.mak
index 04c7f74d07..bbb2667928 100644
--- a/rules.mak
+++ b/rules.mak
@@ -1,4 +1,7 @@
 
+# These are used when we want to do substitutions without confusing Make
+NULL  :=
+SPACE := $(NULL) #
 COMMA := ,
 
 # Don't use implicit rules or variables
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index d00887bdf1..e911d44d9f 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -148,7 +148,7 @@ docker-run: docker-qemu-src
 			$(if $V,,--rm) 					\
 			$(if $(DEBUG),-ti,)				\
 			$(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \
-			-e TARGET_LIST=$(TARGET_LIST) 			\
+			-e TARGET_LIST=$(subst $(SPACE),$(COMMA),$(TARGET_LIST))	\
 			-e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \
 			-e V=$V -e J=$J -e DEBUG=$(DEBUG)		\
 			-e SHOW_ENV=$(SHOW_ENV) 			\
-- 
2.17.0


Re: [Qemu-devel] [PATCH v2] tests/docker/Makefile.include: handle empty TARGET_LIST
Posted by Fam Zheng 5 years, 10 months ago
On Mon, 05/21 11:35, Alex Bennée wrote:
> If the user doesn't specify a TARGET_LIST they get the current
> configuration but with spaces and hilarity ensues. This adds some make
> magic to turn the TARGET_LIST back into a comma separated list.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Queued, thanks!

Fam