diff options
author | Dirk Gouders <dirk@gouders.net> | 2018-07-18 11:13:36 +0200 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-07-21 06:50:32 +0900 |
commit | bb81955fd4a49fffdd86d50afd0c1f2eea044c05 (patch) | |
tree | 1498493d163bdb67b59538c82b1275e78a467683 /arch | |
parent | 0df57d90bfd6bb94831e70f4bcb4b7af784066cf (diff) | |
download | linux-bb81955fd4a49fffdd86d50afd0c1f2eea044c05.tar.gz linux-bb81955fd4a49fffdd86d50afd0c1f2eea044c05.tar.bz2 linux-bb81955fd4a49fffdd86d50afd0c1f2eea044c05.zip |
kbuild: if_changed: document single use per target limitation
Users of if_changed could easily feel invited to use it to divide a
recipe into parts like:
a: prereq FORCE
$(call if_changed,do_a)
$(call if_changed,do_b)
But this is problematic, because if_changed should not be used more
than once per target: in the above example, if_changed stores the
command-line of the given command in .a.cmd and when a is up-to-date
with respect to prereq, the file .a.cmd contains the command-line for
the last command executed, i.e. do_b.
When the recipe is then executed again, without any change of
prerequisites, the command-line check for do_a will fail, do_a will be
executed and stored in .a.cmd. The next check, however, will still see
the old content (the file isn't re-read) and if_changed will skip
do_b, because the command-line test will not recognize a change. On
the next execution of the recipe the roles will flip: do_a is OK but
do_b not and it will be executed. And so on...
Signed-off-by: Dirk Gouders <dirk@gouders.net>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions