From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4EcE-0000DE-0p for qemu-devel@nongnu.org; Sun, 04 Mar 2012 11:48:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4EcC-0001cQ-64 for qemu-devel@nongnu.org; Sun, 04 Mar 2012 11:48:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4EcB-0001bn-Ua for qemu-devel@nongnu.org; Sun, 04 Mar 2012 11:48:56 -0500 Date: Sun, 4 Mar 2012 18:49:03 +0200 From: "Michael S. Tsirkin" Message-ID: <20120304164902.GB15384@redhat.com> References: <20120304091007.GA2252@redhat.com> <4F539242.8010605@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <4F539242.8010605@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] make: remove generated objects from target dirs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org, Anthony Liguori On Sun, Mar 04, 2012 at 05:03:14PM +0100, Andreas F=E4rber wrote: > Am 04.03.2012 10:10, schrieb Michael S. Tsirkin: > > I ended up with qmp-commands.h in target directories, > > which makes build fail as it is found before the > > main header. > > make clean fixes it, but it might get triggered > > again when we make some header target-independent next. > > It's easy to just make sure all such leftovers are > > removed, so let's do this. > >=20 > > Signed-off-by: Michael S. Tsirkin > >=20 > > diff --git a/Makefile b/Makefile > > index e66e885..958a414 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -89,6 +89,7 @@ qemu-options.def: $(SRC_PATH)/qemu-options.hx > > SUBDIR_RULES=3D$(patsubst %,subdir-%, $(TARGET_DIRS)) > > =20 > > subdir-%: $(GENERATED_HEADERS) > > + $(call quiet-command,rm -f $(foreach header, $(GENERATED_HEADERS), = "$*/$(header)"),) >=20 > Nack. While this happens to fix an issue you encountered this is just > plain wrong and dangerous. It takes a list of currently generated > headers in the main directory and deletes them in all target folders on > every compile; it's not forbidden to have a header of the same name in > both directories, whether generated or not. Yes it is Forbidden. With a big F. And the reason is that it will break the build in a very confusing way. So if you do this silly thing, you pay the price, and this is way better than everyone who tries to build the tree pays the price. > I am all for making make clean do what it claims though. > > The real solution to this problem would be to make sure by careful > review not to move files around in such a conflicting way (rename them > instead) Too late for current tree. There are many such conflicts. > rather than posting a note to please run make clean or make > distclean (which is fine if you have to do it once, bothersome for > multiple repos, and unhelpful for bisecting). >=20 > Andreas This means that a file name that was generated somewhere in the hierarchy at any point in the past can never be generated again anywhere else. That's impractical. > > $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V=3D"$(V)" T= ARGET_DIR=3D"$*/" all,) > > =20 > > ifneq ($(wildcard config-host.mak),) >=20 > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg