title: Does a '%' in a pattern match an empty string?
body: <p><strong><em>From the <a href="https://www.gnu.org/software/make/manual/html_node/Selective-Search.html#Selective-Search" rel="nofollow">docs</a>:</em></strong></p>
  
  <blockquote>
    <p>A <code>vpath</code> pattern is a string containing a <code>%</code> character.  The string
    must match the file name of a prerequisite that is being searched for,
    the <code>%</code> character matching any sequence of zero or more characters (as
    in pattern rules).</p>
  </blockquote>
  
  <p><br>
  <br></p>
  
  <p>Now, although, it is true that <code>%</code> does match an <strong><em>empty</em></strong> string (string of zero length) in a vpath pattern (<code>vpath % foo</code>), this is not true for pattern-rules.</p>
  
  <p>So, it is <strong><em>wrong</em></strong> for the documentation above, to equate between them, as:</p>
  
  <blockquote>
    <p>...the '%' character matching any sequence of zero or more characters (as
    in pattern rules.</p>
  </blockquote>
  
  <p><br>  </p>
  
  <p><strong><em>As this is simply not true, as evident by the following Makefile:</em></strong></p>
  
  <pre class="lang-make prettyprint-override"><code>all ::
  
  al%l :
      @echo '$@'
  </code></pre>
  
  <p><br>.
  <br></p>
  
  <p><strong><em>Executing, we get:</em></strong></p>
  
  <pre class="lang-console prettyprint-override"><code># It is evident that 'all' doesn't match 'al%l'
  $ make -r
  make: Nothing to be done for 'all'.
  
  # But, 'all' does match 'al%'
  $ make  -r -f makefile -f &lt;(echo 'al% : ; echo $@')
  echo all
  all
  </code></pre>
  
  <p><br>.
  <br></p>
  
  <p><strong><em>In fact, this is well <a href="https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html#Pattern-Intro" rel="nofollow">documented</a>:</em></strong></p>
  
  <blockquote>
    <p>For example, <code>%.c</code> as a pattern matches any file name that ends in
    <code>.c</code>.  <code>s.%.c</code> as a pattern matches any file name that starts with <code>s.</code>,
    ends in <code>.c</code> and is at least five characters long.  (There must be at
    least one character to match the <code>%</code>.)  The substring that the <code>%</code>
    matches is called the "stem".</p>
  </blockquote>
  
  <p><br>
  <br>
  Agree?</p>