help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does the Dependency Build Graph get build?


From: Paul Smith
Subject: Re: How does the Dependency Build Graph get build?
Date: Sat, 24 Feb 2007 18:12:37 -0500

On Fri, 2007-02-23 at 07:38 -0800, Jochen wrote:

> Software needs to get build. This software is also
> depending on other software, that first needs to be
> build. Now I want to build a Depency Graph that tells
> me what to build first.
> 
> I know make does this, but I can't find HOW it does
> that.  Can somebody provide me more information about this?

I'm not sure if your question is literal or not, but assuming it is:
make doesn't have any heuristic on deciding "what to build first".

Make is either told what to build on the command line ("make all"), or
if nothing is specified ("make") it chooses the first target defined in
the makefile and builds that.

Once the ultimate goal target is chosen make simply walks the dependency
graph it created while reading the makefile (for example, when make sees
a rule like "a: b c d" it builds a node for target "a", then creates
nodes for targets "b", "c", and "d", and adds them to a list of
prerequisites of "a".  Then during runtime, it walks the list of
prerequisites for each target and tries to build each one).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]