qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] trace: add make dependencies on tracetool s


From: Lluís Vilanova
Subject: Re: [Qemu-devel] [PATCH 2/2] trace: add make dependencies on tracetool source
Date: Thu, 29 Oct 2015 16:28:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Stefan Hajnoczi writes:

> Patches that change tracetool can break the build if old build output
> files are lying around.

> This happens because the Makefile does not specify dependencies on
> tracetool.  The build will use old object files that do not match the
> current source code.

> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  trace/Makefile.objs | 32 +++++++++++++++++++++-----------
>  1 file changed, 21 insertions(+), 11 deletions(-)

> diff --git a/trace/Makefile.objs b/trace/Makefile.objs
> index 73bec38..ed2ca38 100644
> --- a/trace/Makefile.objs
> +++ b/trace/Makefile.objs
> @@ -1,12 +1,22 @@
>  # -*- mode: makefile -*-
 
>  ######################################################################
> +# tracetool source files
> +# Every rule that invokes tracetool must depend on this so code is 
> regenerated
> +# if tracetool itself changes.
> +
> +tracetool-y = $(SRC_PATH)/scripts/tracetool.py
> +tracetool-y += $(SRC_PATH)/scripts/tracetool/*.py
> +tracetool-y += $(SRC_PATH)/scripts/tracetool/backend/*.py
> +tracetool-y += $(SRC_PATH)/scripts/tracetool/format/*.py

If 'find' is an acceptable build dependency, I'd rather use this to avoid
missing future sub-directories:

  tracetool-y = $(SRC_PATH)/scripts/tracetool.py
  tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -path "*.py")

If that's not acceptable, I'd suggest forcing expansion in case the variable is
used somewhere else in the future (besides targets, which are always expanded):

  tracetool-y = $(SRC_PATH)/scripts/tracetool.py
  tracetool-y += $(wildcard $(SRC_PATH)/scripts/tracetool/*.py)
  tracetool-y += $(wildcard $(SRC_PATH)/scripts/tracetool/backend/*.py)
  tracetool-y += $(wildcard $(SRC_PATH)/scripts/tracetool/format/*.py)

BTW, this was a much needed fix. I ran into problems with this and never even
thought about fixing it :)


Thanks,
  Lluis

-- 
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth



reply via email to

[Prev in Thread] Current Thread [Next in Thread]