[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v7 27/51] build: introduce if_changed_deps


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 11 Oct 2021 16:20:36 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sKjsAzvkK3m98dcMYZdfJ+I4/nNBXGKaM3Yto11X+Hg=; b=SuciyaoSMGlGIfot3WAA9tzgg6Qnqj4IW3HCWM3igecMIA5ww4W8slmyi8WVsONxZXtzOG0z3PlwccgJNHk861butY1Jm6coW3wvOFHN1JofY9WSvN8UUULQDhc053MYB/a0u80/SnH77ROgYFQX8oRue/RGlducOm2h0AOw29Yt23J0TdSNprL9B3I9qINEURmpXo1ti10Q60J3Rv9MOYFlJ7MmO2JIhqi2MJiXCIiEOi5TZo2WD9C6i3wU8y7mvEw/LxuAZzyUYlwB6p5m0REivFr3v2LYbPGgU0uzhBeJul3hpPyI65uEeFQXh5xdzB+v7QEs4rlgymPfcZLTmg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lMaXYitKugqM6uTU16il3hIE/Q6qiUbFnlPUGHMo7mwfOdCAFBno3vWksJbwTiitfMUtlGxv5HVNiF4hLRvoPFytHUtV3O9AJDxRmQUMcB+keljUoPYs/scYjQcjuAY/RgQ/zyaoGosWMRr848ki1Ob8nYBWhCe2uV87yjMvTEy37ZyUSRPh4LcfiAUKu+7Q+25PPsYh/uQQYuYhaqbnXK6Z9yMDsZyKntiZ6D33naJcWybEBmf3LqawTWq8AjWKtp/EhEYgA5rxqXNVsQPTH1YPm3+tvQFgPpZhZTKilZX4QE5cwX0zdZWW5JePRC7t+ayVtjf7GDBuOwXi7EvtNw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 11 Oct 2021 14:20:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.perard@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.