开发者

Anyone knows a tool to generate a dot (graphviz) file from a Makefile? [closed]

Closed. This question is seeking recommendations for books, tools, software li开发者_JAVA百科braries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 6 years ago.

Improve this question

Given a Makefile (command are not needed in this example):

program: src0.o src1.o

src0.o: src0.c src0.h

src1.o: src1.c src1.h src0.h

Does anyone knows of a tool that can generate a dot file?

As follows:

digraph "Dependencies" {
"src0.h" -> "src0.o";
"src0.h" -> "src1.o";
"src1.h" -> "src1.o";
"src0.c" -> "src0.o";
"src1.c" -> "src1.o";
"src0.o" -> "program";
"src1.o" -> "program";
}

Note that this tool could also be smart enough to shortcut the .o files, and pretend that the c files depend on the headers they include.

digraph "Dependencies" {
"src0.h" -> "src0.c";
"src0.h" -> "src1.c";
"src1.h" -> "src1.c";
"src0.c" -> "program";
"src1.c" -> "program";
}


Create Makefile graphs using GraphViz? Does this do what you need?

https://metacpan.org/pod/Makefile::GraphViz or https://metacpan.org/pod/GraphViz::Makefile

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜