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

Re: [Xen-devel] [XEN PATCH v3 16/23] xen/build: introduce if_changed and if_changed_rule



On 26.02.2020 12:33, Anthony PERARD wrote:
> The if_changed macro from Linux can record the command used to build a
> target then compare it on rebuild. Thus if a command has changed, for
> example due to introducing new flags in CFLAGS or due to using a
> different compiler, the target will be rebuilt.

As to using a different compiler - I suppose this means "a compiler
with a different executable name" here? What about me having, say
gcc-5 in use, and then updating my system such that a 5.2 based
compiler of this name would be upgraded to a 5.4 based one of this
same name. If this newer compiler has better capabilities (that we
would want to use if available), would this or anything else trigger
a rebuild then too?

> --- a/.gitignore
> +++ b/.gitignore
> @@ -6,6 +6,7 @@
>  *.o
>  *.d
>  *.d2
> +.*.cmd
>  *.opic
>  *.a
>  *.so

I admit these entries aren't sorted very well, but anyway - how
did you end up with this insertion point? There are entries
starting with . at the very top of the file. (As an aside, I
wonder why it's *.d and *.d2 rather than .*.d and .*.d2 .)

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -52,7 +52,57 @@ dist: install
>  
>  ifeq ($(root-make-done),)
>  # section to run before calling Rules.mk, but only once.
> +
> +# Beautify output
> +# ---------------------------------------------------------------------------
> +#
> +# Normally, we echo the whole command before executing it. By making
> +# that echo $($(quiet)$(cmd)), we now have the possibility to set
> +# $(quiet) to choose other forms of output instead, e.g.
> +#
> +#         quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
> +#         cmd_cc_o_c       = $(CC) $(c_flags) -c -o $@ $<
> +#
> +# If $(quiet) is empty, the whole command will be printed.
> +# If it is set to "quiet_", only the short version will be printed.
> +# If it is set to "silent_", nothing will be printed at all, since
> +# the variable $(silent_cmd_cc_o_c) doesn't exist.
> +#
> +# A simple variant is to prefix commands with $(Q) - that's useful
> +# for commands that shall be hidden in non-verbose mode.
>  #
> +#    $(Q)ln $@ :<
> +#
> +# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
> +# If KBUILD_VERBOSE equals 1 then the above command is displayed.
> +#
> +# To put more focus on warnings, be less verbose as default
> +# Use 'make V=1' to see the full commands
> +
> +ifeq ("$(origin V)", "command line")
> +  KBUILD_VERBOSE = $(V)
> +endif
> +ifndef KBUILD_VERBOSE
> +  KBUILD_VERBOSE = 0
> +endif
> +
> +ifeq ($(KBUILD_VERBOSE),1)
> +  quiet =
> +  Q =
> +else
> +  quiet=quiet_
> +  Q = @
> +endif
> +
> +# If the user is running make -s (silent mode), suppress echoing of
> +# commands
> +
> +ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
> +  quiet=silent_
> +endif

Throughout the above, can the uses of = please become consistent?
Preferable all with a blank on the left and - unless there's no
value getting assigned - one on the right, plus := preferred over
= where not prohibited by other constraints (none here afaics).

> --- a/xen/scripts/Kbuild.include
> +++ b/xen/scripts/Kbuild.include
> @@ -2,11 +2,30 @@
>  ####
>  # kbuild: Generic definitions
>  
> +# Convenient variables
> +squote  := '
> +empty   :=
> +space   := $(empty) $(empty)
> +space_escape := _-_SPACE_-_
> +pound := \#

Nit: To fit with the three ones above space_escape you want to
add two blanks here.

Jan

_______________________________________________
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®.