title: Makefile patsubst multiple occcurence in replacement pattern
body: <p>I have 3 dirs and want to link an executable against the libraries </p>
  
  <p>I already have the directory list:</p>
  
  <p><code>DIRS=Math Graph Test</code></p>
  
  <p>I want to get the library list like this:</p>
  
  <p><code>LIBS=Math/libMath.a Graph/libGraph.a Test/libTest.a</code></p>
  
  <p>If I use this:</p>
  
  <p><code>$(DIRS:%=%/%.a)</code></p>
  
  <p>I get:</p>
  
  <p><code>Math/%.a Graph/%.a Test/%.a</code></p>
  
  <p><a href="http://www.gnu.org/software/make/manual/make.html#Text-Functions" rel="noreferrer">GNU Makefile</a> says:</p>
  
  <blockquote>
    <p>Only the first ‘%’ in the pattern and replacement is treated this way; <strong>any subsequent ‘%’ is unchanged</strong>.</p>
  </blockquote>
  
  <p>Here I need 2 occurrences to be replaced, not just the first one.</p>