title: How to make makefile exit with error when using a loop?
body: <p>If I have the following bash command:</p>
  
  <pre><code>for i in ./ x ; do ls $i ; done &amp;&amp; echo OK
  </code></pre>
  
  <p>"ls ./" is executed, and then "ls x", which fails (x is missing) and OK is not printed.</p>
  
  <p>If</p>
  
  <pre><code>for i in x ./ ; do ls $i ; done &amp;&amp; echo OK
  </code></pre>
  
  <p>then even though "ls x" fails, because the last statement in the for loop succeeded, then OK is printed. This is a problem when using shell for loops in makefiles:</p>
  
  <pre><code>x:
      for i in $(LIST) ; do \
          cmd $$i  ;\
      done 
  </code></pre>
  
  <p>How can I make make fail if any of the individual executions of cmd fails?</p>