From 7443a1fb8c8fe573ad5e3c594e2585af6c5ce9ee Mon Sep 17 00:00:00 2001 Message-Id: <7443a1fb8c8fe573ad5e3c594e2585af6c5ce9ee.1716320416.git.mdw@distorted.org.uk> From: Mark Wooding Date: Tue, 5 May 2020 20:48:32 +0100 Subject: [PATCH] Makefile: Add a new thing for running arbitrary commands. Organization: Straylight/Edgeware From: Mark Wooding --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index a3a1ecc..c9befaf 100644 --- a/Makefile +++ b/Makefile @@ -647,6 +647,19 @@ maint: all check $(MAINT) -f$(FRESH) $(JOBS) .PHONY: maint +###-------------------------------------------------------------------------- +### Running random commands. + +CMD = echo %d %a +subst-command = $(subst %d,$(call chroot-dist,$1), \ + $(subst %a,$(call chroot-arch,$1), \ + $(subst %r,$1, $(CMD)))) + +run: $(foreach c,$(ALL_CHROOTS),run/$c) +$(foreach c,$(ALL_CHROOTS),run/$c): run/%: + $(V_AT)$(call v_print,RUN,$(call subst-command,$*))\ + $(call subst-command,$*) + ###-------------------------------------------------------------------------- ### Other maintenance targets. -- [mdw]