diff mbox

kbuild: Don't reset timestamps in include/generated if not needed

Message ID 1427211364-20352-1-git-send-email-mmarek@suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Marek March 24, 2015, 3:36 p.m. UTC
Use filechk to generate asm-offsets.h and bounds.h.

Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 Kbuild | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Valdis Klētnieks March 24, 2015, 4:08 p.m. UTC | #1
On Tue, 24 Mar 2015 16:36:04 +0100, Michal Marek said:
> Use filechk to generate asm-offsets.h and bounds.h.
>
> Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
>  Kbuild | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)

Different from my patch, but that's OK.  Feel free to stick an Acked-By:
on there. :)
diff mbox

Patch

diff --git a/Kbuild b/Kbuild
index ab8ded9..96d0629 100644
--- a/Kbuild
+++ b/Kbuild
@@ -13,8 +13,9 @@  define sed-y
 	s:->::; p;}"
 endef
 
-quiet_cmd_offsets = GEN     $@
-define cmd_offsets
+# Use filechk to avoid rebuilds when a header changes, but the resulting file
+# does not
+define filechk_offsets
 	(set -e; \
 	 echo "#ifndef $2"; \
 	 echo "#define $2"; \
@@ -24,9 +25,9 @@  define cmd_offsets
 	 echo " * This file was generated by Kbuild"; \
 	 echo " */"; \
 	 echo ""; \
-	 sed -ne $(sed-y) $<; \
+	 sed -ne $(sed-y); \
 	 echo ""; \
-	 echo "#endif" ) > $@
+	 echo "#endif" )
 endef
 
 #####
@@ -42,9 +43,8 @@  kernel/bounds.s: kernel/bounds.c FORCE
 	$(Q)mkdir -p $(dir $@)
 	$(call if_changed_dep,cc_s_c)
 
-$(obj)/$(bounds-file): kernel/bounds.s Kbuild
-	$(Q)mkdir -p $(dir $@)
-	$(call cmd,offsets,__LINUX_BOUNDS_H__)
+$(obj)/$(bounds-file): kernel/bounds.s FORCE
+	$(call filechk,offsets,__LINUX_BOUNDS_H__)
 
 #####
 # 2) Generate asm-offsets.h
@@ -62,8 +62,8 @@  arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
 	$(Q)mkdir -p $(dir $@)
 	$(call if_changed_dep,cc_s_c)
 
-$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild
-	$(call cmd,offsets,__ASM_OFFSETS_H__)
+$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
+	$(call filechk,offsets,__ASM_OFFSETS_H__)
 
 #####
 # 3) Check for missing system calls