I'd like to have a rule depending on a subset of rules based on a wildcard.
For instance, in Makefile: How to apply an equivalent to filter on multiple wildcards a convenient macro contains is defined.
Now imagine $(TEST_LIST) contains a list of tests.
With "contains", I can for instance write: test-foobar: $(call containing,foobar,$(TEST_LIST)
Then if TEST_LIST=foobar2 foobar3 bar2 foo5, test-foobar will depend on foobar2 foobar3
What I want to achieve is something like:
test-%: $(call containing,%,$(TEST_LIST))
So that I can type make test-foo, test-bar, test-foobar.
Unfortunately the above returns:
make: *** No rule to make target `test-foobar'. Stop
So I digged and discovered second expansion. So now, my rule look like:
test-%: $$(call containing,$$*,$(TEST_LIST))
But that doesn't work! I need to at least have a command, e.g.:
test-%: $$(call containing,$$*,$(TEST_LIST))
@echo Done
Do you know why I need this command @echo ?