build: introduce if_changed_deps
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 25 Feb 2022 10:01:51 +0000 (11:01 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Feb 2022 10:01:51 +0000 (11:01 +0100)
commit06ef696c85a7b170a91527a0f1c94f49cb3a2bd2
tree86678517edd0b403382f6aa0590d50cc751f26eb
parent7a3bcd2babcc7d9952bcf174f3705ebd9290671a
build: introduce if_changed_deps

This macro does compare command line like if_changed, but it also
rewrite the dependencies generated by $(CC) in order to depend on a
CONFIG_* as generated by kconfig instead of depending on autoconf.h.
This allow to make a change in kconfig options and only rebuild the
object that uses that CONFIG_* option.

cmd_and_record isn't needed anymore as it is replace by
cmd_and_fixdep.

There's only one .*.d dependency file left which is explicitly
included as a workound, all the other are been absorb into the .*.cmd
dependency files via `fixdep`. So including .*.d can be removed from
the makefile.

Also adjust "cloc" recipe due to .*.d been replace by .*.cmd files.

This imports fixdep.c and if_changed_deps macro from Linux v5.12.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
.gitignore
xen/Makefile
xen/Rules.mk
xen/arch/x86/Makefile
xen/build.mk
xen/scripts/Kbuild.include
xen/tools/Makefile
xen/tools/fixdep.c [new file with mode: 0644]