diff options
author | Michal Marek <mmarek@suse.cz> | 2015-03-27 01:59:03 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-03-28 13:03:09 (GMT) |
commit | 3a4f6b60db1b3fd43ca0449f9259ebdf4f5d4b62 (patch) | |
tree | 4ff2560df7f606111cd9f3195248a2b9df9cca4a | |
parent | d99cd32f05597f18fa1691404e112827972a8868 (diff) | |
download | u-boot-3a4f6b60db1b3fd43ca0449f9259ebdf4f5d4b62.tar.xz |
kbuild: Don't reset timestamps in include/generated if not needed
Use filechk to generate asm-offsets.h and generic-asm-offsets.h.
Based on a patch by Valdis Kletnieks.
Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Acked-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
[ imported from Linux Kernel, commit 70a4fd6c56d0,
with adjustment for U-Boot ]
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | Kbuild | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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 @@ lib/asm-offsets.s: lib/asm-offsets.c FORCE $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cc_s_c) -$(obj)/$(generic-offsets-file): lib/asm-offsets.s Kbuild - $(Q)mkdir -p $(dir $@) - $(call cmd,offsets,__GENERIC_ASM_OFFSETS_H__) +$(obj)/$(generic-offsets-file): lib/asm-offsets.s FORCE + $(call filechk,offsets,__GENERIC_ASM_OFFSETS_H__) ##### # 2) Generate asm-offsets.h @@ -65,5 +65,5 @@ arch/$(ARCH)/lib/asm-offsets.s: arch/$(ARCH)/lib/asm-offsets.c FORCE $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cc_s_c) -$(obj)/$(offsets-file): arch/$(ARCH)/lib/asm-offsets.s Kbuild - $(call cmd,offsets,__ASM_OFFSETS_H__) +$(obj)/$(offsets-file): arch/$(ARCH)/lib/asm-offsets.s FORCE + $(call filechk,offsets,__ASM_OFFSETS_H__) |