summaryrefslogtreecommitdiff
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2016-02-17 23:50:06 +0300
committerNicolas Pitre <nicolas.pitre@linaro.org>2016-03-29 23:30:56 +0300
commite4aca45950050fc584e036bb1b266ce1264a6daf (patch)
treea915e80b0f5b6e5c8f71600b5d9258cf17d9a920 /scripts/Makefile.build
parentd8329e35cc08e07a3250b3873325d300c1e91c81 (diff)
downloadlinux-e4aca45950050fc584e036bb1b266ce1264a6daf.tar.xz
kbuild: de-duplicate fixdep usage
The generation and postprocessing of automatic dependency rules is duplicated in rule_cc_o_c, rule_as_o_S and if_changed_dep. Since this is not a trivial one-liner action, it is now abstracted under cmd_and_fixdep to simplify things and make future changes in this area easier. In the rule_cc_o_c and rule_as_o_S cases that means the order of some commands has been altered, namely fixdep and related file manipulations are executed earlier, but they didn't depend on those commands that now execute later. Signed-off-by: Nicolas Pitre <nico@linaro.org>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build19
1 files changed, 5 insertions, 14 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 74556e5e4ec0..12821d9eae85 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -266,24 +266,15 @@ endif # CONFIG_STACK_VALIDATION
define rule_cc_o_c
$(call echo-cmd,checksrc) $(cmd_checksrc) \
- $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
+ $(call cmd_and_fixdep,cc_o_c) \
$(cmd_modversions) \
- $(cmd_objtool) \
- $(call echo-cmd,record_mcount) \
- $(cmd_record_mcount) \
- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
- $(dot-target).tmp; \
- rm -f $(depfile); \
- mv -f $(dot-target).tmp $(dot-target).cmd
+ $(cmd_objtool) \
+ $(call echo-cmd,record_mcount) $(cmd_record_mcount)
endef
define rule_as_o_S
- $(call echo-cmd,as_o_S) $(cmd_as_o_S); \
- $(cmd_objtool) \
- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,as_o_S)' > \
- $(dot-target).tmp; \
- rm -f $(depfile); \
- mv -f $(dot-target).tmp $(dot-target).cmd
+ $(call cmd_and_fixdep,as_o_S) \
+ $(cmd_objtool)
endef
# List module undefined symbols (or empty line if not enabled)