title: Create a .dot graph of a C++ projects dependencies from the output of gcc -MG -MM
body: <p>I'm trying to visualize the dependencies of a c++ project. I'd like to use standard tools: g++ to generate the dependencies, sed(?) to format, and graphviz/dot to and output a svg.</p>
  <p>I'm invoking g++ with <code>g++ -MG -MM *.cc</code>. The output looks something like:</p>
  <pre><code>compare.o: compare.cc compare.h types.h
  config.o: config.cc config.h mute.h types.h log.h
  lamp.o: lamp.cc lamp.h il_types.h
  log.o: log.cc log.h FreeRTOS.h task.h mute.h string.h
  login.o: login.cc login.h \
   utils/bcrypt.hpp utils/async.h
  math.o: math.cc math.h types.h log.h FreeRTOS.h task.h \
    mute.h
  </code></pre>
  <p>How can I convert this output to dot graph syntax, so I can visualize the dependencies?</p>