summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make/findutils.mk15
-rw-r--r--make/grep.mk15
-rw-r--r--make/sed.mk15
-rw-r--r--make/tar.mk15
4 files changed, 40 insertions, 20 deletions
diff --git a/make/findutils.mk b/make/findutils.mk
index ca204c19b..5454e9ddb 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 88dbbbe4a..eadf0df4b 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 9220682de..3342fb406 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 a0213dd0a..9fc76031e 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