Skip to content

Commit 5932f0d

Browse files
committed
add uninstall target
Make it easy to clean up an install Signed-off-by: Seth Jennings <[email protected]>
1 parent bdd8554 commit 5932f0d

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include Makefile.inc
33
SUBDIRS = kpatch-build kpatch kmod
44
BUILD_DIRS = $(SUBDIRS:%=build-%)
55
INSTALL_DIRS = $(SUBDIRS:%=install-%)
6+
UNINSTALL_DIRS = $(SUBDIRS:%=uninstall-%)
67
CLEAN_DIRS = $(SUBDIRS:%=clean-%)
78

89
.PHONY: $(SUBDIRS) $(BUILD_DIRS) $(INSTALL_DIRS) $(CLEAN_DIRS)
@@ -16,6 +17,10 @@ install: $(INSTALL_DIRS)
1617
$(INSTALL_DIRS):
1718
$(MAKE) -C $(@:install-%=%) install
1819

20+
uninstall: $(UNINSTALL_DIRS)
21+
$(UNINSTALL_DIRS):
22+
$(MAKE) -C $(@:uninstall-%=%) uninstall
23+
1924
clean: $(CLEAN_DIRS)
2025
$(CLEAN_DIRS):
2126
$(MAKE) -C $(@:clean-%=%) clean

kmod/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ install:
99
$(INSTALL) -d $(DATADIR)/patch
1010
$(INSTALL) -m 644 patch/* $(DATADIR)/patch
1111

12+
uninstall:
13+
$(RM) -R $(MODULESDIR)/*/kpatch
14+
$(RM) -R $(DATADIR)
15+
1216
clean:
1317
$(MAKE) -C core clean

kpatch-build/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@ install: all
1717
$(INSTALL) -d $(BINDIR)
1818
$(INSTALL) kpatch-build $(BINDIR)
1919

20+
uninstall:
21+
$(RM) -R $(LIBEXECDIR)
22+
$(RM) $(BINDIR)/kpatch-build
23+
2024
clean:
2125
$(RM) $(TARGETS)

kpatch/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ install: all
66
$(INSTALL) -d $(SBINDIR)
77
$(INSTALL) kpatch $(SBINDIR)
88

9+
uninstall:
10+
$(RM) $(SBINDIR)/kpatch
11+
912
clean:

0 commit comments

Comments
 (0)