[U-Boot] [PATCH 3/5] kbuild: use $(call cmd, ) rather than $(call if_changed, ) where possible

Stephen Warren swarren at wwwdotorg.org
Wed Feb 3 16:57:45 CET 2016


On 02/03/2016 05:05 AM, Masahiro Yamada wrote:
> These build commands are constant (mostly, just concatenating images,
> or just copying).  No need to use $(call if_changed,...) for them.

I disagree, since I believe this change means that if someone /does/ 
change the command in the future (e.g. to replace it with more complex 
processing, or add additional dependencies), then the Makefile will/may 
not automatically rebuild those targets, which is the entire point of 
using if_changed, and is a huge benefit of using Kbuild.

In my opinion, every rule should use if_changed, and contain a single 
command at the Makefile level; i.e. I noticed the following somewhere, 
which also doesn't rebuild the target in all cases if the commands are 
changed, which is bad:

target: sources FORCE
     $(call if_changed,xxx)
     something_else
     yet_more_cmds

If "something_else" or "yet_more_cmds" are edited, the target won't get 
rebuilt unless some other modification causes it to be.


More information about the U-Boot mailing list