ia64/xen-unstable

view tools/examples/Makefile @ 9381:fbc3a2657fef

Prevent a stray error message in the case that either DISTDIR or
DESTDIR is empty, by preventing readlink from being called in that
case.

Another option would be to use readlink -s, but that has the
undesirable effect of staying silent in situations other than empty
DISTDIR/DESTDIR

Signed-off-by: Aron Griffis <aron@hp.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Mar 21 22:57:47 2006 +0100 (2006-03-21)
parents b30564f40914
children b454a09cddb1
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.hvm
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_SCRIPTS += vtpm vtpm-delete
30 XEN_SCRIPTS += xen-hotplug-cleanup
31 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
32 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
33 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
35 XEN_HOTPLUG_DIR = /etc/hotplug
36 XEN_HOTPLUG_SCRIPTS = xen-backend.agent
38 UDEV_RULES_DIR = /etc/udev
39 UDEV_RULES = xen-backend.rules
41 DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
42 DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
43 ifeq ($(findstring $(DI),$(DE)),$(DI))
44 HOTPLUGS=install-hotplug install-udev
45 else
46 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)
47 HOTPLUGS=install-udev
48 else
49 HOTPLUGS=install-hotplug
50 endif
51 endif
53 all:
54 build:
56 install: all install-initd install-configs install-scripts $(HOTPLUGS)
58 install-initd:
59 [ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
60 [ -d $(DESTDIR)/etc/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)/etc/sysconfig
61 $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
62 $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d
63 $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/etc/sysconfig/xendomains
65 install-configs: $(XEN_CONFIGS)
66 [ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
67 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
68 [ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
69 $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
70 for i in $(XEN_CONFIGS); \
71 do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
72 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
73 done
75 install-scripts:
76 [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
77 $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
78 for i in $(XEN_SCRIPTS); \
79 do \
80 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
81 done
82 for i in $(XEN_SCRIPT_DATA); \
83 do \
84 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
85 done
87 install-hotplug:
88 [ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
89 $(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
90 for i in $(XEN_HOTPLUG_SCRIPTS); \
91 do \
92 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
93 done
95 install-udev:
96 [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
97 $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
98 for i in $(UDEV_RULES); \
99 do \
100 $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
101 ( cd $(DESTDIR)$(UDEV_RULES_DIR)/rules.d ; \
102 ln -sf ../$$i . ) \
103 done
105 clean: