diff mbox

[v2,1/2] tools: consolidate Makefile runes to building+installing qemu-trad

Message ID 1454515849-13886-1-git-send-email-ian.campbell@citrix.com
State New, archived
Headers show

Commit Message

Ian Campbell Feb. 3, 2016, 4:10 p.m. UTC
Currently both subdir-all-qemu-traditional-dir and subdir-install-...
recurse into qemu-traditional-dir and run xen-setup, but with subtly
different options (--extra-cflags was only passed for install).

Consolidate these by having the install target depend on the all
(build) target and only calling make install.

There is a subtlty which is that qemu-trad's build is not completely
isolated from xen.git and requires some environment variables etc. To
handle this refactor the setup code into a make macro and $(call) it
in both cases.

Note that this doesn't actually omit a potential double call to
configure, since all is still called during install, this is the same
for qemu-xen. Note that it doesn't result in a double build in either
case, since apparently the qemu configure is idempotent.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

Comments

Ian Jackson Feb. 3, 2016, 4:12 p.m. UTC | #1
Ian Campbell writes ("[PATCH v2 1/2] tools: consolidate Makefile runes to building+installing qemu-trad"):
> Currently both subdir-all-qemu-traditional-dir and subdir-install-...
> recurse into qemu-traditional-dir and run xen-setup, but with subtly
> different options (--extra-cflags was only passed for install).

Yuk!  I'm sorry if that was my fault!

> Consolidate these by having the install target depend on the all
> (build) target and only calling make install.
> 
> There is a subtlty which is that qemu-trad's build is not completely
> isolated from xen.git and requires some environment variables etc. To
> handle this refactor the setup code into a make macro and $(call) it
> in both cases.
> 
> Note that this doesn't actually omit a potential double call to
> configure, since all is still called during install, this is the same
> for qemu-xen. Note that it doesn't result in a double build in either
> case, since apparently the qemu configure is idempotent.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks,
Ian.
Ian Campbell Feb. 4, 2016, 4:20 p.m. UTC | #2
On Wed, 2016-02-03 at 16:12 +0000, Ian Jackson wrote:

> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Applied both, thanks.
diff mbox

Patch

diff --git a/tools/Makefile b/tools/Makefile
index 15680a5..3d3fd60 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -184,28 +184,25 @@  qemu-xen-traditional-dir-force-update: qemu-xen-traditional-dir-find
 		$(GIT) reset --hard $(QEMU_TRADITIONAL_REVISION); \
 	fi
 
-subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
+qemu-traditional-recurse = \
 	set -e; \
 		$(buildmakevars2shellvars); \
 		export CONFIG_BLKTAP1=n; \
 		cd qemu-xen-traditional-dir; \
-		$(QEMU_ROOT)/xen-setup \
-		$(IOEMU_EXTRA_LDFLAGS) \
-		--cpu=$(IOEMU_CPU_ARCH) \
-		$(IOEMU_CONFIGURE_CROSS); \
-		$(MAKE) all
+		$(1)
 
-subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
-	set -e; \
-		$(buildmakevars2shellvars); \
-		export CONFIG_BLKTAP1=n; \
-		cd qemu-xen-traditional-dir; \
+subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
+	$(call qemu-traditional-recurse,\
 		$(QEMU_ROOT)/xen-setup \
 		--extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \
 		$(IOEMU_EXTRA_LDFLAGS) \
 		--cpu=$(IOEMU_CPU_ARCH) \
 		$(IOEMU_CONFIGURE_CROSS); \
-		$(MAKE) install
+		$(MAKE) all \
+	)
+
+subdir-install-qemu-xen-traditional-dir: subdir-all-qemu-xen-traditional-dir
+	$(call qemu-traditional-recurse,$(MAKE) install)
 
 subdir-clean-qemu-xen-traditional-dir:
 	set -e; if test -d qemu-xen-traditional-dir/.; then \