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: