title: How do I write a waf file for a custom compiler?
body: <p>I got sick of looking up the magic symbols in make and decided to try <a href="http://code.google.com/p/waf/" rel="nofollow">waf</a>.</p>
  
  <p>I'm trying to use calibre to make ebooks and I'd like to create a wscript that takes in a file, runs a program with some arguments that include that file, and produces an output. Waf should only build if the input file is newer than the output.</p>
  
  <p>In make, I'd write a makefile like this:</p>
  
  <pre><code>%.epub: %.recipe
      ebook-convert $ .epub --test -vv --debug-pipeline debug
  </code></pre>
  
  <p>Where % is a magic symbol for the basename of the file and $ a  symbol for the output filename (basename.epub).</p>
  
  <p>I could call <code>make soverflow.epub</code> and it would run ebook-convert on soverflow.recipe. If the .recipe hadn't changed since the last build, it wouldn't do anything.</p>
  
  <p>How can I do something similar in waf?</p>
  
  <p>(Why waf? Because it uses a real language that I already know. If this is really easy to use in scons, that's a good answer too.)</p>