git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Makefile: USE_SYMLINK option

From
MLMatthias Lederhofer <matled@gmx.net>
Date
Jun 30, 2007, 18:14 UTC
Message-ID
<20070630181456.GA15035@moooo.ath.cx>
When USE_SYMLINK is defined symlinks will be used instead of hardlinks.
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
---
I found no real drawback using symlinks and symlinks are sometimes
more practical, for example when copying/creating a tarball of the
installation.
---
 Makefile |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 4ea5e45..db0b818 100644
--- a/Makefile
+++ b/Makefile
@@ -181,6 +181,11 @@ INSTALL = install
 RPMBUILD = rpmbuild
 TCL_PATH = tclsh
 TCLTK_PATH = wish
+ifdef USE_SYMLINK
+LN = ln -s
+else
+LN = ln
+endif
 
 export TCL_PATH TCLTK_PATH
 
@@ -759,10 +764,10 @@ git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
 help.o: common-cmds.h
 
 git-merge-subtree$X: git-merge-recursive$X
-	$(QUIET_BUILT_IN)rm -f $@ && ln git-merge-recursive$X $@
+	$(QUIET_BUILT_IN)rm -f $@ && $(LN) git-merge-recursive$X $@
 
 $(BUILT_INS): git$X
-	$(QUIET_BUILT_IN)rm -f $@ && ln git$X $@
+	$(QUIET_BUILT_IN)rm -f $@ && $(LN) git$X $@
 
 common-cmds.h: ./generate-cmdlist.sh
 
@@ -1004,12 +1009,16 @@ ifndef NO_TCLTK
 endif
 	if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \
 	then \
-		ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
+		$(LN) -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
 			'$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \
 		cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
 			'$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \
 	fi
-	$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
+ifdef USE_SYMLINK
+	$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && $(LN) 'git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
+else
+	$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && $(LN) '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
+endif
 ifneq (,$X)
 	$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
 endif
-- 
1.5.0.3
Next: Junio C Hamano
Message 1 of 2 in “Makefile: USE_SYMLINK option”
  1. Makefile: USE_SYMLINK optionMatthias Lederhofer, Jun 30, 2007
  2. Junio C HamanoJun 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.