ProblemI want to see the dependencies for one or more targets of a makefile. So I am looking for a program that can parse makefiles and then will represent the dependencies in some tree-like format (indentation, ascii-art, ...) or as a graph (dot, ...).SimilarThere are programs that do this for other situations: pactree or debtree can display the dependencies for software packages in the respective format in a tree like ascii format or as a dot graph,gcc -M source_file.c displays the dependencies of the C source file as a make rule, pstree displays an ascii representation of the process tree.ProgressSearching the web I found little help.  That lead me to trymake --always-make --silent --dry-run some_target | \  grep --extended-regexp 'Considering target file|Trying rule prerequisite'but it looks like I have to hack some more parsing code in perl or python in order to represent this as a nice tree/graph.  And I do not yet know if I will really get the full and correct graph this way.RequirementsIt would be nice to limit the graph in some ways (no builtin rule, only a given target, only some depth) but for the most part I am just looking for a tool that will give me the dependencies in some reasonable, human-viewable format (like the programs under Similar do).QuestionsAre there any programs that can do this?Will I get the full and correct information from make -dnq ...?Is there a better way to get this info?Do scripts/attempts for parsing this info already exist?
How to display dependencies given in a makefile as a tree?
text processing;make;gnu make
I found makefile2graph, I don't test it, from the same author there is a a similar tool MakeGraphDependencies written in java instead of c.