aboutsummaryrefslogtreecommitdiff
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 468fbc9016c..d21f0eac2e5 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -153,12 +153,18 @@ $(obj)/%.i: $(src)/%.c FORCE
quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
cmd_cc_symtypes_c = \
+ set -e; \
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
- | $(GENKSYMS) -T $@ >/dev/null; \
+ | $(GENKSYMS) -T $@ \
+ -r $(firstword $(wildcard \
+ $(@:.symtypes=.symref) /dev/null)) \
+ $(if $(KBUILD_PRESERVE),-p) \
+ -a $(ARCH) \
+ >/dev/null; \
test -s $@ || rm -f $@
$(obj)/%.symtypes : $(src)/%.c FORCE
- $(call if_changed_dep,cc_symtypes_c)
+ $(call cmd,cc_symtypes_c)
# C (.c) files
# The C file is compiled and updated dependency information is generated.
@@ -187,7 +193,11 @@ cmd_modversions = \
if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
| $(GENKSYMS) $(if $(KBUILD_SYMTYPES), \
- -T $(@D)/$(@F:.o=.symtypes)) -a $(ARCH) \
+ -T $(@:.o=.symtypes)) \
+ -r $(firstword $(wildcard \
+ $(@:.o=.symref) /dev/null)) \
+ $(if $(KBUILD_PRESERVE),-p) \
+ -a $(ARCH) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \