bug-make
[Top][All Lists]
Advanced

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

Re: Checking application of dependencies from make rules without recipes


From: Paul Smith
Subject: Re: Checking application of dependencies from make rules without recipes
Date: Tue, 20 Jun 2017 19:16:29 -0400

On Tue, 2017-06-20 at 14:19 +0200, SF Markus Elfring wrote:
> > This applies only to implicit rules, not explicit rules.
> > > Can an explicit make rule also be cancelled anyhow?
> > No.
> 
> Thanks for this clarification.
> 
> This distinction has got important consequences on how the different
> make rule types can and should be ordered relative to each other.

I don't see why it makes a difference in how rule types should be
ordered (I assume that by "ordered" you mean which rules are defined
first in the makefile).

Regardless of the order in which rules appear, an explicit rule is
always used to build a target if it exists.

Only if an explicit rule does not exist will an implicit rule search be
performed.

This is true regardless of whether the explicit rule comes before or
after the implicit rule when parsing the makefile.

Remember that make parses everything in all the makefiles first,
constructing a set of internal data structures representing all the
rules defined in all the makefiles and all of their explicit
relationships, _before_ it tries to build any target.  So by the time
make is ready to build its first target, it already knows everything
defined anywhere in the makefile.

Makefiles are not like the shell or other interpreted languages where
commands are executed as they are parsed.



reply via email to

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