add uninstall target

Make it easy to clean up an install

Signed-off-by: Seth Jennings <sjenning@redhat.com>
This commit is contained in:
Seth Jennings 2014-03-20 09:29:06 -05:00
parent bdd8554c96
commit 5932f0d083
4 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -17,5 +17,9 @@ install: all
$(INSTALL) -d $(BINDIR)
$(INSTALL) kpatch-build $(BINDIR)
uninstall:
$(RM) -R $(LIBEXECDIR)
$(RM) $(BINDIR)/kpatch-build
clean:
$(RM) $(TARGETS)

View File

@ -6,4 +6,7 @@ install: all
$(INSTALL) -d $(SBINDIR)
$(INSTALL) kpatch $(SBINDIR)
uninstall:
$(RM) $(SBINDIR)/kpatch
clean: