Makefile: NO_INSTALL_HARDLINKS

Your filesystem may support hardlinks, but you may choose not to use them when installing git-foo builtins and favor symblic links or copies for whatever reason. The installation procedure of git-gui/ directory is not touched with this patch and git-citool still ends up being a hardlink to git-gui, but it needs to be addressed separately. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed May 2, 2012 at 15:12 UTC 70de5e65e8c947626ab9aa2aeb790fd969951bc2
1 file changed +11 -1
Makefile
+11 -1
@@ -244,6 +244,9 @@ all::
244 # Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed
245 # programs as a tar, where bin/ and libexec/ might be on different file systems.
246 #
247 +# Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or
248 +# copies to install built-in git commands e.g. git-cat-file.
249 +#
250 # Define USE_NED_ALLOCATOR if you want to replace the platforms default
251 # memory allocators with the nedmalloc allocator written by Niall Douglas.
252 #
@@ -1777,6 +1780,10 @@ ifdef ASCIIDOC7
1780 export ASCIIDOC7
1781 endif
1782
1783 +ifdef NO_INSTALL_HARDLINKS
1784 + export NO_INSTALL_HARDLINKS
1785 +endif
1786 +
1787 ### profile feedback build
1788 #
1789
@@ -2482,19 +2489,21 @@ endif
2489 { test "$$bindir/" = "$$execdir/" || \
2490 for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
2491 $(RM) "$$execdir/$$p" && \
2485 - test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
2492 + test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
2493 ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
2494 cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
2495 done; \
2496 } && \
2497 for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
2498 $(RM) "$$bindir/$$p" && \
2499 + test -z "$(NO_INSTALL_HARDLINKS)" && \
2500 ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2501 ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2502 cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
2503 done && \
2504 for p in $(BUILT_INS); do \
2505 $(RM) "$$execdir/$$p" && \
2506 + test -z "$(NO_INSTALL_HARDLINKS)" && \
2507 ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2508 ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2509 cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
@@ -2502,6 +2511,7 @@ endif
2511 remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
2512 for p in $$remote_curl_aliases; do \
2513 $(RM) "$$execdir/$$p" && \
2514 + test -z "$(NO_INSTALL_HARDLINKS)" && \
2515 ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
2516 ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
2517 cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \