ia64/xen-unstable

view tools/Makefile @ 19818:415505139333

Get rid of hardcoded pathes for stubdom and hotplug scripts

- Have the buid system generate a file which exports the install paths
for the hotplug scripts and stubdom / stubdom-dm
- Move file generation code from tools/python/Makefile into a gmake
macro
in Config.mk to avoid maintenance of three duplicates each with its
own
tweaks and bugs
- Export gmake variables into ioemu as shell variables
for upcoming ioemu patches
- Do above as a gmake macro to avoid maintenance of several duplicates
- Adjust hotplug scripts to find the right xen binaries from the
install directory
- Adjust stubdom-dm to use the install directories

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 23 17:25:51 2009 +0100 (2009-06-23)
parents b7f73a7f3078
children
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-$(CONFIG_OCAML_XENSTORED) += ocaml-xenstored
10 SUBDIRS-y += xenstore
11 SUBDIRS-y += misc
12 SUBDIRS-y += examples
13 SUBDIRS-y += hotplug
14 SUBDIRS-y += xentrace
15 SUBDIRS-$(CONFIG_XCUTILS) += xcutils
16 SUBDIRS-$(CONFIG_X86) += firmware
17 SUBDIRS-$(ACM_SECURITY) += security
18 SUBDIRS-y += console
19 SUBDIRS-y += xenmon
20 SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
21 SUBDIRS-$(VTPM_TOOLS) += vtpm
22 SUBDIRS-y += xenstat
23 SUBDIRS-$(CONFIG_Linux) += libaio
24 SUBDIRS-$(CONFIG_Linux) += blktap
25 SUBDIRS-$(CONFIG_Linux) += blktap2
26 SUBDIRS-$(CONFIG_NetBSD) += libaio
27 SUBDIRS-$(CONFIG_NetBSD) += blktap2
28 SUBDIRS-y += libfsimage
29 SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
30 SUBDIRS-$(CONFIG_Linux) += fs-back
31 SUBDIRS-$(CONFIG_NetBSD) += fs-back
32 SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir
33 SUBDIRS-y += xenpmd
35 # These don't cross-compile
36 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
37 SUBDIRS-$(PYTHON_TOOLS) += python
38 SUBDIRS-$(PYTHON_TOOLS) += pygrub
39 endif
41 # For the sake of linking, set the sys-root
42 ifneq ($(CROSS_COMPILE),)
43 CROSS_BIN_PATH ?= /usr/$(CROSS_COMPILE:-=)/bin
44 CROSS_SYS_ROOT ?= /usr/$(CROSS_COMPILE:-=)/sys-root
45 export CROSS_SYS_ROOT # exported for check/funcs.sh
46 export CROSS_BIN_PATH # exported for cross-install.sh
47 endif
49 .PHONY: all
50 all: subdirs-all
52 .PHONY: install
53 install: subdirs-install
54 $(INSTALL_DIR) $(DESTDIR)/var/xen/dump
55 $(INSTALL_DIR) $(DESTDIR)/var/log/xen
56 $(INSTALL_DIR) $(DESTDIR)/var/lib/xen
57 $(INSTALL_DIR) $(DESTDIR)/var/lock/subsys
59 .PHONY: clean distclean
60 clean distclean: subdirs-clean
62 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
63 IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
64 --cross-prefix=$(CROSS_COMPILE) \
65 --interp-prefix=$(CROSS_SYS_ROOT)
66 endif
68 ioemu/config-host.mak:
69 cd ioemu && XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) sh configure \
70 --prefix=$(PREFIX) $(IOEMU_CONFIGURE_CROSS)
72 subdir-all-ioemu subdir-install-ioemu: ioemu/config-host.mak
74 subdir-clean-ioemu:
75 $(MAKE) -C ioemu distclean
77 ioemu-dir-find:
78 set -ex; \
79 if test -d $(CONFIG_QEMU); then \
80 rm -f ioemu-dir; \
81 ln -sf $(CONFIG_QEMU) ioemu-dir; \
82 else \
83 if [ ! -d ioemu-remote ]; then \
84 rm -rf ioemu-remote ioemu-remote.tmp; \
85 mkdir ioemu-remote.tmp; rmdir ioemu-remote.tmp; \
86 $(GIT) clone $(CONFIG_QEMU) ioemu-remote.tmp; \
87 if [ "$(QEMU_TAG)" ]; then \
88 cd ioemu-remote.tmp; \
89 $(GIT) branch -D dummy >/dev/null 2>&1 ||:; \
90 $(GIT) checkout -b dummy $(QEMU_TAG); \
91 cd ..; \
92 fi; \
93 mv ioemu-remote.tmp ioemu-remote; \
94 fi; \
95 rm -f ioemu-dir; \
96 ln -sf ioemu-remote ioemu-dir; \
97 fi
98 set -e; \
99 $(absolutify_xen_root); \
100 $(buildmakevars2shellvars); \
101 cd ioemu-dir; \
102 ./xen-setup $(IOEMU_CONFIGURE_CROSS)
104 subdir-all-ioemu-dir subdir-install-ioemu-dir: ioemu-dir-find
106 subdir-clean-ioemu-dir:
107 set -e; if test -d ioemu-dir/.; then \
108 $(absolutify_xen_root); \
109 $(buildmakevars2shellvars); \
110 $(MAKE) -C ioemu-dir clean; \
111 fi
113 ocaml-xenstored:
114 set -ex; \
115 rm -rf ocaml-xenstored.tmp; \
116 hg clone $(OCAML_XENSTORED_REPO) ocaml-xenstored.tmp; \
117 if [ "$(OCAML_XENSTORED_TAG)" ]; then \
118 hg -R ocaml-xenstored.tmp update -r $(OCAML_XENSTORED_TAG) ;\
119 hg -R ocaml-xenstored.tmp branch mybranch ;\
120 fi; \
121 mv ocaml-xenstored.tmp ocaml-xenstored; \
123 subdir-all-ocaml-xenstored subdir-install-ocaml-xenstored: ocaml-xenstored
124 $(absolutify_xen_root); \
125 $(MAKE) -C ocaml-xenstored $(patsubst subdir-%-ocaml-xenstored,%,$@);
127 subdir-clean-ocaml-xenstored:
128 set -e; if test -d ocaml-xenstored; then \
129 $(MAKE) -C ocaml-xenstored clean; \
130 fi