]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commitdiff
build: fix clean to remove all *.o and .*.d files
authorJonathan Creekmore <jonathan.creekmore@gmail.com>
Thu, 3 Dec 2015 14:35:09 +0000 (15:35 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 3 Dec 2015 14:35:09 +0000 (15:35 +0100)
In commit 8b6ef9c152edceabecc7f90c811cd538a7b7a110, several files in
xen/common/compat were changed to be built using the Makefile in
xen/common, by appending the compat prefix to the object
files. Additionally, the xen/common/compat directory was removed from
the subdirs-y variable, so it is no longer visited by the clean
rule. This resulted in some object files and dependency files being
generated by inclusion into obj-y, but not cleaned because they lived in a
directory that was unvisited by the clean rules.

Since there is a desire for all of the object files and dependency files
to be cleaned, just search for all objects and dependency files and
delete them on clean. The previous method of only tracking with the
$(DEPS) and *.o in the clean rules had the disadvantage that, if the
configuration changed between a build and a clean, some of the
dependencies or objects could get left behind. This method does not have
the same disadvantage.

Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
[dropped removal of *.o and $(DEPS) from xen/Rules.mk's clean rule]
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/Makefile

index 3a1de99532b81fa03cb9dac8a13fdb79e43ae886..62c3a6e69b81461d5cb85d2437931692eda2d9de 100644 (file)
@@ -91,7 +91,8 @@ _clean: delete-unfresh-files
        $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
        $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
        $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-       rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core $(DEPS)
+       find . \( -name "*.o" -o -name ".*.d" \) -exec rm -f {} \;
+       rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
        rm -f include/asm-*/asm-offsets.h
        rm -f .banner