help-make
[Top][All Lists]
Advanced

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

Re: Performance loss when trying to use grouped targets


From: Paul Smith
Subject: Re: Performance loss when trying to use grouped targets
Date: Tue, 05 Mar 2024 13:06:44 -0500
User-agent: Evolution 3.50.4 (by Flathub.org)

On Mon, 2024-03-04 at 21:01 -0500, Dmitry Goncharov wrote:
> A grouped targets rule like
> a.x b.x &: a.q b.q; cp a.q b.q build/
> tells make that a.x depends on a.q and b.q and b.x depends on a.q and
> b.q. Which is not "each file depends on its corresponding file".
> 
> The above grouped rule is the same as
> a.x: a.q b.q; cp a.q b.q build/
> b.x: a.q b.q; cp a.q b.q build/

(There must be more to this recipe than that since these recipes don't
actually build the targets a.x or b.x.  I'm assuming you meant each
recipe to create both a.x and b.x.)

These two formulations are not really the same: grouped targets work
differently and can't be replaced with an expanded version.  A grouped
target:

  a.x b.x &: a.q b.q ; <cmd>

can only be emulated by something like this:

  a.x b.x : .sentinel ;

  .sentinel : a.q b.q ; <cmd> ; touch $@




reply via email to

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