title: Makefile For Loop on Windows
body: <p>This is a similar question to the one I <a href="https://stackoverflow.com/questions/2019290/for-loop-not-working-in-makefile-i-was-unexpected-at-this-time">ask here</a>. I am running on Windows XP.</p>
  
  <p>I am trying to get for loop to work on Windows. Following the suggestion that <a href="https://stackoverflow.com/questions/2019290/for-loop-not-working-in-makefile-i-was-unexpected-at-this-time/2019361#2019361">I have to make sure that the command are valid cmd command</a>, I constructed a valid for loop batch command:</p>
  
  <pre><code>@echo off
  FOR /F "tokens=4 delims=," %%G IN ("deposit,$4500,123.4,12-AUG-09") ^
  DO ^
  echo Date paid %%G ^ 
  </code></pre>
  
  <p>And put it in a Makefile. This is the content of the makefile:</p>
  
  <pre><code>all:
      @echo off
      FOR /F "tokens=4 delims=," %%G IN ("deposit,$4500,123.4,12-AUG-09") ^
      DO ^
      echo Date paid %%G ^
  </code></pre>
  
  <p>But still, I got an error:</p>
  
  <blockquote>
    <p>FOR /F "tokens=4 delims=," %%G IN
    ("deposit,500,123.4,12-AUG-09") ^
    make: *** [all] Error 255</p>
  </blockquote>
  
  <p>Any idea how to fix this?</p>