]> xenbits.xensource.com Git - xen.git/commitdiff
xen/test/livepatch: Regularise Makefiles
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 7 Jun 2017 13:44:51 +0000 (14:44 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 19 Jun 2017 10:36:07 +0000 (11:36 +0100)
In xen/test/livepatch/Makefile:

  Provide a `build' target, as most of the
  subdir-invoking Makefiles elsewhere expect.

In xen/test/Makefile:

  Replace the two open-coded targets with a generalised pattern rule
  which descends into each of SUBDIRS.  This allows `install' to work
  too (it is already supported by xen/test/livepatch/Makefile).

  Provide an explicit default target of `tests', and an `all' target
  (which is conventional).

  Suppress entry into the xen/test/livepatch subdir when we are
  building for i386, since the 32-bit hypervisor is not supported any
  more and we can't build livepatches for it either.

After this, the xen/test subdirectory is somewhere were make can be
invoked in the way which is conventional for xen.git/xen/ subdirs.

None of this is yet invoked from the top-level Makefile.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
(cherry picked from commit e541982dc21dcc5be61279d22d477ed5c0bc41c5)
(cherry picked from commit 8c60e5f4327583b1c90cf3641388ef618c1727ec)

xen/test/Makefile
xen/test/livepatch/Makefile

index d91b31977678bb677f6e81b18c24d022a2f81275..aa1a23b835b0a89eca6d5092691b3cf0a0e593b8 100644 (file)
@@ -1,7 +1,13 @@
-.PHONY: tests
-tests:
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch livepatch
 
-.PHONY: clean
-clean::
-       $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch clean
+tests all: build
+
+
+ifneq ($(XEN_TARGET_ARCH),x86_32)
+# Xen 32-bit x86 hypervisor no longer supported, so has no test livepatches
+SUBDIRS += livepatch
+endif
+
+%:
+       set -e; for s in $(SUBDIRS); do \
+               $(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \
+       done
index 76d65cfd51adef8c24c454d32955c025aa0f5219..6831383db1a88f8e570e7c2447aad180e6201df9 100644 (file)
@@ -27,7 +27,7 @@ LIVEPATCHES += $(LIVEPATCH_NOP)
 
 LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch
 
-default: livepatch
+build default: livepatch
 
 install: livepatch
        $(INSTALL_DIR) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR)