ia64/xen-unstable

view tools/examples/Makefile @ 7329:74d56b7ff46c

Merged
author djm@kirby.fc.hp.com
date Tue Oct 11 16:57:44 2005 -0600 (2005-10-11)
parents 4e0c94871be2 0e7c48861e95
children a0ec7370eec0
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 ifeq ($(findstring $(DISTDIR),$(DESTDIR)),$(DISTDIR))
36 HOTPLUGS=install-hotplug install-udev
37 else
38 ifeq ($(shell [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `/sbin/udev -V` -ge 059 ] && echo 1),1)
39 HOTPLUGS=install-udev
40 else
41 HOTPLUGS=install-hotplug
42 endif
43 endif
45 all:
46 build:
48 install: all install-initd install-configs install-scripts $(HOTPLUGS)
50 install-initd:
51 [ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
52 $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
53 $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d
55 install-configs: $(XEN_CONFIGS)
56 [ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
57 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
58 [ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
59 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
60 for i in $(XEN_CONFIGS); \
61 do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
62 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
63 done
65 install-scripts:
66 [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
67 $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
68 for i in $(XEN_SCRIPTS); \
69 do \
70 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
71 done
73 install-hotplug:
74 [ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
75 $(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
76 for i in $(XEN_HOTPLUG_SCRIPTS); \
77 do \
78 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
79 done
81 install-udev:
82 [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
83 $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)
84 for i in $(UDEV_RULES); \
85 do \
86 $(INSTALL_PROG) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
87 done
89 clean: