From a63805b25f99e609d575ee920baae269fb58794c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 28 Sep 2022 01:23:56 -0700 Subject: [PATCH] tools: add Host/Uninstall where possible This cleans staging_dir when calling tool/x/clean. Signed-off-by: Rosen Penev --- tools/automake/Makefile | 5 ++--- tools/bash/Makefile | 4 ++++ tools/bc/Makefile | 4 ++++ tools/bison/Makefile | 10 +++++----- tools/coreutils/Makefile | 5 +++++ tools/cpio/Makefile | 4 ++++ tools/dosfstools/Makefile | 4 ++++ tools/elfutils/Makefile | 4 ++++ tools/fakeroot/Makefile | 4 ++++ tools/findutils/Makefile | 4 ++++ tools/flex/Makefile | 6 +++++- tools/flock/Makefile | 4 ++++ tools/gmp/Makefile | 4 ++++ tools/isl/Makefile | 4 ++++ tools/libressl/Makefile | 4 ++++ tools/libtool/Makefile | 5 ++++- tools/lzma/Makefile | 1 + tools/m4/Makefile | 5 ++--- tools/mpc/Makefile | 4 ++++ tools/mpfr/Makefile | 4 ++++ tools/patch/Makefile | 4 ++++ tools/patchelf/Makefile | 4 ++++ tools/sparse/Makefile | 4 ++++ tools/tar/Makefile | 4 ++++ tools/xz/Makefile | 4 ++++ tools/zip/Makefile | 5 ++++- 26 files changed, 100 insertions(+), 14 deletions(-) diff --git a/tools/automake/Makefile b/tools/automake/Makefile index c016f1d76a..a1121f1378 100644 --- a/tools/automake/Makefile +++ b/tools/automake/Makefile @@ -43,9 +43,8 @@ define Host/Install ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.15 endef -define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall - $(call Host/Clean/Default) +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) endef $(eval $(call HostBuild)) diff --git a/tools/bash/Makefile b/tools/bash/Makefile index 7c25b83327..992933c6bf 100644 --- a/tools/bash/Makefile +++ b/tools/bash/Makefile @@ -18,4 +18,8 @@ HOST_BUILD_PARALLEL := 1 include $(INCLUDE_DIR)/host-build.mk +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/bc/Makefile b/tools/bc/Makefile index 9e1b2ba336..ac6609e008 100644 --- a/tools/bc/Makefile +++ b/tools/bc/Makefile @@ -18,4 +18,8 @@ PKG_CPE_ID:=cpe:/a:gnu:bc include $(INCLUDE_DIR)/host-build.mk +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/bison/Makefile b/tools/bison/Makefile index 5f96463ae0..30555541e6 100644 --- a/tools/bison/Makefile +++ b/tools/bison/Makefile @@ -19,14 +19,14 @@ include $(INCLUDE_DIR)/host-build.mk HOST_CONFIGURE_ARGS += --enable-threads=posix --disable-nls -define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall - $(call Host/Clean/Default) -endef - define Host/Install $(call Host/Install/Default) $(INSTALL_BIN) ./scripts/yacc $(STAGING_DIR_HOST)/bin/yacc endef +define Host/Uninstall + rm -f $(STAGING_DIR_HOST)/bin/yacc + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/coreutils/Makefile b/tools/coreutils/Makefile index 87c9102fa6..c64210c5a7 100644 --- a/tools/coreutils/Makefile +++ b/tools/coreutils/Makefile @@ -35,4 +35,9 @@ define Host/Install ln -sf ginstall $(1)/bin/install endef +define Host/Uninstall + rm -f $(STAGING_DIR_HOST)/bin/install + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/cpio/Makefile b/tools/cpio/Makefile index 2852209847..82b5aa8365 100644 --- a/tools/cpio/Makefile +++ b/tools/cpio/Makefile @@ -11,4 +11,8 @@ PKG_HASH:=eab5bdc5ae1df285c59f2a4f140a98fc33678a0bf61bdba67d9436ae26b46f6d include $(INCLUDE_DIR)/host-build.mk +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/dosfstools/Makefile b/tools/dosfstools/Makefile index d52c46b302..7c834dfd49 100644 --- a/tools/dosfstools/Makefile +++ b/tools/dosfstools/Makefile @@ -24,4 +24,8 @@ ifeq ($(HOST_OS),Darwin) HOST_CFLAGS += -UHAVE_ENDIAN_H endif +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/elfutils/Makefile b/tools/elfutils/Makefile index 92a916ec4d..37e0d545f8 100644 --- a/tools/elfutils/Makefile +++ b/tools/elfutils/Makefile @@ -30,4 +30,8 @@ HOST_CONFIGURE_ARGS += \ HOST_MAKE_FLAGS += \ SUBDIRS="lib libelf libcpu backends libebl libdwelf libdwfl libdw" +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile index 5d31e19781..efd9227d1a 100644 --- a/tools/fakeroot/Makefile +++ b/tools/fakeroot/Makefile @@ -25,4 +25,8 @@ HOST_CONFIGURE_VARS += \ HOST_CONFIGURE_ARGS += \ --with-ipc=tcp +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/findutils/Makefile b/tools/findutils/Makefile index d0d780689b..ac1d5312c9 100644 --- a/tools/findutils/Makefile +++ b/tools/findutils/Makefile @@ -28,4 +28,8 @@ HOST_CONFIGURE_ARGS += \ --disable-nls \ --without-selinux +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/flex/Makefile b/tools/flex/Makefile index bb5aecbdfe..da037ae72d 100644 --- a/tools/flex/Makefile +++ b/tools/flex/Makefile @@ -26,8 +26,12 @@ define Host/Install $(LN) flex $(STAGING_DIR_HOST)/bin/lex endef +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall + rm -f $(STAGING_DIR_HOST)/bin/lex $(call Host/Clean/Default) endef diff --git a/tools/flock/Makefile b/tools/flock/Makefile index cd3561bb69..4e0a45440f 100644 --- a/tools/flock/Makefile +++ b/tools/flock/Makefile @@ -24,4 +24,8 @@ define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/flock $(STAGING_DIR_HOST)/bin/ endef +define Host/Clean + rm -f $(STAGING_DIR_HOST)/bin/flock +endef + $(eval $(call HostBuild)) diff --git a/tools/gmp/Makefile b/tools/gmp/Makefile index 967cf6817b..cfd6e30e04 100644 --- a/tools/gmp/Makefile +++ b/tools/gmp/Makefile @@ -31,4 +31,8 @@ ifeq ($(GNU_HOST_NAME),x86_64-linux-gnux32) HOST_CONFIGURE_ARGS += ABI=x32 endif +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/isl/Makefile b/tools/isl/Makefile index e9674debc2..0fab02fe3f 100644 --- a/tools/isl/Makefile +++ b/tools/isl/Makefile @@ -24,4 +24,8 @@ HOST_CONFIGURE_ARGS += \ --disable-shared \ --with-gmp-prefix=$(STAGING_DIR_HOST) +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index 0b5175124e..fe73e7cde2 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -34,4 +34,8 @@ HOST_CONFIGURE_ARGS += \ --with-pic \ --disable-tests +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/libtool/Makefile b/tools/libtool/Makefile index 2bc9db7d0d..fcac06e269 100644 --- a/tools/libtool/Makefile +++ b/tools/libtool/Makefile @@ -34,8 +34,11 @@ define Host/Install $(SED) 's,-lstdc++,-luClibc++,g' $(STAGING_DIR_HOST)/bin/libtool-ucxx endef +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall $(call Host/Clean/Default) endef diff --git a/tools/lzma/Makefile b/tools/lzma/Makefile index b87289e385..29f7e0fb1d 100644 --- a/tools/lzma/Makefile +++ b/tools/lzma/Makefile @@ -31,6 +31,7 @@ define Host/Install endef define Host/Clean + rm -f $(STAGING_DIR_HOST)/bin/lzma endef $(eval $(call HostBuild)) diff --git a/tools/m4/Makefile b/tools/m4/Makefile index 0a358c35f1..d621000daf 100644 --- a/tools/m4/Makefile +++ b/tools/m4/Makefile @@ -21,9 +21,8 @@ include $(INCLUDE_DIR)/host-build.mk HOST_CONFIGURE_VARS += gl_cv_func_strstr_linear=no -define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall - $(call Host/Clean/Default) +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) endef $(eval $(call HostBuild)) diff --git a/tools/mpc/Makefile b/tools/mpc/Makefile index 733c14173b..b170043c1a 100644 --- a/tools/mpc/Makefile +++ b/tools/mpc/Makefile @@ -25,4 +25,8 @@ HOST_CONFIGURE_ARGS += \ --with-mpfr=$(TOPDIR)/staging_dir/host \ --with-gmp=$(TOPDIR)/staging_dir/host +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/mpfr/Makefile b/tools/mpfr/Makefile index 65e6f8959f..4562c128d4 100644 --- a/tools/mpfr/Makefile +++ b/tools/mpfr/Makefile @@ -25,4 +25,8 @@ HOST_CONFIGURE_ARGS += \ --enable-thread-safe \ --with-gmp=$(STAGING_DIR_HOST) +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/patch/Makefile b/tools/patch/Makefile index e0481204f7..bac7d5692c 100644 --- a/tools/patch/Makefile +++ b/tools/patch/Makefile @@ -22,4 +22,8 @@ include $(INCLUDE_DIR)/host-build.mk HOSTCC := $(HOSTCC_NOCACHE) HOSTCXX := $(HOSTCXX_NOCACHE) +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/patchelf/Makefile b/tools/patchelf/Makefile index 7c88f8dc45..4cf039c407 100644 --- a/tools/patchelf/Makefile +++ b/tools/patchelf/Makefile @@ -24,4 +24,8 @@ define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/patchelf $(STAGING_DIR_HOST)/bin/patchelf endef +define Host/Clean + rm -rf $(STAGING_DIR_HOST)/bin/patchelf +endef + $(eval $(call HostBuild)) diff --git a/tools/sparse/Makefile b/tools/sparse/Makefile index 549ec3a3cc..e08bd1d05f 100644 --- a/tools/sparse/Makefile +++ b/tools/sparse/Makefile @@ -21,4 +21,8 @@ define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/sparse $(STAGING_DIR_HOST)/bin endef +define Host/Clean + rm -f $(STAGING_DIR_HOST)/bin/sparse +endef + $(eval $(call HostBuild)) diff --git a/tools/tar/Makefile b/tools/tar/Makefile index f1dfc11f93..47aad9ec6e 100644 --- a/tools/tar/Makefile +++ b/tools/tar/Makefile @@ -28,4 +28,8 @@ HOST_CONFIGURE_ARGS += \ --disable-acl \ --disable-nls +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/xz/Makefile b/tools/xz/Makefile index ef0ed02396..8add2f21df 100644 --- a/tools/xz/Makefile +++ b/tools/xz/Makefile @@ -33,4 +33,8 @@ define Host/Install +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) install xzlinks="unxz xzcat" endef +define Host/Uninstall + -$(call Host/Compile/Default,uninstall) +endef + $(eval $(call HostBuild)) diff --git a/tools/zip/Makefile b/tools/zip/Makefile index 7dd81a1b8b..6e83dafb40 100644 --- a/tools/zip/Makefile +++ b/tools/zip/Makefile @@ -32,5 +32,8 @@ define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/zip $(STAGING_DIR_HOST)/bin/ endef +define Host/Clean + rm -rf $(STAGING_DIR_HOST)/bin/zip +endef + $(eval $(call HostBuild)) -#$(eval $(call BuildPackage,zip))