Received: from eggs.gnu.org ([2001:4830:134:3::10]:41844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPQpq-0003QJ-5W for qemu-devel@nongnu.org; Mon, 17 Mar 2014 02:15:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPQpk-0002Gu-7g for qemu-devel@nongnu.org; Mon, 17 Mar 2014 02:15:42 -0400 Received: from v220110690675601.yourvserver.net ([37.221.199.173]:45328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPQpk-0002GQ-0r for qemu-devel@nongnu.org; Mon, 17 Mar 2014 02:15:36 -0400 Message-ID: <532692FA.1090206@weilnetz.de> Date: Mon, 17 Mar 2014 07:15:22 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1395020122-4957-1-git-send-email-famz@redhat.com> In-Reply-To: <1395020122-4957-1-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] Makefile: Fix "make clean" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org, Peter Maydell Cc: Paolo Bonzini , stefanha@redhat.com, Michael Roth , Anthony Liguori Am 17.03.2014 02:35, schrieb Fam Zheng: > This fixes a dangerous bug: "make clean" after "make distclean" will > delete every single file including those under .git, if you do in-tree > build! > > Rationale: A first "make distclean" will unset $(DSOSUF), a following > "make distclean" or "make clean" will find all the files and delete it. > > Fix it by explicitly typing the file extensions here, and combine > multiple find invocations into one. > > Signed-off-by: Fam Zheng > > --- > v2: Improve as Stefan Weil suggested. > > Signed-off-by: Fam Zheng > --- > Makefile | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/Makefile b/Makefile > index bd9cd4f..ec74039 100644 > --- a/Makefile > +++ b/Makefile > @@ -265,10 +265,7 @@ clean: > # avoid old build problems by removing potentially incorrect old files > rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h > rm -f qemu-options.def > - find . -name '*.[oda]' -type f -exec rm -f {} + > - find . -name '*.l[oa]' -type f -exec rm -f {} + > - find . -name '*$(DSOSUF)' -type f -exec rm -f {} + > - find . -name '*.mo' -type f -exec rm -f {} + > + find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} + > rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~ > rm -f fsdev/*.pod > rm -rf .libs */.libs > Reviewed-by: Stefan Weil Hello Peter, this is a bugfix which fixes a potential danger for a developer's working directory, so I think it should be fixed directly (not via qemu-trivial). Regards Stefan