Makefile: link builtins residing in bin directory to main git binary too
authorBrandon Casey <redacted>
Fri, 23 Jul 2010 17:50:44 +0000 (12:50 -0500)
committerJunio C Hamano <redacted>
Mon, 26 Jul 2010 05:33:23 +0000 (22:33 -0700)
To conserve space/improve file caching we try to make hard or symbolic links
from each builtin program to the main git executable rather than having
each be a complete duplicate copy of it.  We weren't doing this for the
builtin programs residing in the bin directory though.  So, let's do so.

Signed-off-by: Brandon Casey <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Makefile

index bc3c57058faba66f6a7a947e1e9642f47053b5bb..d725c1532f2605bcf1c71dc2735bd2b3b7d1f515 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2079,6 +2079,12 @@ endif
                test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
                ln "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \
                cp "$$bindir/git$X" "$$execdir/git$X"; } ; } && \
+       for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
+               $(RM) "$$bindir/$$p" && \
+               ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
+               ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
+               cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
+       done && \
        for p in $(BUILT_INS); do \
                $(RM) "$$execdir/$$p" && \
                ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
git clone https://git.99rst.org/PROJECT