title: How to abort makefile if variable not set?
body: <p>How could I abort a make/makefile execution based on a makefile's variable not being set/valued?</p>
  
  <p>I came up with this, but works only if caller doesn't explicitly run a target (i.e. runs <code>make</code> only).</p>
  
  <pre><code>ifeq ($(MY_FLAG),)
  abort:   ## This MUST be the first target :( ugly
      @echo Variable MY_FLAG not set &amp;&amp; false
  endif
  
  all:
      @echo MY_FLAG=$(MY_FLAG)
  </code></pre>
  
  <p>I think something like this would be a good idea, but didn't find anything in make's manual:</p>
  
  <pre><code>ifndef MY_FLAG
  .ABORT
  endif
  </code></pre>