]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
build: use $(clean) shorthand for clean targets
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 6 Mar 2020 09:14:18 +0000 (10:14 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Mar 2020 09:14:18 +0000 (10:14 +0100)
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@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/Makefile
xen/Rules.mk
xen/scripts/Kbuild.include

index 72bc899246226195b9b7fa3945d979c06fe31770..65bd913cd13378f884d5db2316d33be099ae31e0 100644 (file)
@@ -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
index cc9c71bb13278b298ae27dc6e78d520cb2b9a4a0..e3b19319b1f58902b89cdc0dc4350e651be7954b 100644 (file)
@@ -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))
 
index a5c462fd9777868f276bc5766b2f64151de46761..2465cc4060c3da96aba76ee9cb8969f6bec7bbaa 100644 (file)
@@ -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