title: Computing Makefile variable on assignment
body: <p>In a Makefile, I'm trying to assign the result of a shell command to a variable:</p>
  
  <pre><code>TMP=`mktemp -d /tmp/.XXXXX`
  
  all:
      echo $(TMP)
      echo $(TMP)
  </code></pre>
  
  <p>but</p>
  
  <pre><code>$ make Makefile all
  </code></pre>
  
  <p>is echoing 2 different values, eg:</p>
  
  <pre><code>/tmp/.gLpm1T
  /tmp/.aR4cDi
  </code></pre>
  
  <p>What is the syntax for mktemp to be computed on variable assignment?</p>
  
  <p>Thank you.</p>