ia64/xen-unstable

view tools/examples/Makefile @ 7398:a0ec7370eec0

Fix installation decision to make the DISTDIR and DESTDIR absolute before
comparing them.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Sat Oct 15 12:55:03 2005 +0100 (2005-10-15)
parents 74d56b7ff46c
children 19af31a59537
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
13 # Xen configuration dir and configs to go there.
14 XEN_CONFIG_DIR = /etc/xen
15 XEN_CONFIGS = xend-config.sxp
16 XEN_CONFIGS += xmexample1
17 XEN_CONFIGS += xmexample2
18 XEN_CONFIGS += xmexample.vmx
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
27 XEN_SCRIPTS += xen-hotplug-common.sh
29 XEN_HOTPLUG_DIR = /etc/hotplug
30 XEN_HOTPLUG_SCRIPTS = xen-backend.agent
32 UDEV_RULES_DIR = /etc/udev/rules.d
33 UDEV_RULES = xen-backend.rules
35 DI = $(shell readlink -f $(DISTDIR))
36 DE = $(shell readlink -f $(DESTDIR))
37 ifeq ($(findstring $(DI),$(DE)),$(DI))
38 HOTPLUGS=install-hotplug install-udev
39 else
40 ifeq ($(shell [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `/sbin/udev -V` -ge 059 ] && echo 1),1)
41 HOTPLUGS=install-udev
42 else
43 HOTPLUGS=install-hotplug
44 endif
45 endif
47 all:
48 build:
50 install: all install-initd install-configs install-scripts $(HOTPLUGS)
52 install-initd:
53 [ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
54 $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
55 $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d
57 install-configs: $(XEN_CONFIGS)
58 [ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
59 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
60 [ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
61 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
62 for i in $(XEN_CONFIGS); \
63 do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
64 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
65 done
67 install-scripts:
68 [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
69 $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
70 for i in $(XEN_SCRIPTS); \
71 do \
72 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
73 done
75 install-hotplug:
76 [ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
77 $(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
78 for i in $(XEN_HOTPLUG_SCRIPTS); \
79 do \
80 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
81 done
83 install-udev:
84 [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
85 $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)
86 for i in $(UDEV_RULES); \
87 do \
88 $(INSTALL_PROG) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
89 done
91 clean: