Graphing the DAG generated by make?

2019-03-15 18:30发布

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?

2条回答
一纸荒年 Trace。
2楼-- · 2019-03-15 18:42

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.

查看更多
放我归山
3楼-- · 2019-03-15 18:48

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

查看更多
登录 后发表回答