Makefile: install hardlinks for git-remote-<scheme> supported by libcurl if possible
Instead of installing/copying three programs separately, just install one and try to make hardlinks to the other two. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Aug 7, 2009 at 12:09 UTC
ad17f01399a9220b78678b322bd42b0a29898e01
1 file changed
+9
-2
Makefile
+9
-2
@@ -383,7 +383,8 @@ BUILT_INS += git-stage$X
383
BUILT_INS += git-status$X
384
BUILT_INS += git-whatchanged$X
385
386
-# what 'all' will build and 'install' will install, in gitexecdir
386
+# what 'all' will build and 'install' will install in gitexecdir,
387
+# excluding programs for built-in commands
388
ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
389
390
# what 'all' will build but not install in gitexecdir
@@ -1661,7 +1662,7 @@ export gitexec_instdir
1662
install: all
1663
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
1664
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
1664
- $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
1665
+ $(INSTALL) $(filter-out $(CURL_SYNONYMS), $(ALL_PROGRAMS)) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
1666
$(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X git-cvsserver '$(DESTDIR_SQ)$(bindir_SQ)'
1667
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
1668
ifndef NO_PERL
@@ -1687,6 +1688,12 @@ endif
1688
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
1689
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
1690
done; } && \
1691
+ { for p in $(CURL_SYNONYMS); do \
1692
+ $(RM) "$$execdir/$$p" && \
1693
+ ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
1694
+ ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
1695
+ cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \
1696
+ done; } && \
1697
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
1698
1699
install-doc: