[PATCH] Makefile: add clean-obsolete-scripts target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Cygwin, newly builtins are not recognized, because there exist both
the executable binaries (with .exe extension) _and_ the now-obsolete
scripts (without extension), but the script is executed.

"make clean-obsolete-scripts" removes these ambiguities by removing the
older of these file pairs.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@xxxxxx>
---
 Makefile |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 007ceb2..a46683a 100644
--- a/Makefile
+++ b/Makefile
@@ -905,6 +905,25 @@ dist-doc:
 
 ### Cleaning rules
 
+clean-obsolete-scripts:
+	@if test -n "$X"; \
+	then \
+		ls *$X '$(DESTDIR_SQ)$(gitexecdir_SQ)'/*$X | while read f; do \
+			script="`echo "$$f" | sed 's/$X\$$/./'`"; \
+			if test -f "$$script"; \
+			then \
+				if test "$$script" -ot "$$f"; \
+				then \
+					echo removing "$$script"; \
+					rm "$$script"; \
+				else \
+					echo removing "$$f"; \
+					rm "$$f"; \
+				fi; \
+			fi; \
+		done; \
+	fi
+
 clean:
 	rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
 		$(LIB_FILE) $(XDIFF_LIB)
-- 
1.4.4.4.g774d-dirty

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]