Hi Paul,
> > The real workaround goes like this:
> >
> > ===================================================
> > all : copy1 copy2 copy3 copy4
> >
> > copy1: Makefile
> > install -c -m 644 Makefile copy1
> > install -c -m 644 Makefile copy2
> > install -c -m 644 Makefile copy3
> > install -c -m 644 Makefile copy4
> > copy2 copy3 copy4: copy1
> > ===================================================
>
> This is not fully-correct either:
>
> $ make
> install -c -m 644 Makefile copy1
> install -c -m 644 Makefile copy2
> install -c -m 644 Makefile copy3
> install -c -m 644 Makefile copy4
>
> $ rm copy3
>
> $ make
> make: Nothing to be done for 'all'.
Indeed. Thank you for having spotted this; otherwise I would have put a
broken rule into GNU gettext.
Now, when my use-case is:
- one rule that produces N files (N > 1),
- I want "make" to execute the rule only once, not N times,
even with parallel make.
What is the solution? The documentation page [1] explicitly does NOT mention
this use-case for multiple targets on the same rule.
You mentioned splitting the rule into one rule per file. But bison does not
work this way; it really produces two files at once. And for other rules
I mentioned Automake limitations.
Parallel make is of growing importance, because Debian now uses parallel builds
by default (quote: "debhelper >= 10 defaults to parallel build").
Bruno
[1] https://www.gnu.org/software/make/manual/html_node/Multiple-Targets.html
_______________________________________________
Bug-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-make