title: Anyone knows a tool to generate a dot (graphviz) file from a Makefile?
body: <p>Given a Makefile (command are not needed in this example):</p>
  
  <pre><code>program: src0.o src1.o
  
  src0.o: src0.c src0.h
  
  src1.o: src1.c src1.h src0.h
  </code></pre>
  
  <p>Does anyone knows of a tool that can generate a dot file?</p>
  
  <p>As follows:</p>
  
  <pre><code>digraph "Dependencies" {
  "src0.h" -&gt; "src0.o";
  "src0.h" -&gt; "src1.o";
  "src1.h" -&gt; "src1.o";
  "src0.c" -&gt; "src0.o";
  "src1.c" -&gt; "src1.o";
  "src0.o" -&gt; "program";
  "src1.o" -&gt; "program";
  }
  </code></pre>
  
  <p>Note that this tool could also be smart enough to shortcut the .o files, and pretend that the c files depend on the headers they include.</p>
  
  <pre><code>digraph "Dependencies" {
  "src0.h" -&gt; "src0.c";
  "src0.h" -&gt; "src1.c";
  "src1.h" -&gt; "src1.c";
  "src0.c" -&gt; "program";
  "src1.c" -&gt; "program";
  }
  </code></pre>