From 90a63b8ff31ece11e905a6ce6079cd5e422866d0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 27 May 2022 01:17:22 +0200 Subject: [PATCH] - binutils: rework build --- package/binutils/binutils.mk | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk index 180a40ef..84c4c4e0 100644 --- a/package/binutils/binutils.mk +++ b/package/binutils/binutils.mk @@ -9,10 +9,11 @@ BINUTILS_DIR = binutils-$(BINUTILS_VERSION) BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.bz2 BINUTILS_SITE = $(GNU_MIRROR)/binutils -$(DL_DIR)/$(BINUTILS_SOURCE): - $(download) $(BINUTILS_SITE)/$(BINUTILS_SOURCE) - BINUTILS_CONF_OPTS = \ + --bindir=$(base_bindir).$(@F) \ + --datarootdir=$(REMOVE_datarootdir) \ + --libdir=$(REMOVE_libdir) \ + --includedir=$(REMOVE_includedir) \ --disable-multilib \ --disable-werror \ --disable-plugins \ @@ -22,14 +23,19 @@ BINUTILS_CONF_OPTS = \ BINUTILS_BINARIES = objdump objcopy -binutils: $(DL_DIR)/$(BINUTILS_SOURCE) | $(TARGET_DIR) - $(REMOVE)/$(PKG_DIR) - $(UNTAR)/$(PKG_SOURCE) - $(CHDIR)/$(PKG_DIR); \ - $(CONFIGURE); \ - $(MAKE); \ - for bin in $($(PKG)_BINARIES); do \ - $(INSTALL_EXEC) $(BUILD_DIR)/$(PKG_DIR)/binutils/$$bin $(TARGET_bindir)/; \ - done - $(REMOVE)/$(PKG_DIR) - $(TOUCH) +define BINUTILS_INSTALL_BINARIES + $(foreach binary,$($(PKG)_BINARIES),\ + $(INSTALL_EXEC) $(TARGET_base_bindir).$(@F)/$(binary) $(TARGET_bindir)/; \ + rm -f $(TARGET_base_bindir).$(@F)/$(binary)$(sep) \ + ) + $(TARGET_RM) $(TARGET_base_bindir).$(@F) +endef +BINUTILS_TARGET_FINALIZE_HOOKS += BINUTILS_INSTALL_BINARIES + +define BINUTILS_TARGET_CLEANUP + $(TARGET_RM) $(TARGET_prefix)/$(TARGET) +endef +BINUTILS_TARGET_FINALIZE_HOOKS += BINUTILS_TARGET_CLEANUP + +binutils: | $(TARGET_DIR) + $(call autotools-package)