From 848b4889274edb2ec6ef6218f3d8b55288dc4151 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 9 Jun 2020 12:40:24 +0200 Subject: 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 Signed-off-by: Phil Sutter Tested-by: Richard Guy Briggs --- include/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/Makefile.am') diff --git a/include/Makefile.am b/include/Makefile.am index e6951209..ea34c2fe 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -10,3 +10,8 @@ endif nobase_include_HEADERS += \ libiptc/ipt_kernel_headers.h libiptc/libiptc.h \ libiptc/libip6tc.h libiptc/libxtc.h libiptc/xtcshared.h + +uninstall-hook: + dir=${includedir}/libiptc; { \ + test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; \ + } || rmdir -p --ignore-fail-on-non-empty "$$dir" -- cgit v1.2.3