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

Re: [Xen-devel] [XEN PATCH v3 17/23] xen/build: Start using if_changed



On Wed, Feb 26, 2020 at 11:33:49AM +0000, Anthony PERARD wrote:
> This patch start to use if_changed introduced in a previous commit.
> 
> Whenever if_changed is called, the target must have FORCE as
> dependency so that if_changed can check if the command line to be
> run as changed, so the macro $(real-prereqs) must be use to
      ^ has                                            ^ used
> discover the dependencies without "FORCE".
> 
> Whenever a target isn't in obj-y, it should be added to extra-y so the
> .*.cmd dependency file associated with the target can be loaded. This
> is done for xsm/flask/ and both common/lib{elf,fdt}/ and
> arch/x86/Makefile.
> 
> For the targets that generates .*.d dependency files, there's going to
                       ^ generate
> be two dependency files (.*.d and .*.cmd) until we can merge them
> together in a later patch via fixdep from Linux.
> 
> One cleanup, libelf-relocate.o doesn't exist anymore.
> 
> We import cmd_ld and cmd_objcopy from Linux v5.4.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> ---
>  xen/Rules.mk               | 68 +++++++++++++++++++++++++++-----------
>  xen/arch/arm/Makefile      |  4 +--
>  xen/arch/x86/Makefile      |  1 +
>  xen/arch/x86/efi/Makefile  |  7 ++--
>  xen/common/libelf/Makefile | 12 ++++---
>  xen/common/libfdt/Makefile |  9 +++--
>  xen/xsm/flask/Makefile     | 17 +++++++---
>  7 files changed, 84 insertions(+), 34 deletions(-)
> 
> diff --git a/xen/Rules.mk b/xen/Rules.mk
> index 8807a2e21c94..bb4ced5f0dd4 100644
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -52,6 +52,18 @@ SPECIAL_DATA_SECTIONS := rodata $(foreach a,1 2 4 8 16, \
>  
>  include Makefile
>  
> +# Linking
> +# ---------------------------------------------------------------------------

I'm not sure adding such delimiters is helpful, people tend to forget
to add them in newer changes and it ends up being all asymmetric.

> +
> +quiet_cmd_ld = LD      $@
> +cmd_ld = $(LD) $(XEN_LDFLAGS) -r -o $@ $(real-prereqs)
> +
> +# Objcopy
> +# ---------------------------------------------------------------------------
> +
> +quiet_cmd_objcopy = OBJCOPY $@
> +cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $< $@
> +
>  define gendep
>      ifneq ($(1),$(subst /,:,$(1)))
>          DEPS += $(dir $(1)).$(notdir $(1)).d
> @@ -161,29 +173,47 @@ else
>       $(CC) $(c_flags) -c $< -o $@
>  endif
>  
> -%.o: %.S Makefile
> -     $(CC) $(a_flags) -c $< -o $@
> +quiet_cmd_cc_o_S = CC      $@
> +cmd_cc_o_S = $(CC) $(a_flags) -c $< -o $@
> +
> +%.o: %.S FORCE
> +     $(call if_changed,cc_o_S)
> +
> +
> +quiet_cmd_obj_init_o = INIT_O  $@

INIT_O seems kind of weird, maybe just using CHECK would be OK?

The rest LGTM:

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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