Message ID | 20230622153005.31604-6-anthony.perard@citrix.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | build: reduce number of $(shell) execution on make 4.4 | expand |
On 22.06.2023 17:30, Anthony PERARD wrote: > --- a/Config.mk > +++ b/Config.mk > @@ -19,13 +19,13 @@ or = $(if $(strip $(1)),$(1),$(if $(strip $(2)),$(2),$(if $(strip $(3)),$( > > -include $(XEN_ROOT)/.config > > -XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \ > +XEN_COMPILE_ARCH ?= $(eval 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/) > + -e s/aarch64/arm64/))$(XEN_COMPILE_ARCH) I'd like to suggest to wrap this differently, e.g. XEN_COMPILE_ARCH ?= $(eval 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/) \ )$(XEN_COMPILE_ARCH) > XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) > -XEN_OS ?= $(shell uname -s) > +XEN_OS ?= $(eval XEN_OS := $(shell uname -s))$(XEN_OS) With these further uses of this same construct as in patch 4, is there any chance of abstracting (part of, e.g. at least the rhs of the ?=) the construct into a macro? Jan
diff --git a/Config.mk b/Config.mk index c529b1ba19..5fbdbc4500 100644 --- a/Config.mk +++ b/Config.mk @@ -19,13 +19,13 @@ or = $(if $(strip $(1)),$(1),$(if $(strip $(2)),$(2),$(if $(strip $(3)),$( -include $(XEN_ROOT)/.config -XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \ +XEN_COMPILE_ARCH ?= $(eval 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/) + -e s/aarch64/arm64/))$(XEN_COMPILE_ARCH) XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) -XEN_OS ?= $(shell uname -s) +XEN_OS ?= $(eval XEN_OS := $(shell uname -s))$(XEN_OS) CONFIG_$(XEN_OS) := y