title: Force variable expansion in GNU Make
body: <p>How do I force GNU Make variables to evaluate immediately? Consider the following example:</p>
  
  <pre><code>TARGET:=fred
  wilma:
      mkdir -p $(TARGET)
  TARGET:=barney
  betty:
      mkdir -p $(TARGET)
  all: one two
  .PHONY: one two all
  </code></pre>
  
  <p>With <code>make all</code>, Make will only create "barney", because the recipe strings are evaluated only after the makefile was read and the final value ("barney") was assigned.</p>
  
  <p>I need to create both "fred" and "barney" in this instance.</p>