help-make
[Top][All Lists]
Advanced

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

Re: directory search fails!


From: Eli Zaretskii
Subject: Re: directory search fails!
Date: Sat, 25 Sep 2010 13:26:03 +0200

> Date: Sat, 25 Sep 2010 14:34:53 +0330
> From: ali hagigat <address@hidden>
> 
> Your description seems better than the manual in my opinion. You
> deleted the word, 'target' in Step 4.
> Could you make a pdf file only one paragraph, "4.4.3 How Directory
> Searches are Performed",
> with your style, to compare it with the present manual completely. Not
> to see symbols like @var{P}, etc.

Making a PDF is not simple where I'm typing this.  Here's the Info
(plain text) version, though:

 4.5.3 How Directory Searches are Performed
 ------------------------------------------

 When a prerequisite of a target is found through directory search,
 regardless of type (general with `VPATH' or selective with `vpath'),
 the pathname found by the search may not be the one that `make'
 actually uses for updating that target.  Sometimes the path of a
 prerequisite discovered through directory search is thrown away.

    This section describes the details of the decision whether or not to
 keep the path of a prerequisite found through directory search.

    The algorithm `make' uses to decide whether to keep or abandon a
 path or a prerequisite (denoted as P below) found via directory search
 is as follows:

   1. If a prerequisite file P does not exist at the path specified in
      the makefile, directory search is performed.

   2. If the prerequisite P is found via directory search, the pathname
      under which `make' found P is tentatively recorded as the actual
      prerequisite.  (This is a tentative decision, because it could be
      reversed later, see below.)

   3. All the prerequisites of P are examined using this same method,
      i.e. by using directory search if the file specified by the
      makefile does not exist.

   4. After recursively processing all the prerequisites of P, `make'
      decides whether or not P needs to be rebuilt.  This decision
      affects whether the actual pathname of P found by directory search
      is kept:

        a. If P does _not_ need to be rebuilt, the actual pathname of P
           found during directory search is used in any prerequisite
           lists which contain P.  In other words, if `make' doesn't
           need to rebuild a prerequisite, then it uses its pathname
           found via directory search when it processes targets which
           depend on this prerequisite.

        b. If P _does_ need to be rebuilt (is out-of-date), its actual
           pathname found during directory search is _thrown away_, and
           P is rebuilt at the literal location specified in the
           makefile.  In other words, if `make' must rebuild a
           prerequisite, then it is rebuilt locally, not in the
           directory found via directory search.

    This algorithm may seem complex, but in practice it is quite often
 exactly what you want.

    Other versions of `make' use a simpler algorithm: if the file does
 not exist, and it is found via directory search, then that pathname is
 always used whether or not it needs to be built.  Thus, if the
 prerequisite is rebuilt, it is created at the pathname found during
 directory search, and that pathname is used for any targets which
 mention the prerequisite in their prerequisite lists.

    If, in fact, this is the behavior you want for some or all of your
 directories, you can use the `GPATH' variable to indicate this to
 `make'.

    `GPATH' has the same syntax and format as `VPATH' (that is, a space-
 or colon-delimited list of pathnames).  If an out-of-date target is
 found by directory search in a directory that also appears in `GPATH',
 then that pathname is not thrown away.  The target is rebuilt using the
 expanded path.



reply via email to

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