?= 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 <andrew.cooper3@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
# 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