diff options
author | Michal Marek <mmarek@suse.cz> | 2015-03-11 06:01:01 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2015-03-24 12:37:25 -0400 |
commit | 70a4fd6c56d0f581a63dffd8c31d180e96ecf6a6 (patch) | |
tree | 1a1640ae201a1d8faa2fd740a027cc8d699c28fe /Kbuild | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
kbuild: Don't reset timestamps in include/generated if not needed
Use filechk to generate asm-offsets.h and bounds.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>
Diffstat (limited to 'Kbuild')
-rw-r--r-- | Kbuild | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -13,8 +13,9 @@ define sed-y | |||
13 | s:->::; p;}" | 13 | s:->::; p;}" |
14 | endef | 14 | endef |
15 | 15 | ||
16 | quiet_cmd_offsets = GEN $@ | 16 | # Use filechk to avoid rebuilds when a header changes, but the resulting file |
17 | define cmd_offsets | 17 | # does not |
18 | define filechk_offsets | ||
18 | (set -e; \ | 19 | (set -e; \ |
19 | echo "#ifndef $2"; \ | 20 | echo "#ifndef $2"; \ |
20 | echo "#define $2"; \ | 21 | echo "#define $2"; \ |
@@ -24,9 +25,9 @@ define cmd_offsets | |||
24 | echo " * This file was generated by Kbuild"; \ | 25 | echo " * This file was generated by Kbuild"; \ |
25 | echo " */"; \ | 26 | echo " */"; \ |
26 | echo ""; \ | 27 | echo ""; \ |
27 | sed -ne $(sed-y) $<; \ | 28 | sed -ne $(sed-y); \ |
28 | echo ""; \ | 29 | echo ""; \ |
29 | echo "#endif" ) > $@ | 30 | echo "#endif" ) |
30 | endef | 31 | endef |
31 | 32 | ||
32 | ##### | 33 | ##### |
@@ -42,9 +43,8 @@ kernel/bounds.s: kernel/bounds.c FORCE | |||
42 | $(Q)mkdir -p $(dir $@) | 43 | $(Q)mkdir -p $(dir $@) |
43 | $(call if_changed_dep,cc_s_c) | 44 | $(call if_changed_dep,cc_s_c) |
44 | 45 | ||
45 | $(obj)/$(bounds-file): kernel/bounds.s Kbuild | 46 | $(obj)/$(bounds-file): kernel/bounds.s FORCE |
46 | $(Q)mkdir -p $(dir $@) | 47 | $(call filechk,offsets,__LINUX_BOUNDS_H__) |
47 | $(call cmd,offsets,__LINUX_BOUNDS_H__) | ||
48 | 48 | ||
49 | ##### | 49 | ##### |
50 | # 2) Generate asm-offsets.h | 50 | # 2) Generate asm-offsets.h |
@@ -62,8 +62,8 @@ arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ | |||
62 | $(Q)mkdir -p $(dir $@) | 62 | $(Q)mkdir -p $(dir $@) |
63 | $(call if_changed_dep,cc_s_c) | 63 | $(call if_changed_dep,cc_s_c) |
64 | 64 | ||
65 | $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild | 65 | $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE |
66 | $(call cmd,offsets,__ASM_OFFSETS_H__) | 66 | $(call filechk,offsets,__ASM_OFFSETS_H__) |
67 | 67 | ||
68 | ##### | 68 | ##### |
69 | # 3) Check for missing system calls | 69 | # 3) Check for missing system calls |