All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Makefile.in: Add uninstall rule
@ 2018-05-24  7:57 Bhupesh Sharma
  2018-05-25  9:58 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Bhupesh Sharma @ 2018-05-24  7:57 UTC (permalink / raw)
  To: kexec
  Cc: bhsharma, vgoyal, AKASHI Takahiro, Simon Horman, ebiederm,
	bhupesh.linux, Dave Young, Russell King

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.

Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Simon Horman <horms@verge.net.au>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
---
Changes since v1:
 - As per Dave's suggestion, seperated the two patches included in the
   patchset in v1 as individual patches in v2.
 - Another patch sent by me now obsoletes the kdump tool and the 'make
   uninstall' rule can come in handy (especially on arm systems with
   low memory footprints) to remove already installed version of kdump
   tool and related man-pages.
   (the patch can be viewed here - http://lists.infradead.org/pipermail/kexec/2018-May/020754.html)
 - v1 can be viewed here: http://lists.infradead.org/pipermail/kexec/2018-April/020527.html

 Makefile.in | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 81 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 18e164595e3f..fb01134d9880 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -177,10 +177,21 @@ BINARIES_i386:=$(KEXEC_TEST)
 BINARIES_x86_64:=$(KEXEC_TEST)
 BINARIES:=$(KEXEC) $(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
 
@@ -213,6 +224,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)
@@ -318,5 +330,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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] Makefile.in: Add uninstall rule
  2018-05-24  7:57 [PATCH v2] Makefile.in: Add uninstall rule Bhupesh Sharma
@ 2018-05-25  9:58 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2018-05-25  9:58 UTC (permalink / raw)
  To: Bhupesh Sharma
  Cc: kexec, vgoyal, AKASHI Takahiro, ebiederm, bhupesh.linux,
	Dave Young, Russell King

On Thu, May 24, 2018 at 01:27:07PM +0530, Bhupesh Sharma wrote:
> 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.
> 
> Cc: Russell King <rmk@arm.linux.org.uk>
> Cc: Simon Horman <horms@verge.net.au>
> Cc: Dave Young <dyoung@redhat.com>
> Cc: Vivek Goyal <vgoyal@redhat.com>
> Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
> Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
> ---
> Changes since v1:
>  - As per Dave's suggestion, seperated the two patches included in the
>    patchset in v1 as individual patches in v2.
>  - Another patch sent by me now obsoletes the kdump tool and the 'make
>    uninstall' rule can come in handy (especially on arm systems with
>    low memory footprints) to remove already installed version of kdump
>    tool and related man-pages.
>    (the patch can be viewed here - http://lists.infradead.org/pipermail/kexec/2018-May/020754.html)
>  - v1 can be viewed here: http://lists.infradead.org/pipermail/kexec/2018-April/020527.html
> 
>  Makefile.in | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 81 insertions(+), 2 deletions(-)

Thanks, applied.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-25  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-24  7:57 [PATCH v2] Makefile.in: Add uninstall rule Bhupesh Sharma
2018-05-25  9:58 ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.