ia64/xen-unstable

view tools/examples/Makefile @ 18099:1694061217ad

pvscsi: Install vscsi script.

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jul 18 11:22:12 2008 +0100 (2008-07-18)
parents 9469ad6e2634
children 4ce366cde89c
line source
1 XEN_ROOT = ../../
2 include $(XEN_ROOT)/tools/Rules.mk
4 # Init scripts.
5 XEND_INITD = init.d/xend
6 XENDOMAINS_INITD = init.d/xendomains
7 XENDOMAINS_SYSCONFIG = init.d/sysconfig.xendomains
9 # Xen configuration dir and configs to go there.
10 XEN_CONFIG_DIR = /etc/xen
11 XEN_CONFIGS = xend-config.sxp
12 XEN_CONFIGS += xm-config.xml
13 XEN_CONFIGS += xmexample1
14 XEN_CONFIGS += xmexample2
15 XEN_CONFIGS += xmexample.hvm
16 XEN_CONFIGS += xmexample.vti
17 XEN_CONFIGS += xend-pci-quirks.sxp
18 XEN_CONFIGS += xend-pci-permissive.sxp
20 # Xen script dir and scripts to go there.
21 XEN_SCRIPT_DIR = /etc/xen/scripts
22 XEN_SCRIPTS = network-bridge vif-bridge
23 XEN_SCRIPTS += network-route vif-route
24 XEN_SCRIPTS += network-nat vif-nat
25 XEN_SCRIPTS += block
26 XEN_SCRIPTS += block-enbd block-nbd
27 XEN_SCRIPTS += blktap
28 XEN_SCRIPTS += vtpm vtpm-delete
29 XEN_SCRIPTS += xen-hotplug-cleanup
30 XEN_SCRIPTS += external-device-migrate
31 XEN_SCRIPTS += vscsi
32 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
33 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
34 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
35 XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
37 XEN_HOTPLUG_DIR = /etc/hotplug
38 XEN_HOTPLUG_SCRIPTS = xen-backend.agent
40 UDEV_RULES_DIR = /etc/udev
41 UDEV_RULES = xen-backend.rules
43 DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
44 DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
45 ifeq ($(findstring $(DI),$(DE)),$(DI))
46 HOTPLUGS=install-hotplug install-udev
47 else
48 ifeq ($(shell [ -x /usr/bin/udevinfo ] && [ `/usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
49 HOTPLUGS=install-udev
50 else
51 HOTPLUGS=install-hotplug
52 endif
53 endif
55 .PHONY: all
56 all:
58 .PHONY: build
59 build:
61 .PHONY: install
62 install: all install-initd install-configs install-scripts $(HOTPLUGS)
64 .PHONY: install-initd
65 install-initd:
66 [ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
67 [ -d $(DESTDIR)/etc/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)/etc/sysconfig
68 $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
69 $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d
70 $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/etc/sysconfig/xendomains
72 .PHONY: install-configs
73 install-configs: $(XEN_CONFIGS)
74 [ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
75 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
76 [ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
77 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
78 set -e; for i in $(XEN_CONFIGS); \
79 do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
80 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
81 done
83 .PHONY: install-scripts
84 install-scripts:
85 [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
86 $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
87 set -e; for i in $(XEN_SCRIPTS); \
88 do \
89 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
90 done
91 set -e; for i in $(XEN_SCRIPT_DATA); \
92 do \
93 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
94 done
96 .PHONY: install-hotplug
97 install-hotplug:
98 [ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
99 $(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
100 set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
101 do \
102 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
103 done
105 .PHONY: install-udev
106 install-udev:
107 [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
108 $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
109 set -e; for i in $(UDEV_RULES); \
110 do \
111 $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
112 ln -sf ../$$i $(DESTDIR)$(UDEV_RULES_DIR)/rules.d; \
113 done
115 .PHONY: clean
116 clean: