[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] build: use $(clean) shorthand for clean targets



commit deacf17ae3aef81df20263dc45980d8436d90bba
Author:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
AuthorDate: Fri Mar 6 10:14:18 2020 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Mar 6 10:14:18 2020 +0100

    build: use $(clean) shorthand for clean targets
    
    Collect all the clean targets as we are going to modify it shortly.
    Also, this is inspired by Linux's Kbuild.
    
    "Kbuild.include" isn't included by "Makefile", but the "_clean" target
    is only used by Rules.mk which include Kbuild.include.
    
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/Makefile               | 16 ++++++++--------
 xen/Rules.mk               |  2 +-
 xen/scripts/Kbuild.include |  5 +++++
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 72bc899246..65bd913cd1 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -120,14 +120,14 @@ _debug:
 .PHONY: _clean
 _clean: delete-unfresh-files
        $(MAKE) -C tools clean
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C include clean
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/arm clean
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/x86 clean
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C test clean
+       $(MAKE) $(clean) include
+       $(MAKE) $(clean) common
+       $(MAKE) $(clean) drivers
+       $(MAKE) $(clean) xsm
+       $(MAKE) $(clean) crypto
+       $(MAKE) $(clean) arch/arm
+       $(MAKE) $(clean) arch/x86
+       $(MAKE) $(clean) test
        $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) 
SRCARCH=$(SRCARCH) clean
        find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" -o -name 
"*.gcno" \) -exec rm -f {} \;
        rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi 
$(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
diff --git a/xen/Rules.mk b/xen/Rules.mk
index cc9c71bb13..e3b19319b1 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -189,7 +189,7 @@ FORCE:
 clean:: $(addprefix _clean_, $(subdir-all))
        rm -f *.o .*.o.tmp *~ core $(DEPS_RM)
 _clean_%/: FORCE
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
+       $(MAKE) $(clean) $*
 
 SRCPATH := $(patsubst $(BASEDIR)/%,%,$(CURDIR))
 
diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include
index a5c462fd97..2465cc4060 100644
--- a/xen/scripts/Kbuild.include
+++ b/xen/scripts/Kbuild.include
@@ -5,3 +5,8 @@
 # cc-ifversion
 # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
 cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || 
echo $(4))
+
+# Shorthand for $(MAKE) clean
+# Usage:
+# $(MAKE) $(clean) dir
+clean := -f $(BASEDIR)/Rules.mk clean -C
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.