title: Makefile: converting multiple .dot files to .png
body: <p>I'm fairly new to makefiles so please don't be to harsh. :)</p>
  
  <p>My problem is that I want to convert all .dot files in the directory of the makefile to .png files.
  Usually this command should solve my problem:</p>
  
  <pre><code>DOT_FILES=$(wildcard *.dot)
  DOTPNG=$(DOT_FILES:.dot=.png)
  ...
  ...    
  dot: $(DOT_FILES)       
       @dot -Tpng $(DOT_FILES) &gt; $(DOTPNG)
  </code></pre>
  
  <p>.. but it doesn't. It seems that it is converting all files but also overwriting them. So all I get is 1 of 3 .png files and this error:</p>
  
  <pre><code>Error: dot: can't open graph.png
  Error: dot: can't open example.png
  Makefile:35: recipe for target 'dot' failed
  make: *** [dot] Error 3
  </code></pre>
  
  <p>Am I doing something wrong or isn't this the code I am looking for? </p>