build: align SOURCE path for build system and SDK
[openwrt/openwrt.git] / include / kernel-build.mk
index cc651f29b112a8b2232dd6f9dfaffb1ab3055e4f..c42dae0049ba4f010c9833212074576f190afffe 100644 (file)
@@ -10,7 +10,7 @@ ifneq ($(DUMP),1)
 endif
 
 KERNEL_FILE_DEPENDS=$(GENERIC_BACKPORT_DIR) $(GENERIC_PATCH_DIR) $(GENERIC_HACK_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR)
-STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,$(KERNEL_FILE_DEPENDS),)))
+STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),$(KERNEL_FILE_DEPENDS),)))
 STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
 include $(INCLUDE_DIR)/download.mk
 include $(INCLUDE_DIR)/quilt.mk
@@ -63,7 +63,7 @@ ifdef CONFIG_COLLECT_KERNEL_DEBUG
        mkdir -p $(KERNEL_BUILD_DIR)/debug/modules
        $(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/debug/
        -$(CP) \
-               $(STAGING_DIR_ROOT)/lib/modules/$(LINUX_VERSION)/* \
+               $(STAGING_DIR_ROOT)/lib/modules/$(LINUX_VERSION)/*.ko \
                $(KERNEL_BUILD_DIR)/debug/modules/
        $(FIND) $(KERNEL_BUILD_DIR)/debug -type f | $(XARGS) $(KERNEL_CROSS)strip --only-keep-debug
        $(TAR) c -C $(KERNEL_BUILD_DIR) debug \
@@ -156,6 +156,10 @@ define BuildKernel
   compile: $(LINUX_DIR)/.modules
        $(MAKE) -C image compile TARGET_BUILD=
 
+  dtb: $(STAMP_CONFIGURED)
+       $(_SINGLE)$(KERNEL_MAKE) scripts_dtc
+       $(MAKE) -C image compile-dtb TARGET_BUILD=
+
   oldconfig menuconfig nconfig xconfig: $(STAMP_PREPARED) $(STAMP_CHECKED) FORCE
        rm -f $(LINUX_DIR)/.config.prev
        rm -f $(STAMP_CONFIGURED)