ia64/xen-unstable

view tools/Makefile @ 17995:edd6969f609c

Improve plumbing for calling external qemu builds

* Remove ioemu-dir before replacing it with a symlink so that
switching between trees doesn't go wrong.
* Remove case-based arrangement for making XEN_ROOT absolute
and replace with $(abspath ...) since we depend on GNU make
anyway.
* `make clean' recurses into ioemu-dir

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jul 08 14:26:09 2008 +0100 (2008-07-08)
parents 20215b87d0f3
children 3f23e01d3198
line source
1 XEN_ROOT = ../
2 include $(XEN_ROOT)/tools/Rules.mk
4 SUBDIRS-y :=
5 SUBDIRS-y += check
6 SUBDIRS-y += include
7 SUBDIRS-y += libxc
8 SUBDIRS-y += flask
9 SUBDIRS-y += xenstore
10 SUBDIRS-y += misc
11 SUBDIRS-y += examples
12 SUBDIRS-y += xentrace
13 SUBDIRS-$(CONFIG_XCUTILS) += xcutils
14 SUBDIRS-$(CONFIG_X86) += firmware
15 SUBDIRS-$(ACM_SECURITY) += security
16 SUBDIRS-y += console
17 SUBDIRS-y += xenmon
18 SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
19 SUBDIRS-$(VTPM_TOOLS) += vtpm
20 SUBDIRS-y += xenstat
21 SUBDIRS-y += libaio
22 SUBDIRS-y += blktap
23 SUBDIRS-y += libfsimage
24 SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
26 ifeq (ioemu,$(CONFIG_QEMU))
27 SUBDIRS-$(CONFIG_IOEMU) += ioemu
28 else
29 SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir
30 endif
32 # These don't cross-compile
33 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
34 SUBDIRS-$(PYTHON_TOOLS) += python
35 SUBDIRS-$(PYTHON_TOOLS) += pygrub
36 endif
38 # For the sake of linking, set the sys-root
39 ifneq ($(CROSS_COMPILE),)
40 CROSS_SYS_ROOT ?= /usr/$(CROSS_COMPILE:-=)/sys-root
41 export CROSS_SYS_ROOT
42 endif
44 .PHONY: all
45 all: subdirs-all
47 .PHONY: install
48 install: subdirs-install
49 $(INSTALL_DIR) $(DESTDIR)/var/xen/dump
50 $(INSTALL_DIR) $(DESTDIR)/var/log/xen
51 $(INSTALL_DIR) $(DESTDIR)/var/lib/xen
53 .PHONY: clean distclean
54 clean distclean: subdirs-clean
56 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
57 IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \
58 --interp-prefix=$(CROSS_SYS_ROOT)
59 endif
61 ioemu/config-host.mak:
62 cd ioemu && XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) sh configure --prefix=/usr \
63 $(IOEMU_CONFIGURE_CROSS)
65 subdir-all-ioemu subdir-install-ioemu: ioemu/config-host.mak
67 subdir-clean-ioemu:
68 $(MAKE) -C ioemu distclean
70 ioemu-dir-find:
71 set -ex; \
72 if test -d $(CONFIG_QEMU); then \
73 rm -f ioemu-dir; \
74 ln -sf $(CONFIG_QEMU) ioemu-dir; \
75 else \
76 if [ ! -d ioemu-remote ]; then \
77 rm -rf ioemu-remote ioemu-remote.tmp; \
78 mkdir ioemu-remote.tmp; rmdir ioemu-remote.tmp; \
79 $(GIT) clone $(CONFIG_QEMU) ioemu-remote.tmp; \
80 mv ioemu-remote.tmp ioemu-remote; \
81 fi; \
82 rm -f ioemu-dir; \
83 ln -sf ioemu-remote ioemu-dir; \
84 fi
85 cd ioemu-dir && XEN_ROOT="$(abspath $(XEN_ROOT))" ./xen-setup
87 subdir-all-ioemu-dir subdir-install-ioemu-dir: ioemu-dir-find
89 subdir-clean-ioemu-dir:
90 if test -d ioemu-dir/.; then \
91 $(MAKE) -C ioemu-dir clean; \
92 fi