title: GNU Make: phony target doesn't seem to be matching pattern
body: <p>I have this minimal Makefile:</p>
  
  <pre><code>.PHONY: foo.bar
  %.bar:
      echo $*
  </code></pre>
  
  <p>I run <code>$ make foo.bar</code> and I expect it to match the %.bar pattern, populate the stem $* with "foo", and echo "foo" all the time because foo.bar is a phony target. However, the output I get is</p>
  
  <pre><code>make: Nothing to be done for 'foo.bar'.
  </code></pre>
  
  <p>Am I missing something here?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I forgot to mention that removing the .PHONY line performs the expected behavior where it echo's "foo", and also making it an explicit target "foo.bar" without the pattern matching. Both of which make perfect sense since in the former, the file, foo.bar, doesn't exist and in the latter, well, it's just explicit.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This might be a duplicate of this actually: <a href="https://stackoverflow.com/questions/3095569/when-declaring-the-pattern-rule-as-phony-it-is-not-triggered">When declaring the pattern rule as PHONY, it is not triggered</a>. Here is something that works:</p>
  
  <pre><code>.PHONY: foo.bar
  
  foo.bar: %.bar:
      echo $*
  </code></pre>
  
  <p>For whatever reason the target/dependency line is more like target/(dependency|target)/dependency. Can someone explain this or point me to the documentation?</p>