build: detect broken make version on macOS

Apple ships a broken make version with the Xcode command line tools.
Homebrew installs make as gmake by default in order to not collide with
Apple's version.
Exit with an error if the broken one is used accidentally

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2020-11-14 12:37:39 +01:00
parent 0fd214d89f
commit 3104370455
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,12 @@ export GNU_HOST_NAME:=$(shell $(TOPDIR)/scripts/config.guess)
export HOST_OS:=$(shell uname)
export HOST_ARCH:=$(shell uname -m)
ifeq ($(HOST_OS),Darwin)
ifneq ($(filter /Applications/Xcode.app/% /Library/Developer/%,$(MAKE)),)
$(error Please use a newer version of GNU make. The version shipped by Apple is not supported)
endif
endif
# prevent perforce from messing with the patch utility
unexport P4PORT P4USER P4CONFIG P4CLIENT