help-make
[Top][All Lists]
Advanced

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

Re: directory search fails!


From: Paul Smith
Subject: Re: directory search fails!
Date: Sun, 26 Sep 2010 09:42:33 -0400

On Sun, 2010-09-26 at 08:19 +0330, ali hagigat wrote:
> I am reading your description about the mechanics of directory search.
> The extract of your description appear in double quotation:
> "the pathname found by the search may not be the one that `make'
> actually uses for updating that target"
> It can be expressed as: the pathname found may not be the relative
> pathname typed in the prerequisite list of the target.

No, that's not what it means.  It means that the pathname make finds via
directory search might not be used.

> One advantage of your description is removing the word, "located" in
> the original manual, when you say, "the pathname found by the search".
> English is not my mother tongue language but as far as I know 'locate'
> refers to the place of something mostly, the issue is not place here
> but it is about an string found by the search.

Not true.  "Location" means the place of something.  "Locate" is a verb
which means "to find".  And these targets we're talking about are not
just strings, they're _files_ and _files_ exist in the filesystem in
some directory somewhere... and they can be located.

> Besides directory search is an algorithm which is executed for both
> prerequisites and targets. In section '4.4 Searching Directories for
> Prerequisites' it starts describing directory search, does it mean we
> do not have directory search for targets?!! This seems another weak
> point in the original manual.

Make only does directory search on the target, when it's trying to build
that target.  Technically it does not do directory searches on
prerequisites at all.  But you really have to come to terms with the
fact that make is RECURSIVE, and every prerequisite is also a target.

In the makefile:

        a: b
        b: c

When make is trying to build "a", then "a" is the target and "b" is the
prerequisite.  But when make is trying to build "b", then "b" is the
target (same file!) and "c" is the prerequisite.  And, even though the
makefile does not explicitly list a rule for it, make will _also_ try to
build "c" as a target.

So when make is trying to build "a" as a target, it will do a directory
search on "a", but not on "b" because "b" is a prerequisite.  But then
make will try to build "b" and consider "b" a target, and so the
directory search on "b" will be done at that time.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "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]