add autorebuild check for menuconfig
[openwrt-10.03/.git] / include / target.mk
index 8f072d0cd86de99bbc6bdca509a82d7fd6329cbd..9ee369d9b123ee31c508e8f77fc8cecb392d942d 100644 (file)
@@ -1,4 +1,4 @@
-# 
+#
 # Copyright (C) 2007 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
@@ -75,9 +75,23 @@ define Profile
   endif
 endef
 
--include $(PLATFORM_DIR)/profiles/*.mk
 ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR))
-  -include $(PLATFORM_SUBDIR)/profiles/*.mk
+  define IncludeProfiles
+    -include $(PLATFORM_DIR)/profiles/*.mk
+    -include $(PLATFORM_SUBDIR)/profiles/*.mk
+  endef
+else
+  define IncludeProfiles
+    -include $(PLATFORM_DIR)/profiles/*.mk
+  endef
+endif
+
+ifeq ($(TARGET_BUILD),1)
+  $(eval $(call IncludeProfiles))
+else
+  ifeq ($(DUMP),)
+    $(eval $(call IncludeProfiles))
+  endif
 endif
 
 $(eval $(call shexport,Target/Description))
@@ -87,7 +101,7 @@ include $(INCLUDE_DIR)/kernel-version.mk
 GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic-$(KERNEL)
 GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/patches$(shell [ -d "$(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true )
 
-GENERIC_LINUX_CONFIG:=$(firstword $(wildcard $(GENERIC_PLATFORM_DIR)/config-$(KERNEL_PATCHVER) $(GENERIC_PLATFORM_DIR)/config-default))
+GENERIC_LINUX_CONFIG?=$(firstword $(wildcard $(GENERIC_PLATFORM_DIR)/config-$(KERNEL_PATCHVER) $(GENERIC_PLATFORM_DIR)/config-default))
 LINUX_CONFIG?=$(firstword $(wildcard $(foreach subdir,$(PLATFORM_DIR) $(PLATFORM_SUBDIR),$(subdir)/config-$(KERNEL_PATCHVER) $(subdir)/config-default)))
 LINUX_SUBCONFIG?=$(firstword $(wildcard $(PLATFORM_SUBDIR)/config-$(KERNEL_PATCHVER) $(PLATFORM_SUBDIR)/config-default))
 ifeq ($(LINUX_CONFIG),$(LINUX_SUBCONFIG))
@@ -136,6 +150,7 @@ define BuildTargets/DumpCurrent
         echo 'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'; \
         echo 'Target-Arch: $(ARCH)'; \
         echo 'Target-Features: $(FEATURES)'; \
+        echo 'Target-Depends: $(DEPENDS)'; \
         echo 'Linux-Version: $(LINUX_VERSION)'; \
         echo 'Linux-Release: $(LINUX_RELEASE)'; \
         echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \