From a4885765eedbddafcc57bce6cbfcd443d0a7eca9 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Mon, 13 Dec 2021 18:49:17 +0000 Subject: [PATCH] tools/libs: Don't recursively expand MAJOR ?= $(shell ...) ?= is a deferred assignment. Switch to an alternative form which lets us use an immediate assignment. Before, version.sh gets run anywhere between 46 and 88 times, with 50 on a `clean`. After, between 6 and 12 times. Signed-off-by: Andrew Cooper Reviewed-by: Anthony PERARD --- tools/libs/libs.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index dfbbef4080..b21e0bf083 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -6,7 +6,10 @@ # MINOR: minor version of lib (0 if empty) LIBNAME := $(notdir $(CURDIR)) -MAJOR ?= $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile) + +ifeq ($(origin MAJOR), undefined) +MAJOR := $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile) +endif MINOR ?= 0 SHLIB_LDFLAGS += -Wl,--version-script=libxen$(LIBNAME).map -- 2.30.2