Sun 09 Jul 2017 09:26:49 PM UTC, comment #1:
Actually what's happening is that your rule is being misinterpreted as a static pattern rule, not a pattern rule, and it's not because you are using $$%, it's because you are using a substitution reference in a secondary expansion. Also it doesn't matter how many uses of "$$%" you use; even one substitution reference will show this problem.
Because you have used "$$" in the prerequisites list, make doesn't interpret this as a variable reference. That means the open parenthesis is not part of a variable reference and has no special meaning to make. So when make sees this:
it tokenizes this string as "blahblah", ":", "$$(%", ":", "blah)". The ":" IS a special character to make, it's a rule separator. When make sees a word containing the special character "%" between two ":" characters it interprets this to be a static pattern rule. Because the "target" doesn't match the pattern, you get this error.
I don't see any way to solve this problem: the grammar here is simply ambiguous and make can't know what you mean.
In order to do what you want you cannot use a substitution reference (directly) because of the ":" character in it. You can either use a patsubst function:
(here there's no ":" in the prereq list so it works). Or you can use a variable to hide the ":" and ensure that make parses things correctly:
|