From: Andrew Cooper Date: Mon, 13 Dec 2021 18:49:17 +0000 (+0000) Subject: tools/libs: Don't recursively expand MAJOR ?= $(shell ...) X-Git-Tag: archive/raspbian/4.17.0-1+rpi1^2~33^2~1208 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a4885765eedbddafcc57bce6cbfcd443d0a7eca9;p=xen.git 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 --- 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