LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   print make dependency tree? (http://www.linuxquestions.org/questions/programming-9/print-make-dependency-tree-726039/)

chadwick 05-14-2009 02:01 PM

print make dependency tree?
 
I'm curious if anyone knows of a way to print out in a visual way the dependencies that are specified in a makefile.

Of course you could just read the makefile or run make and look at the compiler/linker commands that make prints when it executes, but I'm interested in something that would be more immediately obvious to the eye, to avoid having to spend my cognitive resources on unnecessary activities.

The reason I'm interested in this is that I have a project that someone else created that is composed of several files, and in order to start to understand what each file is, it's good to know what depends on what.

Obviously make builds a dependency tree itself, so it's a plausibly small leap to go from there to printing it out in a nice pleasing way. I'm curious if anyone's done that.

Sergei Steshenko 05-14-2009 03:34 PM

I think you'll need an additional script; if we are talking about GNU make, a dry run can be performed; see

man make

and pay attention to

--debug
--always-make
--dry-run
.


All times are GMT -5. The time now is 04:31 PM.