From patchwork Mon Mar 17 01:35:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 330742 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8BDD52C00B0 for ; Mon, 17 Mar 2014 12:35:58 +1100 (EST) Received: from localhost ([::1]:55173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPMT6-0000ME-5c for incoming@patchwork.ozlabs.org; Sun, 16 Mar 2014 21:35:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPMSZ-0008RU-DE for qemu-devel@nongnu.org; Sun, 16 Mar 2014 21:35:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPMST-0005Ok-EH for qemu-devel@nongnu.org; Sun, 16 Mar 2014 21:35:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPMST-0005Og-6B for qemu-devel@nongnu.org; Sun, 16 Mar 2014 21:35:17 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2H1ZDn2014745 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 16 Mar 2014 21:35:13 -0400 Received: from T430.nay.redhat.com ([10.66.6.152]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s2H1ZAME025643; Sun, 16 Mar 2014 21:35:10 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Mon, 17 Mar 2014 09:35:22 +0800 Message-Id: <1395020122-4957-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Fam Zheng , Anthony Liguori , Stefan Weil , Michael Roth , stefanha@redhat.com, Paolo Bonzini Subject: [Qemu-devel] [PATCH v2] Makefile: Fix "make clean" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Stefan Weil --- 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