title: Rake -- Watch for Changes
body: <p>Is there a way using Rake to watch depedencies for changes and execute tasks automatically?</p>
  
  <p>For example, given the following <code>Rakefile</code>:</p>
  
  <pre><code>file 'main.o' =&gt; ["main.c", "greet.h"] do
    sh "cc -c -o main.o main.c"
  end
  
  file 'greet.o' =&gt; ['greet.c'] do
    sh "cc -c -o greet.o greet.c"
  end
  
  file "hello" =&gt; ["main.o", "greet.o"] do
    sh "cc -o hello main.o greet.o"
  end
  </code></pre>
  
  <p>It would be great if when I changed <code>greet.c</code> or <code>main.c</code> then <code>hello</code> would automatically execute.</p>