From 5932f0d0833c5f0ef5a68a4223b3f0027d716597 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Thu, 20 Mar 2014 09:29:06 -0500 Subject: [PATCH] add uninstall target Make it easy to clean up an install Signed-off-by: Seth Jennings --- Makefile | 5 +++++ kmod/Makefile | 4 ++++ kpatch-build/Makefile | 4 ++++ kpatch/Makefile | 3 +++ 4 files changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 7ec6711..72e43f9 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ include Makefile.inc SUBDIRS = kpatch-build kpatch kmod BUILD_DIRS = $(SUBDIRS:%=build-%) INSTALL_DIRS = $(SUBDIRS:%=install-%) +UNINSTALL_DIRS = $(SUBDIRS:%=uninstall-%) CLEAN_DIRS = $(SUBDIRS:%=clean-%) .PHONY: $(SUBDIRS) $(BUILD_DIRS) $(INSTALL_DIRS) $(CLEAN_DIRS) @@ -16,6 +17,10 @@ install: $(INSTALL_DIRS) $(INSTALL_DIRS): $(MAKE) -C $(@:install-%=%) install +uninstall: $(UNINSTALL_DIRS) +$(UNINSTALL_DIRS): + $(MAKE) -C $(@:uninstall-%=%) uninstall + clean: $(CLEAN_DIRS) $(CLEAN_DIRS): $(MAKE) -C $(@:clean-%=%) clean diff --git a/kmod/Makefile b/kmod/Makefile index f13c7b3..fb75fca 100644 --- a/kmod/Makefile +++ b/kmod/Makefile @@ -9,5 +9,9 @@ install: $(INSTALL) -d $(DATADIR)/patch $(INSTALL) -m 644 patch/* $(DATADIR)/patch +uninstall: + $(RM) -R $(MODULESDIR)/*/kpatch + $(RM) -R $(DATADIR) + clean: $(MAKE) -C core clean diff --git a/kpatch-build/Makefile b/kpatch-build/Makefile index 36b956a..a4c48dc 100644 --- a/kpatch-build/Makefile +++ b/kpatch-build/Makefile @@ -17,5 +17,9 @@ install: all $(INSTALL) -d $(BINDIR) $(INSTALL) kpatch-build $(BINDIR) +uninstall: + $(RM) -R $(LIBEXECDIR) + $(RM) $(BINDIR)/kpatch-build + clean: $(RM) $(TARGETS) diff --git a/kpatch/Makefile b/kpatch/Makefile index 2e345c7..448968f 100644 --- a/kpatch/Makefile +++ b/kpatch/Makefile @@ -6,4 +6,7 @@ install: all $(INSTALL) -d $(SBINDIR) $(INSTALL) kpatch $(SBINDIR) +uninstall: + $(RM) $(SBINDIR)/kpatch + clean: