From: Eric Andersen Date: Thu, 6 Mar 2003 18:24:00 +0000 (-0000) Subject: work around deficiencies in GNU tar that prevented several X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c6aad34405c65cc01911ec89ab7c3eac47a6473;p=buildroot.git work around deficiencies in GNU tar that prevented several items from actually being installed --- diff --git a/make/findutils.mk b/make/findutils.mk index ca204c19bf..5454e9ddb9 100644 --- a/make/findutils.mk +++ b/make/findutils.mk @@ -45,12 +45,17 @@ $(FINDUTILS_DIR)/.configured: $(FINDUTILS_DIR)/.unpacked $(FINDUTILS_DIR)/$(FINDUTILS_BINARY): $(FINDUTILS_DIR)/.configured $(MAKE) CC=$(TARGET_CC) -C $(FINDUTILS_DIR) -$(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY): $(FINDUTILS_DIR)/$(FINDUTILS_BINARY) - $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FINDUTILS_DIR) install - rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \ - $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc +# This stuff is needed to work around GNU make deficiencies +findutils-target_binary: $(FINDUTILS_DIR)/$(FINDUTILS_BINARY) + @if [ -L $(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY) ] ; then \ + rm -f $(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY); fi; + @if [ $(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY) -ot $(FINDUTILS_DIR)/$(FINDUTILS_BINARY) ] ; then \ + set -x; \ + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FINDUTILS_DIR) install; \ + rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \ + $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc; fi; -findutils: uclibc $(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY) +findutils: uclibc findutils-target_binary findutils-clean: $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FINDUTILS_DIR) uninstall diff --git a/make/grep.mk b/make/grep.mk index 88dbbbe4ab..eadf0df4b5 100644 --- a/make/grep.mk +++ b/make/grep.mk @@ -45,12 +45,17 @@ $(GNUGREP_DIR)/.configured: $(GNUGREP_DIR)/.unpacked $(GNUGREP_DIR)/$(GNUGREP_BINARY): $(GNUGREP_DIR)/.configured $(MAKE) -C $(GNUGREP_DIR) -$(TARGET_DIR)/$(GNUGREP_TARGET_BINARY): $(GNUGREP_DIR)/$(GNUGREP_BINARY) - rm -f $(TARGET_DIR)/bin/grep $(TARGET_DIR)/bin/egrep $(TARGET_DIR)/bin/fgrep - cp -a $(GNUGREP_DIR)/src/grep $(GNUGREP_DIR)/src/egrep $(GNUGREP_DIR)/src/fgrep $(TARGET_DIR)/bin/ +# This stuff is needed to work around GNU make deficiencies +grep-target_binary: $(GNUGREP_DIR)/$(GNUGREP_BINARY) + @if [ -L $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) ] ; then \ + rm -f $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY); fi; + @if [ $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) -ot $(GNUGREP_DIR)/$(GNUGREP_BINARY) ] ; then \ + set -x; \ + rm -f $(TARGET_DIR)/bin/grep $(TARGET_DIR)/bin/egrep $(TARGET_DIR)/bin/fgrep; \ + cp -a $(GNUGREP_DIR)/src/grep $(GNUGREP_DIR)/src/egrep \ + $(GNUGREP_DIR)/src/fgrep $(TARGET_DIR)/bin/; fi - -grep: uclibc $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) +grep: uclibc grep-target_binary grep-clean: $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUGREP_DIR) uninstall diff --git a/make/sed.mk b/make/sed.mk index 9220682de1..3342fb4067 100644 --- a/make/sed.mk +++ b/make/sed.mk @@ -43,13 +43,18 @@ $(SED_DIR)/.configured: $(SED_DIR)/.unpacked $(SED_DIR)/$(SED_BINARY): $(SED_DIR)/.configured $(MAKE) CC=$(TARGET_CC) -C $(SED_DIR) -$(TARGET_DIR)/$(SED_TARGET_BINARY): $(SED_DIR)/$(SED_BINARY) - $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(SED_DIR) install - mv $(TARGET_DIR)/usr/bin/sed $(TARGET_DIR)/bin/ +# This stuff is needed to work around GNU make deficiencies +sed-target_binary: $(SED_DIR)/$(SED_BINARY) + @if [ -L $(TARGET_DIR)/$(SED_TARGET_BINARY) ] ; then \ + rm -f $(TARGET_DIR)/$(SED_TARGET_BINARY); fi; + @if [ $(TARGET_DIR)/$(SED_TARGET_BINARY) -ot $(SED_DIR)/$(SED_BINARY) ] ; then \ + set -x; \ + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(SED_DIR) install; \ + mv $(TARGET_DIR)/usr/bin/sed $(TARGET_DIR)/bin/; \ rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \ - $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc + $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc; fi -sed: uclibc $(TARGET_DIR)/$(SED_TARGET_BINARY) +sed: uclibc sed-target_binary sed-clean: $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(SED_DIR) uninstall diff --git a/make/tar.mk b/make/tar.mk index a0213dd0aa..9fc76031ee 100644 --- a/make/tar.mk +++ b/make/tar.mk @@ -43,11 +43,16 @@ $(GNUTAR_DIR)/.configured: $(GNUTAR_DIR)/.unpacked $(GNUTAR_DIR)/$(GNUTAR_BINARY): $(GNUTAR_DIR)/.configured $(MAKE) -C $(GNUTAR_DIR) -$(TARGET_DIR)/$(GNUTAR_TARGET_BINARY): $(GNUTAR_DIR)/$(GNUTAR_BINARY) - rm -f $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY) - cp -a $(GNUTAR_DIR)/$(GNUTAR_BINARY) $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY) - -tar: uclibc $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY) +# This stuff is needed to work around GNU make deficiencies +tar-target_binary: $(GNUTAR_DIR)/$(GNUTAR_BINARY) + @if [ -L $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY) ] ; then \ + rm -f $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY); fi; + @if [ $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY) -ot $(GNUTAR_DIR)/$(GNUTAR_BINARY) ] ; then \ + set -x; \ + rm -f $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY); \ + cp -a $(GNUTAR_DIR)/$(GNUTAR_BINARY) $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY); fi ; + +tar: uclibc tar-target_binary tar-clean: $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUTAR_DIR) uninstall