ia64/xen-unstable

view tools/Makefile @ 16904:7f2b79c05988

Call makefile recursively for subdirs.
This makes it possible to handle subdirs differently.

Signed-off-by: Bastian Blank <waldi@debian.org>
author Keir Fraser <keir.fraser@citrix.com>
date Sat Jan 26 15:26:41 2008 +0000 (2008-01-26)
parents 1fe8c8a275c9
children 363a1e845189
line source
1 XEN_ROOT = ../
2 include $(XEN_ROOT)/tools/Rules.mk
4 SUBDIRS-y :=
5 SUBDIRS-y += include
6 SUBDIRS-y += libxc
7 SUBDIRS-y += flask
8 SUBDIRS-y += xenstore
9 SUBDIRS-y += misc
10 SUBDIRS-y += examples
11 SUBDIRS-y += xentrace
12 SUBDIRS-$(CONFIG_XCUTILS) += xcutils
13 SUBDIRS-$(CONFIG_X86) += firmware
14 SUBDIRS-$(ACM_SECURITY) += security
15 SUBDIRS-y += console
16 SUBDIRS-y += xenmon
17 SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
18 SUBDIRS-$(VTPM_TOOLS) += vtpm
19 SUBDIRS-y += xenstat
20 SUBDIRS-y += libaio
21 SUBDIRS-y += blktap
22 SUBDIRS-y += libfsimage
23 SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
25 # These don't cross-compile
26 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
27 SUBDIRS-$(PYTHON_TOOLS) += python
28 SUBDIRS-$(PYTHON_TOOLS) += pygrub
29 endif
31 # For the sake of linking, set the sys-root
32 ifneq ($(CROSS_COMPILE),)
33 CROSS_SYS_ROOT ?= /usr/$(CROSS_COMPILE:-=)/sys-root
34 export CROSS_SYS_ROOT
35 endif
37 .PHONY: all
38 all: check
39 @set -e; for subdir in $(SUBDIRS-y); do \
40 $(MAKE) subdir-$@-$$subdir; \
41 done
42 $(MAKE) ioemu
44 .PHONY: install
45 install: check
46 @set -e; for subdir in $(SUBDIRS-y); do \
47 $(MAKE) subdir-$@-$$subdir; \
48 done
49 $(MAKE) ioemuinstall
50 $(INSTALL_DIR) $(DESTDIR)/var/xen/dump
51 $(INSTALL_DIR) $(DESTDIR)/var/log/xen
52 $(INSTALL_DIR) $(DESTDIR)/var/lib/xen
54 .PHONY: clean
55 clean: check_clean
56 @set -e; for subdir in $(SUBDIRS-y); do \
57 $(MAKE) subdir-$@-$$subdir; \
58 done
59 $(MAKE) ioemuclean
61 .PHONY: distclean
62 distclean: clean
64 subdir-all-%:
65 $(MAKE) -C $* all
67 subdir-clean-%:
68 $(MAKE) -C $* clean
70 subdir-install-%:
71 $(MAKE) -C $* install
73 .PHONY: check
74 check:
75 $(MAKE) -C check
77 .PHONY: check_clean
78 check_clean:
79 $(MAKE) -C check clean
81 .PHONY: ioemu ioemuinstall ioemuclean
82 ifeq ($(CONFIG_IOEMU),y)
83 IOEMU_DIR ?= ioemu
84 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
85 IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \
86 --interp-prefix=$(CROSS_SYS_ROOT)
87 endif
88 ioemu ioemuinstall:
89 [ -f $(IOEMU_DIR)/config-host.mak ] || \
90 ( cd $(IOEMU_DIR) && XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) sh configure --prefix=/usr \
91 $(IOEMU_CONFIGURE_CROSS) )
92 $(MAKE) -C $(IOEMU_DIR) $(patsubst ioemu%,%,$@)
93 ioemuclean:
94 $(MAKE) -C $(IOEMU_DIR) distclean
95 else
96 ioemu ioemuinstall ioemuclean:
97 endif