arm-trusted-firmware/make_helpers
Chris Kay a57b94ec7c build: fix grouped targets on Make <= 4.2
Grouped targets are a feature introduced with GNU Make 4.3 which enable
rules with multiple targets to communicate that all of the targets of
that rule are built simultaneously, rather than independently.

For example, without grouped targets the following rule may be executed
twice:

    a.txt b.txt:
    	touch a.txt b.txt

    # $ remake -j2 a.txt b.txt
    # touch a.txt b.txt
    # touch a.txt b.txt

In this example, both `a.txt` and `b.txt` are touched twice, when the
rule should only be executed once. Instead, this rule can use a grouped
target:

    a.txt b.txt &:
    	touch a.txt b.txt

    # $ remake -j2 a.txt b.txt
    # touch a.txt b.txt
    # remake: 'b.txt' is up to date.

In this case, both `a.txt` and `b.txt` are created once only, as Make
now knows that the recipe will create both files.

Note that pattern rules with multiple targets always behave this way.

Previously, we assumed that the grouped target feature was available,
but on systems still packaging Make 4.2, most prominently Ubuntu 20.04,
this is not the case. This change adds a check to ensure that we do not
use grouped targets if they are unavailable.

Change-Id: Ifd9da35421ae11468d7a25d3cbc76f6036921749
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-10-28 12:10:36 +00:00
..
tbbr fix(tbbr): unrecognised 'tos-fw-key-cert' option 2023-09-07 11:14:52 +01:00
toolchains build: make Poetry optional 2024-09-26 14:23:20 +00:00
arch_features.mk Merge "fix(mte): remove deprecated CTX_INCLUDE_MTE_REGS/FEAT_MTE" into integration 2024-10-25 16:37:34 +02:00
armv7-a-cpus.mk refactor(build): merge march32/64 directives 2023-06-22 16:37:03 -05:00
build-rules.mk build: consolidate directory creation rules 2024-07-22 09:41:30 +00:00
build_env.mk build: consolidate directory creation rules 2024-07-22 09:41:30 +00:00
build_macros.mk Merge changes from topic "romlib-fixes" into integration 2024-08-17 10:09:06 +02:00
common.mk build: unify verbosity handling 2024-06-14 15:54:48 +00:00
cygwin.mk Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
defaults.mk feat(rmmd): el3 token sign during attestation 2024-10-15 08:20:28 -07:00
march.mk build: skip toolchain detection for some targets 2024-05-14 15:41:15 +00:00
msys.mk Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
plat_helpers.mk feat(build): add ability to define platform specific defaults 2024-09-17 21:44:39 +03:00
toolchain.mk build: make Poetry optional 2024-09-26 14:23:20 +00:00
unix.mk build: consolidate directory creation rules 2024-07-22 09:41:30 +00:00
utilities.mk build: fix grouped targets on Make <= 4.2 2024-10-28 12:10:36 +00:00
windows.mk build: consolidate directory creation rules 2024-07-22 09:41:30 +00:00