From: Christian Marangi Date: Sun, 22 Jan 2023 00:42:10 +0000 (+0100) Subject: Makefile: fix shell error for darwin major/minor version check X-Git-Tag: v2025.01-rc5-pxa1908~1118^2~45 X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=748c1ab464852eaca06a57af067565e73223e7bb;p=u-boot.git Makefile: fix shell error for darwin major/minor version check Fix shell error: /bin/sh: line 0: [: too many arguments for the darwin major/minor version check. It seems for os_x_before for some reason DARWIN_MAJOR_VERSION and DARWIN_MINOR_VERSION are empty. To fix this set DARWIN_MAJOR_VERSION and DARWIN_MINOR_VERSION to be evaluated once so the value is retained. Signed-off-by: Christian Marangi Reviewed-by: Simon Glass --- diff --git a/Makefile b/Makefile index 7eaf45496c..fa4f38b66a 100644 --- a/Makefile +++ b/Makefile @@ -318,8 +318,8 @@ endif # ifeq ($(HOSTOS),darwin) # get major and minor product version (e.g. '10' and '6' for Snow Leopard) -DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.') -DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.') +DARWIN_MAJOR_VERSION := $(shell sw_vers -productVersion | cut -f 1 -d '.') +DARWIN_MINOR_VERSION := $(shell sw_vers -productVersion | cut -f 2 -d '.') os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \ $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;)