mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 10:04:26 +00:00

Most of the macros in build_macros.mk get lazily evaluated. That's mostly fine, except for the fact that the `uppercase` macro needs to spawn a subshell to get its output. And the target for every file requires calling `uppercase` many, MANY, times, thrashing performance on even the most trivial of make commands. We can be a little clever and only call `uppercase` a handful of times and then pass around the already uppercased strings. The same is true about the verbosity augmentation variables. Simply changing them to simply expanded variables allows for them to be pre-processed and then used over and over again. `make realclean` is a pretty good benchmark for this as it doesn't do much else but must process all the rules, like every other make command. On a clean checkout of TF-A on an Intel Xeon Gold 5218 (i.e. slow single-core) workstation, that command used to take about 7 seconds. With this patch it takes about 0.5. Change-Id: I632236a12a40f169e834974ecbc73ff80aac3462 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
17 lines
455 B
Makefile
17 lines
455 B
Makefile
#
|
|
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
|
|
#
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
#
|
|
|
|
ifndef common-mk
|
|
common-mk := $(lastword $(MAKEFILE_LIST))
|
|
|
|
include $(dir $(common-mk))utilities.mk
|
|
|
|
silent := $(call bool,$(findstring s,$(firstword ~$(MAKEFLAGS))))
|
|
verbose := $(if $(silent),,$(call bool,$(V)))
|
|
|
|
s := @$(if $(or $(verbose),$(silent)),: )
|
|
q := $(if $(verbose),,@)
|
|
endif
|