title: Set newly created file as variable in makefile
body: <p>I am trying to create a file and set the contents of a file to a variable but the variable is always seen as empty.</p>
  
  <p>An example: </p>
  
  <pre><code>define FILE_VAR
      cat /output/1.txt &gt;&gt; /output/2.txt
      $(eval s := $(shell cat /output/2.txt)) 
      $(eval FILENAME_BIN=$(word 1, $(s)).$(word 2, $(s)).$(word 3, $(s)).bin) 
      $(eval FILENAME_JFFS2=$(word 1, $(s)).$(word 2, $(s)).$(word 3, $(s)).jffs2)        
  endef
  </code></pre>
  
  <p>If <code>2.txt</code> exists before running this the variables will be set to the data prior to running make (not the new redirected data), if <code>2.txt</code> doesn't exist then the variables are not set. It looks like it is evaluating what the file is like when make is first run, which is not what I want...</p>