Return-path: Received: from mail-pg0-f68.google.com ([74.125.83.68]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fATij-00085G-Ue for kexec@lists.infradead.org; Mon, 23 Apr 2018 05:08:59 +0000 Received: by mail-pg0-f68.google.com with SMTP id m21so4547198pgv.8 for ; Sun, 22 Apr 2018 22:08:45 -0700 (PDT) From: Bhupesh Sharma Subject: [PATCH 1/2] Makefile.in: Add uninstall rule Date: Mon, 23 Apr 2018 10:30:21 +0530 Message-Id: <1524459622-2059-2-git-send-email-bhsharma@redhat.com> In-Reply-To: <1524459622-2059-1-git-send-email-bhsharma@redhat.com> References: <1524459622-2059-1-git-send-email-bhsharma@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: kexec@lists.infradead.org Cc: rmk@armlinux.org.uk, Bhupesh Sharma , horms@verge.net.au, ebiederm@xmission.com, bhupesh.linux@gmail.com, dyoung@redhat.com, vgoyal@redhat.com Presently the Makedumpfile.in doesn't include a uninstall rule, which is useful in case we want to preform a reverse of the install process done by Makefile.in This patch adds this rule, thus making it easier to remove installed executables and man pages in case one needs to uninstall the same. Signed-off-by: Bhupesh Sharma --- Makefile.in | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 81 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 54c206fd649c..273d06ebea55 100644 --- a/Makefile.in +++ b/Makefile.in @@ -182,10 +182,21 @@ BINARIES_i386:=$(KEXEC_TEST) BINARIES_x86_64:=$(KEXEC_TEST) BINARIES:=$(KEXEC) $(KDUMP) $(VMCORE_DMESG) $(BINARIES_$(ARCH)) -TARGETS:=$(BINARIES) $(MAN_PAGES) +UNINSTALL_KDUMP = $(sbindir)/kdump +UNINSTALL_KDUMP_MANPAGE = $(mandir)/man8/kdump.8 +UNINSTALL_KEXEC = $(sbindir)/kexec +UNINSTALL_KEXEC_MANPAGE = $(mandir)/man8/kexec.8 +UNINSTALL_VMCORE_DMESG = $(sbindir)/vmcore-dmesg +UNINSTALL_VMCORE_DMESG_MANPAGE = $(mandir)/man8/vmcore-dmesg.8 +TARGETS:=$(BINARIES) $(MAN_PAGES) targets: $(TARGETS) +UNINSTALL_TARGETS:=$(UNINSTALL_KDUMP) $(UNINSTALL_KDUMP_MANPAGE) \ + $(UNINSTALL_KEXEC) $(UNINSTALL_KEXEC_MANPAGE) \ + $(UNINSTALL_VMCORE_DMESG) $(UNINSTALL_VMCORE_DMESG_MANPAGE) +uninstall-targets: $(UNINSTALL_TARGETS) + Makefile: Makefile.in config.status ./config.status @@ -218,6 +229,7 @@ echo:: @echo ARCH=$(ARCH) @echo BINARIES=$(BINARIES) @echo TARGETS=$(TARGETS) + @echo UNINSTALL_TARGETS=$(UNINSTALL_TARGETS) @echo CC=$(CC) @echo AR=$(AR) @echo LD=$(LD) @@ -323,5 +335,72 @@ install: $(TARGETS) fi; \ done -.PHONY: echo install all targets clean dist-clean distclean \ +uninstall: + UINSTALL_LIST='$(UNINSTALL_TARGETS)'; for file in $$UINSTALL_LIST ; do \ + if test `$(DIRNAME) $$file` = "$(sbindir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(bindir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(libexecdir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(datadir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(sysconfdir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(sharedstatedir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(localstatedir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(libdir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(infodir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(mandir)/man1" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(mandir)/man2" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(mandir)/man3" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(mandir)/man4" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(mandir)/man5" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(mandir)/man6" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(mandir)/man7" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(mandir)/man8" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(includedir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(pkgdatadir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(pkglibdir)" ; then \ + rm -rf $$file ; \ + fi; \ + if test `$(DIRNAME) $$file` = "$(pkgincludedir)" ; then \ + rm -rf $$file ; \ + fi; \ + done + +.PHONY: echo install uninstall all targets uninstall-targets clean dist-clean distclean \ maintainer-clean maintainerclean tarball rpm -- 2.7.4 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec