title: Pre-build step in makefile
body: <p>How can I run a script, which must execute before all other makefile commands? And it will be nice (but not mandatory) to the script is not executed if there is nothing to build.</p>
  
  <p>I've searched SO and Google, but can't find anything.</p>
  
  <p>I have this workaround:</p>
  
  <pre><code># myscript.bat output is empty
  CHEAT_ARGUMENT = (shell myscript.bat)
  CFLAGS += -DCHEAT_ARGUMENT=$(CHEAT_ARGUMENT)
  AFLAGS += -DCHEAT_ARGUMENT=$(CHEAT_ARGUMENT)
  </code></pre>
  
  <p>But it's very ugly. Is there other way to run "<strong>pre-build step</strong>" in <strong>makefile</strong>?</p>