title: How to make a failing $(shell) command interrupt Make
body: <p>I have a Makefile that starts by running a tool before applying the build rules (which this tool writes for me). If this tool, which is a python script, exits with a non-null status code, I want GNU Make to stop right there and not go on with building the program.</p>
  
  <p>Currently, I do something like this (top level, i.e. column 1):</p>
  
  <pre><code>$(info Generating build rules...)
  $(shell python collect_sources.py)
  include BuildRules.mk
  </code></pre>
  
  <p>But this does not stop make if <code>collect_sources.py</code> exits with a status code of 1. This also captures the standard output of <code>collect_sources.py</code> but does not print it out, so I have the feeling I'm looking in the wrong direction.</p>
  
  <p>If at all possible, the solution should even work when a simple MS-DOS shell is the standard system shell.</p>
  
  <p>Any suggestion?</p>