Files
Petre Pircalabu f2b40dabab Makefile: Fix uninstall target
Running "make uninstall" does not remove all installed files, a
situation which might cause link related issues if xen is re-installed
in a different location.
In order to make uninstall correctly remove the files it is best
the process should be done recursively by mirroring each "install"
target with an "uninstall" who removes the installed files.

An exception to this rule is uninstalling the files produced by
"qemu-xen-dir-remote" and "qemu-xen-traditional-dir", which are external
to the project. These projects do not implement an "uninstall" target so
the files have to be removed manually.

Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2017-07-28 17:47:42 +01:00

60 lines
1.4 KiB
Makefile

XEN_ROOT = $(CURDIR)/../..
include $(XEN_ROOT)/tools/Rules.mk
# Xen configuration dir and configs to go there.
XEN_READMES = README
XEN_READMES += README.incompatibilities
XEN_CONFIGS += xlexample.hvm
XEN_CONFIGS += xlexample.pvlinux
XEN_CONFIGS += xl.conf
XEN_CONFIGS += cpupool
XEN_CONFIGS += $(XEN_CONFIGS-y)
.PHONY: all
all:
.PHONY: build
build:
.PHONY: install
install: all install-readmes install-configs
.PHONY: uninstall
uninstall: uninstall-readmes uninstall-configs
.PHONY: install-readmes
install-readmes:
[ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
set -e; for i in $(XEN_READMES); \
do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
$(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
done
.PHONY: uninstall-readmes
uninstall-readmes:
rm -f $(addprefix $(DESTDIR)$(XEN_CONFIG_DIR)/, $(XEN_READMES))
.PHONY: install-configs
install-configs: $(XEN_CONFIGS)
[ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
[ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
set -e; for i in $(XEN_CONFIGS); \
do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
$(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
done
.PHONY: uninstall-configs
uninstall-configs:
rm -f $(addprefix $(DESTDIR)$(XEN_CONFIG_DIR)/, $(XEN_CONFIGS))
.PHONY: clean
clean:
.PHONY: distclean
distclean: clean