ia64/xen-unstable

view tools/examples/Makefile @ 7800:5aad7e145e50

If /sbin/ isn't in the path, udev rules will erroneously not get
installed.

Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Nov 14 11:05:34 2005 +0100 (2005-11-14)
parents a7a35d0a4a7c
children cb215a84d1af
line source
1 XEN_ROOT = ../../
2 include $(XEN_ROOT)/tools/Rules.mk
4 INSTALL = install
5 INSTALL_DIR = $(INSTALL) -d -m0755
6 INSTALL_PROG = $(INSTALL) -m0755
7 INSTALL_DATA = $(INSTALL) -m0644
9 # Init scripts.
10 XEND_INITD = init.d/xend
11 XENDOMAINS_INITD = init.d/xendomains
12 XENDOMAINS_SYSCONFIG = init.d/sysconfig.xendomains
14 # Xen configuration dir and configs to go there.
15 XEN_CONFIG_DIR = /etc/xen
16 XEN_CONFIGS = xend-config.sxp
17 XEN_CONFIGS += xmexample1
18 XEN_CONFIGS += xmexample2
19 XEN_CONFIGS += xmexample.vmx
20 XEN_CONFIGS += xmexample.vti
22 # Xen script dir and scripts to go there.
23 XEN_SCRIPT_DIR = /etc/xen/scripts
24 XEN_SCRIPTS = network-bridge vif-bridge
25 XEN_SCRIPTS += network-route vif-route
26 XEN_SCRIPTS += network-nat vif-nat
27 XEN_SCRIPTS += block
28 XEN_SCRIPTS += block-enbd block-nbd
29 XEN_SCRIPT_DATA = xen-script-common.sh
30 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
31 XEN_SCRIPT_DATA += block-common.sh
33 XEN_HOTPLUG_DIR = /etc/hotplug
34 XEN_HOTPLUG_SCRIPTS = xen-backend.agent
36 UDEV_RULES_DIR = /etc/udev
37 UDEV_RULES = xen-backend.rules
39 DI = $(shell readlink -f $(DISTDIR))
40 DE = $(shell readlink -f $(DESTDIR))
41 ifeq ($(findstring $(DI),$(DE)),$(DI))
42 HOTPLUGS=install-hotplug install-udev
43 else
44 ifeq ($(shell [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ] && echo 1),1)
45 HOTPLUGS=install-udev
46 else
47 HOTPLUGS=install-hotplug
48 endif
49 endif
51 all:
52 build:
54 install: all install-initd install-configs install-scripts $(HOTPLUGS)
56 install-initd:
57 [ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
58 [ -d $(DESTDIR)/etc/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)/etc/sysconfig
59 $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
60 $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d
61 $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/etc/sysconfig/xendomains
63 install-configs: $(XEN_CONFIGS)
64 [ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
65 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
66 [ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
67 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
68 for i in $(XEN_CONFIGS); \
69 do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
70 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
71 done
73 install-scripts:
74 [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
75 $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
76 for i in $(XEN_SCRIPTS); \
77 do \
78 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
79 done
80 for i in $(XEN_SCRIPT_DATA); \
81 do \
82 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
83 done
85 install-hotplug:
86 [ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
87 $(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
88 for i in $(XEN_HOTPLUG_SCRIPTS); \
89 do \
90 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
91 done
93 install-udev:
94 [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
95 $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
96 for i in $(UDEV_RULES); \
97 do \
98 $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
99 ( cd $(DESTDIR)$(UDEV_RULES_DIR)/rules.d ; \
100 ln -sf ../$$i . ) \
101 done
103 clean: