Skip to contentSkip to conversation

tests/docker/Makefile.include: handle empty TARGET_LIST

PATCH Applied Alex Bennée 2 participants 2 messages May 21, 2018 – May 23, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests/docker/Makefile.include: handle empty TARGET_LIST

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.

---
v2
- use common $(SPACE) and $(COMMA) in rules.mak

---
 rules.mak                     | 3 +++
 tests/docker/Makefile.include | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
rules.mak +3 -0
index 04c7f74d07..bbb2667928 100644
@@ -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
tests/docker/Makefile.include +1 -1
index d00887bdf1..e911d44d9f 100644
@@ -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) 			\
Signature · 1 line
2.17.0
Applied
#1 lore raw
Quoted 5 lines · Alex Bennée

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.

Queued, thanks!

Fam