]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
Makefile: Fix "make clean"
authorFam Zheng <famz@redhat.com>
Mon, 17 Mar 2014 01:35:22 +0000 (09:35 +0800)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 17 Mar 2014 11:50:19 +0000 (11:50 +0000)
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 <famz@redhat.com>
Message-id: 1395020122-4957-1-git-send-email-famz@redhat.com
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Makefile

index bd9cd4fceb1d02afc40a9ad9cf6bce89e0e89891..ec7403961aca783eb434a53854fb54a3e06e08d0 100644 (file)
--- 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