From e1bcfb12d7ce9c275079daec2bb263724032bfa9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 7 Jun 2017 14:44:51 +0100 Subject: [PATCH] xen/test/livepatch: Regularise Makefiles 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 Acked-by: Konrad Rzeszutek Wilk Acked-by: Jan Beulich Acked-by: Wei Liu Release-acked-by: Julien Grall (cherry picked from commit e541982dc21dcc5be61279d22d477ed5c0bc41c5) (cherry picked from commit 8c60e5f4327583b1c90cf3641388ef618c1727ec) --- xen/test/Makefile | 18 ++++++++++++------ xen/test/livepatch/Makefile | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/xen/test/Makefile b/xen/test/Makefile index d91b319776..aa1a23b835 100644 --- a/xen/test/Makefile +++ b/xen/test/Makefile @@ -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 diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile index 76d65cfd51..6831383db1 100644 --- a/xen/test/livepatch/Makefile +++ b/xen/test/livepatch/Makefile @@ -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) -- 2.39.5