diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2016-02-17 21:50:06 +0100 |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2016-03-29 22:30:56 +0200 |
commit | e4aca45950050fc584e036bb1b266ce1264a6daf (patch) | |
tree | a915e80b0f5b6e5c8f71600b5d9258cf17d9a920 /scripts/Kbuild.include | |
parent | fixdep: accept extra dependencies on stdin (diff) | |
download | linux-e4aca45950050fc584e036bb1b266ce1264a6daf.tar.xz linux-e4aca45950050fc584e036bb1b266ce1264a6daf.zip |
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/Kbuild.include')
-rw-r--r-- | scripts/Kbuild.include | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index b2ab2a92a375..80ca538bfba9 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -256,10 +256,13 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # Execute the command and also postprocess generated .d dependencies file. if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ @set -e; \ + $(cmd_and_fixdep), @:) + +cmd_and_fixdep = \ $(echo-cmd) $(cmd_$(1)); \ scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\ rm -f $(depfile); \ - mv -f $(dot-target).tmp $(dot-target).cmd, @:) + mv -f $(dot-target).tmp $(dot-target).cmd; # Usage: $(call if_changed_rule,foo) # Will check if $(cmd_foo) or any of the prerequisites changed, |