title: A variable is defined in makefile but Make ignores it. Why?
body: <p>From the <a href="https://www.gnu.org/software/make/manual/html_node/Target_002dspecific.html#Target_002dspecific" rel="nofollow">docs</a>:</p>
  
  <blockquote>
    <p>There is one more special feature of target-specific variables: when you define a target-specific variable that variable value is also in effect for all prerequisites of this target, and all their prerequisites, etc. (unless those prerequisites override that variable with their own target-specific variable value).</p>
  </blockquote>
  
  <p>So, given a makefile:</p>
  
  <pre class="lang-make prettyprint-override"><code>$(shell rm -rf x D)
  $(shell mkdir D)
  $(shell touch D/x)
  
  VPATH = D
  
  all: x ;
  
  x ::
      @echo 'foo is: $(foo)'
  
  .SILENT : D/x
  
  all : foo = bar
  </code></pre>
  
  <p>Running, I get:</p>
  
  <pre class="lang-console prettyprint-override"><code>foo is:
  </code></pre>
  
  <p>And I thought, that I defined above: <code>foo = bar</code>!</p>
  
  <p>Or, did I?</p>