With GNU make 4.4, the number of execution of the command present in
these $(shell ) increased greatly. This is probably because as of make
4.4, exported variable are also added to the environment of $(shell )
construct.
So to avoid having these command been run more than necessary, we
will replace ?= by an equivalent but with immediate expansion.
Reported-by: Jason Andryuk <jandryuk@gmail.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
-include $(XEN_ROOT)/.config
-XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
+ifeq ($(origin XEN_COMPILE_ARCH), undefined)
+XEN_COMPILE_ARCH := $(shell uname -m | sed -e s/i.86/x86_32/ \
-e s/i86pc/x86_32/ -e s/amd64/x86_64/ \
-e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \
-e s/aarch64/arm64/)
+endif
XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH)
-XEN_OS ?= $(shell uname -s)
+ifeq ($(origin XEN_OS), undefined)
+XEN_OS := $(shell uname -s)
+endif
CONFIG_$(XEN_OS) := y