[PATCH] Makefile: add clean-obsolete-scripts target
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 10, 2007, 12:20 UTC
- Message-ID
- <Pine.LNX.4.63.0701101319480.22628@wbgn013.biozentrum.uni-wuerzburg.de>
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@gmx.de> --- 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