build: detect broken make version on macOS
[openwrt/staging/rmilecki.git] / include / toplevel.mk
index ba5959576424f384e3aa0e6de6a559fd84d46a9a..4003b4824182bf7d3f4243e68c3d4da806d4fc76 100644 (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
 
@@ -91,6 +97,7 @@ prepare-tmpinfo: FORCE
        [ tmp/.config-feeds.in -nt tmp/.packageauxvars ] || ./scripts/feeds feed_config > tmp/.config-feeds.in
        ./scripts/package-metadata.pl mk tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
        ./scripts/package-metadata.pl pkgaux tmp/.packageinfo > tmp/.packageauxvars || { rm -f tmp/.packageauxvars; false; }
+       ./scripts/package-metadata.pl usergroup tmp/.packageinfo > tmp/.packageusergroup || { rm -f tmp/.packageusergroup; false; }
        touch $(TOPDIR)/tmp/.build
 
 .config: ./scripts/config/conf $(if $(CONFIG_HAVE_DOT_CONFIG),,prepare-tmpinfo)
@@ -169,6 +176,7 @@ kernel_oldconfig: prepare_kernel_conf
 ifneq ($(DISTRO_PKG_CONFIG),)
 kernel_menuconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
 kernel_nconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
+kernel_xconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
 endif
 kernel_menuconfig: prepare_kernel_conf
        $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux menuconfig
@@ -176,6 +184,9 @@ kernel_menuconfig: prepare_kernel_conf
 kernel_nconfig: prepare_kernel_conf
        $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux nconfig
 
+kernel_xconfig: prepare_kernel_conf
+       $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux xconfig
+
 staging_dir/host/.prereq-build: include/prereq-build.mk
        mkdir -p tmp
        @$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
@@ -256,9 +267,9 @@ package/symlinks-clean:
        ./scripts/feeds uninstall -a
 
 help:
-       cat README
+       cat README.md
 
-distclean:
+distclean: cacheclean
        rm -rf bin build_dir .config* dl feeds key-build* logs package/feeds package/openwrt-packages staging_dir tmp
        @$(_SINGLE)$(SUBMAKE) -C scripts/config clean