### ## Simple file for selecting targets by wildcard search on either ## the target names or by the values of the targets ## make => runex1 runex2 runex3 ## make search='%2' => runex2 ## Note that search uses a glob like filtering with % as wildcard ## make argsearch='foo' => runex1 runex3 ## Note that search uses no wildcard but is a simple findstring # RUNTESTS=runex1 runex2 runex3 runex1="foo" runex2="bar" runex3="foo bar" ifdef search NEW_RUNTESTS = $(filter $(search),$(RUNTESTS)) ACTUAL_RUN=$(NEW_RUNTESTS) else ifdef argsearch NEW_RUNTESTS=$(foreach rarg, $(RUNTESTS), $(if $(findstring $(argsearch),$(value $(rarg))), $(rarg))) ACTUAL_RUN=$(NEW_RUNTESTS) else ACTUAL_RUN=$(RUNTESTS) endif endif all: address@hidden ">"$(ACTUAL_RUN)