I'm wondering if there is a tool that can generate a dependency graph between C language object files and then analyze how to turn that graph into a DAG by modifying code that creates cycles, moving it to other source files.

I've drawn a dependency graph by hand and I could probably make one by using makedepend or something similar, but the moving of functions also has to be done by hand.

Sorry if that's vague, but that's about the best I can describe it right now.

  • What do you mean by "moving the functions"? Do you want a tool to automatically modify source code for you? Commented May 21, 2012 at 12:38
  • Yes, the description is clearer now.
    – markw
    Commented May 21, 2012 at 12:59

1 Answer 1


There is a the Makefile.GraphViz perl module uses GraphViz to generate dependency graphs from Makefile rules. The documentation has an example of how to use it.

  • Thanks for the response. I was looking more for something like this or the associated AST module for generating dependencies. More than that though, I'm looking for a ready-made tool, if there is one.
    – markw
    Commented May 21, 2012 at 13:11
  • And you can use gcc to generate the dependencies. Commented May 21, 2012 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.