title: using `date` in Makefile variable
body: <p>Using GNU Make 4.1, in my Makefile I can create a timestamp log file with this::</p>
  
  <pre><code>flush_log:
          @echo "==&gt; flush logs"
          cat file &gt; file_`date +%FT%T%Z`.log
  </code></pre>
  
  <p>But who to put:</p>
  
  <pre><code>file_`date +%FT%T%Z`.log
  </code></pre>
  
  <p>in a var inside the Makefile e.g to make a <code>wc</code> on it ?</p>
  
  <p>I've try (with no success):</p>
  
  <pre><code>flush_log:
      @echo "==&gt; flush logs"
      logfile:=file_$(shell date +%FT%T%Z).log
      cat my_log &gt; $(logfile)
      echo `wc -l $(logfile)`
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>$ make flush_log
  ==&gt; flush logs
  logfile:=file_2016-12-24T20:09:52CET.log
  /bin/sh: 1: logfile:=file_2016-12-24T20:09:52CET.log: not found
  Makefile:7: recipe for target 'flush_log' failed
  make: *** [flush_log] Error 127
  $
  </code></pre>
  
  <p>I was following recommendation from <a href="https://stackoverflow.com/a/14939434/3313834">https://stackoverflow.com/a/14939434/3313834</a> and Simply expanded variables <a href="https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors" rel="noreferrer">https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors</a></p>