debuggers.hg

view tools/hotplug/Linux/Makefile @ 20939:845d04d505d0

tools: Do not append trailing slash to XEN_ROOT in Makefiles

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 04 09:03:42 2010 +0000 (2010-02-04)
parents f254f4a9a02c
children 3ffdb094c2c0 6e53bd71bfb2
line source
1 XEN_ROOT = ../../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 # Init scripts.
5 XEND_INITD = init.d/xend
6 XEND_SYSCONFIG = init.d/sysconfig.xend
7 XENDOMAINS_INITD = init.d/xendomains
8 XENDOMAINS_SYSCONFIG = init.d/sysconfig.xendomains
10 # Xen script dir and scripts to go there.
11 XEN_SCRIPTS = network-bridge vif-bridge
12 XEN_SCRIPTS += network-route vif-route
13 XEN_SCRIPTS += network-nat vif-nat
14 XEN_SCRIPTS += vif2
15 XEN_SCRIPTS += block
16 XEN_SCRIPTS += block-enbd block-nbd
17 XEN_SCRIPTS += blktap
18 XEN_SCRIPTS += vtpm vtpm-delete
19 XEN_SCRIPTS += xen-hotplug-cleanup
20 XEN_SCRIPTS += external-device-migrate
21 XEN_SCRIPTS += vscsi
22 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
23 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
24 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
25 XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
27 XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
28 XEN_HOTPLUG_SCRIPTS = xen-backend.agent
30 UDEVVER = 0
31 ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
32 UDEVVER = $(shell /sbin/udevadm info -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
33 endif
34 ifeq ($(shell [ -x /usr/bin/udevinfo ] && echo 1),1)
35 UDEVVER = $(shell /usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
36 endif
38 UDEV_RULES_DIR = $(CONFIG_DIR)/udev
39 UDEV_RULES = xen-backend.rules xend.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 [ $(UDEVVER) -ge 059 ] && echo 1),1)
47 HOTPLUGS=install-udev
48 else
49 HOTPLUGS=install-hotplug
50 endif
51 endif
53 .PHONY: all
54 all:
56 .PHONY: build
57 build:
59 .PHONY: install
60 install: all install-initd install-scripts $(HOTPLUGS)
62 .PHONY: install-initd
63 install-initd:
64 [ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d
65 [ -d $(DESTDIR)$(CONFIG_DIR)/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/sysconfig
66 $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
67 $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xend
68 $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
69 $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xendomains
71 .PHONY: install-scripts
72 install-scripts:
73 [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
74 $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
75 set -e; for i in $(XEN_SCRIPTS); \
76 do \
77 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
78 done
79 set -e; for i in $(XEN_SCRIPT_DATA); \
80 do \
81 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
82 done
84 .PHONY: install-hotplug
85 install-hotplug:
86 [ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
87 $(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
88 set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
89 do \
90 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
91 done
93 .PHONY: install-udev
94 install-udev:
95 [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
96 $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
97 set -e; for i in $(UDEV_RULES); \
98 do \
99 $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
100 ln -sf ../$$i $(DESTDIR)$(UDEV_RULES_DIR)/rules.d; \
101 done
103 .PHONY: clean
104 clean: