On 24.08.2021 12:50, Anthony PERARD wrote:
> 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.
> 
> This imports fixdep.c and if_changed_deps macro from Linux v5.12.
> 
> Signed-off-by: Anthony PERARD <anthony.per...@citrix.com>

Reviewed-by: Jan Beulich <jbeul...@suse.com>
with a question:

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -187,6 +187,13 @@ endif
>  export root-make-done := y
>  endif # root-make-done
>  
> +# ===========================================================================
> +# Rules shared between *config targets and build targets
> +
> +PHONY += tools_fixdep
> +tools_fixdep:
> +     $(MAKE) -C tools fixdep
> +
>  # Shorthand for kconfig
>  kconfig = -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) 
> SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)"
>  
> @@ -400,7 +407,7 @@ $(TARGET).gz: $(TARGET)
>       gzip -n -f -9 < $< > $@.new
>       mv $@.new $@
>  
> -$(TARGET): FORCE
> +$(TARGET): tools_fixdep FORCE
>       $(MAKE) -C tools

Shouldn't this include building fixdep, in which case the extra dependency
here is unnecessary? I can see that it's needed ...

> @@ -457,13 +464,13 @@ cscope:
>  _MAP:
>       $(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] 
> \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
>  
> -%.o %.i %.s: %.c FORCE
> +%.o %.i %.s: %.c tools_fixdep FORCE
>       $(MAKE) $(build)=$(*D) $(*D)/$(@F)

... in cases like this one.

Jan


Reply via email to