1XEN_ROOT = $(CURDIR)/../../..
2include $(XEN_ROOT)/tools/Rules.mk
3
4HOTPLUGPATH="hotplugpath.sh"
5
6# OS-independent hotplug scripts go in this directory
7
8# Xen scripts to go there.
9XEN_SCRIPTS =
10XEN_SCRIPT_DATA = $(HOTPLUGPATH)
11
12genpath-target = $(call buildmakevars2file,$(HOTPLUGPATH))
13$(eval $(genpath-target))
14
15.PHONY: all
16all: build
17
18.PHONY: build
19build: $(HOTPLUGPATH)
20
21.PHONY: install
22install: install-scripts
23
24.PHONY: uninstall
25uninstall: uninstall-scripts
26
27.PHONY: install-scripts
28install-scripts: build
29	[ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
30		$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
31	set -e; for i in $(XEN_SCRIPTS); \
32	   do \
33	   $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
34	done
35	set -e; for i in $(XEN_SCRIPT_DATA); \
36	   do \
37	   $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
38	done
39
40.PHONY: uninstall-scripts
41uninstall-scripts:
42	rm -f $(addprefix $(DESTDIR)$(XEN_SCRIPT_DIR)/, $(XEN_SCRIPTS))
43	rm -f $(addprefix $(DESTDIR)$(XEN_SCRIPT_DIR)/, $(XEN_SCRIPT_DATA))
44
45.PHONY: clean
46clean:
47	rm -f $(HOTPLUGPATH)
48
49.PHONY: distclean
50distclean: clean
51