build: fix symlinked .config handling
[openwrt/openwrt.git] / include / toplevel.mk
index f31884d3fe3050913869ea36a3c7d4f27abe7b5a..c90670bee62ee7912a1c08c2f582e6b0a074ceca 100644 (file)
@@ -67,7 +67,7 @@ SUBMAKE:=umask 022; $(SUBMAKE)
 
 ULIMIT_FIX=_limit=`ulimit -n`; [ "$$_limit" = "unlimited" -o "$$_limit" -ge 1024 ] || ulimit -n 1024;
 
-prepare-mk: FORCE ;
+prepare-mk: staging_dir/host/.prereq-build FORCE ;
 
 ifdef SDK
   IGNORE_PACKAGES = linux
@@ -126,7 +126,7 @@ menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
        if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
                cp $(HOME)/.openwrt/defconfig .config; \
        fi
-       $< Config.in
+       [ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; $< Config.in
 
 prepare_kernel_conf: .config FORCE
 
@@ -179,6 +179,9 @@ clean dirclean: .config
 prereq:: prepare-tmpinfo .config
        @+$(NO_TRACE_MAKE) -r -s $@
 
+check: .config FORCE
+       @+$(NO_TRACE_MAKE) -r -s $@ QUIET= V=s
+
 WARN_PARALLEL_ERROR = $(if $(BUILD_LOG),,$(and $(filter -j,$(MAKEFLAGS)),$(findstring s,$(OPENWRT_VERBOSE))))
 
 ifeq ($(SDK),1)