Re: Performance loss when trying to use grouped targets
Stephen Touset via Users list for the GNU implementation of make <[email protected]> Tue, 5 Mar 2024 21:40:48 +0100
| Newsgroups | gmane.comp.gnu.make.general |
|---|---|
| Message-ID | <CAPp2xhYamUufnVxhpXJqpiwbj9Xw+9+rNxSf0+D9Z4uX_UtKJQ@mail.gmail.com> |
On Mar 5, 2024 at 10:06:44, Paul Smith <[email protected]> wrote: 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 $@ > > > > >