linux/Documentation
Dirk Gouders bb81955fd4 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>
2018-07-21 06:50:32 +09:00
..
2018-06-11 17:57:38 -07:00
2018-04-09 11:42:31 -07:00
2018-04-11 10:28:39 -07:00
2018-06-08 11:59:51 -04:00
2018-06-15 18:11:26 -03:00
2018-06-10 13:01:12 -07:00
2018-02-21 09:57:55 +01:00
2018-03-06 17:26:15 +01:00
2018-03-26 12:13:21 -04:00
2018-03-01 17:32:14 +01:00
2018-05-29 08:59:21 -06:00
2018-06-06 09:08:38 -07:00
2018-03-26 15:57:04 +02:00
2017-12-16 22:37:12 -08:00
2018-06-15 18:10:01 -03:00
2018-05-08 09:16:41 -06:00