tags:

views:

70

answers:

2

My understanding is that when make executes, it generates a DAG internally to represent all the dependencies in the project. Is there a way to get at that DAG and graph it, say using something like graphviz?

I'm using gnu make on Ubuntu 8.04.

EDIT

I just ran across these tools called mamdag and mamdot. They're supposed to work with both nmake and gnu make, but I can't seem to find the options to get gnu make to spit out the mam file.

It can be downloaded here - these packages:

INIT
ast-base
ast-gpl

Just found this article by Glenn Fowler at AT&T describing the MAM language and the mamdot tool.

It seems like you have to patch gnu make for this to work, although I'm not 100% certain yet.

Maybe there's another way?

+1  A: 

For the code side of things, doxygen will produce dependency diagrams between source and header files, if that is what you are interested in, without the use of make.

anon
No, I actually want a dump of `make`'s internal DAG. It's a way of proving that the build setup for a particular project is broken and needs to be reworked. Along the lines of the paper, "Recursive Make Considered Harmful", http://aegis.sourceforge.net/auug97.pdf
Robert S. Barnes
+2  A: 

You should try using Makefile::GraphViz's gvmake utility to create the graphs you want

Hasturkun
+1 for interesting, but what I really want is to visualize gnu make's internal DAG.
Robert S. Barnes
`makesimple`, which the gvmake doc suggests you use, gets the output from `make --print-data-base` and parses that. it probably contains enough information about the internal DAG, though I can't really confirm that
Hasturkun