给定Makefile(本例中不需要命令):
program: src0.o src1.o
src0.o: src0.c src0.h
src1.o: src1.c src1.h src0.h
有没有人知道可以生成点文件的工具?
如下:
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";
}
请注意,此工具也可以足够智能地快捷.o文件,并假装c文件依赖于它们包含的标头。
digraph "Dependencies" {
"src0.h" -> "src0.c";
"src0.h" -> "src1.c";
"src1.h" -> "src1.c";
"src0.c" -> "program";
"src1.c" -> "program";
}
答案 0 :(得分:8)
使用GraphViz创建Makefile图表?这样做你需要的吗?
https://metacpan.org/pod/Makefile::GraphViz或https://metacpan.org/pod/GraphViz::Makefile