diff options
author | Phil Sutter <phil@nwl.cc> | 2020-06-09 12:40:24 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2020-06-09 19:36:37 +0200 |
commit | 848b4889274edb2ec6ef6218f3d8b55288dc4151 (patch) | |
tree | 66693c314df04685f9afb953e08ba64f64d6fb4f /extensions/GNUmakefile.in | |
parent | b40b7d976fe144d14421bb441f55ffdc11a4b442 (diff) |
build: Fix for failing 'make uninstall'
Support for uninstalling is severely broken:
- extensions/GNUmakefile.in defines an 'install' target but lacks a
respective 'uninstall' one, causing 'make uninstall' abort with an
error message.
- iptables/Makefile.am defines an 'install-exec-hook' to create the
binary symlinks which are left in place after 'make uninstall'.
Fix these problems by defining respective targets containing code copied
from automake-generated uninstall targets.
While being at it, add a few more uninstall-hooks removing custom
directories created by 'make install' if they are empty afterwards.
Reported-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Tested-by: Richard Guy Briggs <rgb@redhat.com>
Diffstat (limited to 'extensions/GNUmakefile.in')
-rw-r--r-- | extensions/GNUmakefile.in | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/extensions/GNUmakefile.in b/extensions/GNUmakefile.in index 0842a553..956ccb38 100644 --- a/extensions/GNUmakefile.in +++ b/extensions/GNUmakefile.in @@ -79,7 +79,7 @@ targets_install := .SECONDARY: -.PHONY: all install clean distclean FORCE +.PHONY: all install uninstall clean distclean FORCE all: ${targets} @@ -92,6 +92,19 @@ install: ${targets_install} ${symlinks_install} cp -P ${symlinks_install} "${DESTDIR}${xtlibdir}/"; \ fi; +uninstall: + dir=${DESTDIR}${xtlibdir}; { \ + test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; \ + } || { \ + test -z "${targets_install}" || ( \ + cd "$$dir" && rm -f ${targets_install} \ + ); \ + test -z "${symlinks_install}" || ( \ + cd "$$dir" && rm -f ${symlinks_install} \ + ); \ + rmdir -p --ignore-fail-on-non-empty "$$dir"; \ + } + clean: rm -f *.o *.oo *.so *.a {matches,targets}.man initext.c initext4.c initext6.c initextb.c initexta.c; rm -f .*.d .*.dd; |