Anyone knows a tool to generate a dot (graphviz) file from a Makefile? [closed]
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 questionGiven 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
精彩评论