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

[XEN PATCH v6 11/31] build: fix clean targets when subdir-y is used

  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 1 Jul 2021 15:09:51 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Ian Jackson" <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 01 Jul 2021 14:11:04 +0000
  • Ironport-hdrordr: A9a23:Vun1V6ljqiwuiZcxmBJSZYTwKj/pDfIm3DAbv31ZSRFFG/Fw9/ re/8jztCWE7Ar5N0tMpTntAsW9qBDnlaKdg7N+AV7KZmCP01dAR7sC0WKN+VLd84CUzIRgPS AKSdkaNDUlZmIK7/rH3A==
  • Ironport-sdr: Gl7gpFD2pCJm/M7MRaZCSy0jIjUuheQt71gIpKzZRJmorny4R1wgXdIXEWx2kMSa9kQ0I+OU9G NQzZK/HFxxwJXY6u9HXFz2LCU4pyaCe6qhszmQW+uYfpIywGumUK/u5/xhhm8FIpqA2oAZ6nL4 1jwQaOfeYXlEqqJrawW9TZI6LGRJ5Y/FXqD3F6oQYBgh5lf4LEw118uw5/1b/uEN7rLbRZRCjM HxyNweZqtU3IAURTb1tAaEBFSwWE7aD0+m/av9OPsp8qk8OeIiBAmVkw9FC4JeldeCnhz4Z/rb u6E=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The make variable $(subdir-y) isn't used yet but will be in a
following patch. Anything in $(subdir-y) doesn't to have a '/' as
suffix as we already now it's a directory.

Rework the rules so that it doesn't matter whether there is a '/' or
not. It also mimic more closely to the way Linux's Kbuild descend in

FORCE phony target isn't needed anymore running clean, so it can be

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
 xen/scripts/Makefile.clean | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/scripts/Makefile.clean b/xen/scripts/Makefile.clean
index 53379e6102cc..027c200c0efc 100644
--- a/xen/scripts/Makefile.clean
+++ b/xen/scripts/Makefile.clean
@@ -12,19 +12,18 @@ include Makefile
 # Figure out what we need to clean from the various variables
 # ==========================================================================
 subdir-all := $(subdir-y) $(subdir-n) $(subdir-) \
-              $(filter %/, $(obj-y) $(obj-n) $(obj-))
+              $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-n) $(obj-)))
 .PHONY: clean
-clean:: $(addprefix _clean_, $(subdir-all))
+clean:: $(subdir-all)
        rm -f *.o .*.o.tmp *~ core $(DEPS_RM)
 # Descending
 # ---------------------------------------------------------------------------
-_clean_%/: FORCE
-       $(MAKE) $(clean) $*
+PHONY += $(subdir-all)
+       $(MAKE) $(clean) $@
-# Force execution of pattern rules (for which PHONY cannot be directly used).
Anthony PERARD



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