Received: from eggs.gnu.org ([2001:4830:134:3::10]:43897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrp8K-0002JT-7H for qemu-devel@nongnu.org; Thu, 29 Oct 2015 11:28:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zrp8G-0008Cp-0a for qemu-devel@nongnu.org; Thu, 29 Oct 2015 11:28:56 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:60884 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrp8F-0008CQ-LL for qemu-devel@nongnu.org; Thu, 29 Oct 2015 11:28:51 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <1446044363-29340-1-git-send-email-stefanha@redhat.com> <1446044363-29340-3-git-send-email-stefanha@redhat.com> Date: Thu, 29 Oct 2015 16:28:49 +0100 In-Reply-To: <1446044363-29340-3-git-send-email-stefanha@redhat.com> (Stefan Hajnoczi's message of "Wed, 28 Oct 2015 14:59:23 +0000") Message-ID: <87k2q5ithq.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 2/2] trace: add make dependencies on tracetool source List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Markus Armbruster 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 > --- > 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