Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
What do you mean by "moving the functions"? Do you want a tool to automatically modify source code for you? – Benjamin Bannier May 21 '12 at 12:38
Yes, the description is clearer now. – markw May 21 '12 at 12:59

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.

share|improve this answer
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 May 21 '12 at 13:11
And you can use gcc to generate the dependencies. – Crazy Eddie May 21 '12 at 15:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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