Reputation: 4716
I am trying to create a pattern rule for a phony target foo-test
which should build an actual file foo-test1
:
%-test: %-test1
%-test1:
touch $@
When I call make --just-print foo-test
I get No rule to make target: foo-test
.
Yet I would expect make to see that foo-test
depends on foo-test1
and apply the second rule to make foo-test1
. How can achieve this behaviour? (I have tried declaring %-test
and %-test1
as .PHONY
; it doesn't help).
Upvotes: 0
Views: 493
Reputation: 101061
This:
%-test: %-test1
does not define a pattern rule. It deletes a pattern rule. See https://www.gnu.org/software/make/manual/html_node/Canceling-Rules.html
You have to give it a recipe if you want to make a pattern rule. Something like this is sufficient:
%-test: %-test1 ;
Upvotes: 1