kbuild: Do not overwrite include/config/kernel.release needlessly
authorMichal Marek <mmarek@suse.cz>
Thu, 11 Jul 2013 13:34:51 +0000 (15:34 +0200)
committerMichal Marek <mmarek@suse.cz>
Wed, 28 Aug 2013 15:09:54 +0000 (17:09 +0200)
Use filechk to detect if the content changed or not.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Makefile

index 9262ba8da4f9859e8cd86e340fb3c159ce261e7e..cf897763d98e52464fe48c6266fd5009f79d07b3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -794,10 +794,13 @@ PHONY += $(vmlinux-dirs)
 $(vmlinux-dirs): prepare scripts
        $(Q)$(MAKE) $(build)=$@
 
+define filechk_kernel.release
+       echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
+endef
+
 # Store (new) KERNELRELEASE string in include/config/kernel.release
 include/config/kernel.release: include/config/auto.conf FORCE
-       $(Q)rm -f $@
-       $(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" > $@
+       $(call filechk,kernel.release)
 
 
 # Things we need to do before we recursively start building the kernel