Re: multi-target with -j2
Philip Guenther <[email protected]> Sun, 8 Jun 2025 12:27:48 -0700
| Newsgroups | gmane.comp.gnu.make.bugs |
|---|---|
| Message-ID | <CAKKmsNiDC5TgJs5Z07iwLdhua5Nm1ZAZ70bCpDy=pLeH8BYLCw@mail.gmail.com> |
On Sun, Jun 8, 2025 at 12:35 AM <[email protected]> wrote: > I am a happy user of make (various implementations) for 25 years. Today I > learned that "multiple target rules" don't do what I thought they do. > While dealing with this, I think I've found a bug, either in code or in > documentation. Plus I have a related suggestion for the doc. > > > 1. multi target with "&:" ran twice > > Attached is a minimal test case. When run with -j2, it executes the "foo1 > foo2" rule twice, in parallel. Please verify that you're using a version of GNU make that's new enough to support this functionality. It was added in version 4.3 and the behavior was tweaked slightly in 4.4. On a system I have with version 4.4, I see the expected behavior with your supplied makefile: $ make -j2 date > foo1 sleep 1 date > foo2 cat foo1 foo2 > bar1 cat foo1 foo2 > bar2 $ If you believe you have a new enough version, please include the output of "make --version" and information about your OS/distribution. Philip Guenther