* [PATCH] Makefile: USE_SYMLINK option
@ 2007-06-30 18:14 Matthias Lederhofer
2007-06-30 18:46 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Matthias Lederhofer @ 2007-06-30 18:14 UTC (permalink / raw)
To: git
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Makefile: USE_SYMLINK option
2007-06-30 18:14 [PATCH] Makefile: USE_SYMLINK option Matthias Lederhofer
@ 2007-06-30 18:46 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2007-06-30 18:46 UTC (permalink / raw)
To: Matthias Lederhofer; +Cc: git
Matthias Lederhofer <matled@gmx.net> writes:
> I found no real drawback using symlinks and symlinks are sometimes
> more practical, for example when copying/creating a tarball of the
> installation.
Well, tar handles hard links just fine, thanks. The real
drawbacks of doing symlinks people often cite (and I agree to)
are that they can become dangling, and they consume i-nodes.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-30 18:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-30 18:14 [PATCH] Makefile: USE_SYMLINK option Matthias Lederhofer
2007-06-30 18:46 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).