help-make
[Top][All Lists]
Advanced

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

Re: Multiple rules for same target: what is the order of prerequisites i


From: Philip Guenther
Subject: Re: Multiple rules for same target: what is the order of prerequisites in $^ and what does $< expand to?
Date: Wed, 27 Sep 2023 12:39:33 -0700

On Wed, Sep 27, 2023 at 7:52 AM Renaud Pacalet <
renaud.pacalet@telecom-paris.fr> wrote:

> On 9/27/23 16:32, Bahman Movaqar wrote:
> > On Wed, 2023-09-27 at 12:16 +0200, Renaud Pacalet wrote:
> >
> >> 3. Ignore all other implicit rules (which seems to contradict 4.11).
> >
> > Make only ignores the implicit rules for which there are
> > explicit/static equivalents.
>

Per 10.1 "Using Implicit Rules", make will only use an implicit rule for a
target if there isn't an explicit rule with a recipe.  If a target has an
explicit rule with a recipe, then make won't bother looking for
implicit rules and so won't use them to add more prerequisites.

Note that there are additional requirements on what implicit rules will be
used even when they are considered: if they have a prerequisite that
doesn't exist and make doesn't see how to build, then it'll ignore the rule.


Thanks for your answer, Bahman. Not sure what "equivalent" means but with
> the following Makefile:
>
> %.a: %.b
>
> a.a: a.c
>      echo $^
>

a.a has an explicit rule with a recipe so the %.a:%.b rule has no effect on
the a.a target.


Philip Guenther


reply via email to

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