This target allows you to have git installed in one location,
and have symbolic links to all of the programs installed in
another location. For example, if git was installed to /opt/git
withmake prefix=/opt/git install
you can install symbolic links in /usr/local/bin with
make symlinkprefix=/usr/local prefix=/opt/git \
install-symlinksThis makes it reasonably easy to remove such a package, by doing
rm -rf /opt/git
and then removing stale links with
find /usr/local -xtype l -print0|xargs -0 rm
(be sure to first see whether you indeed get only stale links listed).
This works by copying the directory hierarchy of $prefix to
$symlinkprefix (not copying or descending to any directories of the
name git* matched case-insensitively), then linking all the rest.Signed-off-by: David Kastrup <dak@gnu.org>
---
Makefile | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)diff --git a/Makefile b/Makefile
index 73b487f..7e53378 100644
--- a/Makefile
+++ b/Makefile
@@ -142,6 +142,7 @@ ALL_LDFLAGS = $(LDFLAGS)
STRIP ?= stripprefix = $(HOME)
+symlinkprefix = /usr/local
bindir = $(prefix)/bin
gitexecdir = $(bindir)
sharedir = $(prefix)/share
@@ -996,7 +997,13 @@ install-doc:
quick-install-doc:
$(MAKE) -C Documentation quick-install-
+# The somewhat strange looking lines start with an ignored $(MAKE) in
+# order to be executed also in make -n calls.
+install-symlinks:
+ @: $(MAKE) && cd '$(prefix_SQ)' && find . -type d ! \( -iname 'git*' -prune \) -exec echo $(INSTALL) -m 755 -d '$(symlinkprefix)/{}' \;
+ @cd '$(prefix_SQ)' && find . -type d ! \( -iname 'git*' -prune \) -exec $(INSTALL) -m 755 -d '$(symlinkprefix)/{}' \;
+ @: $(MAKE) && cd '$(prefix_SQ)' && find . \( -type d -iname 'git*' -prune -o ! -type d \) -exec echo $(RM) -r '$(symlinkprefix)/{}' \; -exec echo ln -s '$(prefix_SQ)/{}' '$(symlinkprefix)/{}' \;
+ @cd '$(prefix_SQ)' && find . \( -type d -iname 'git*' -prune...
Some people might prefer to be able to specify the find utility to
use, in particular for the more complicated usage in the
install-symlinks target.Signed-off-by: David Kastrup <dak@gnu.org>
---
Makefile | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)diff --git a/Makefile b/Makefile
index 7e53378..cf72327 100644
--- a/Makefile
+++ b/Makefile
@@ -178,6 +178,7 @@ AR = ar
RM = rm -f
TAR = tar
INSTALL = install
+FIND = find
RPMBUILD = rpmbuild
TCL_PATH = tclsh
TCLTK_PATH = wish
@@ -904,11 +905,11 @@ doc:TAGS:
$(RM) TAGS
- find . -name '*.[hcS]' -print | xargs etags -a
+ $(FIND) . -name '*.[hcS]' -print | xargs etags -atags:
$(RM) tags
- find . -name '*.[hcS]' -print | xargs ctags -a
+ $(FIND) . -name '*.[hcS]' -print | xargs ctags -a### Detect prefix changes
TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
@@ -1000,10 +1001,10 @@ quick-install-doc:
# The somewhat strange looking lines start with an ignored $(MAKE) in
# order to be executed also in make -n calls.
install-symlinks:
- @: $(MAKE) && cd '$(prefix_SQ)' && find . -type d ! \( -iname 'git*' -prune \) -exec echo $(INSTALL) -m 755 -d '$(symlinkprefix)/{}' \;
- @cd '$(prefix_SQ)' && find . -type d ! \( -iname 'git*' -prune \) -exec $(INSTALL) -m 755 -d '$(symlinkprefix)/{}' \;
- @: $(MAKE) && cd '$(prefix_SQ)' && find . \( -type d -iname 'git*' -prune -o ! -type d \) -exec echo $(RM) -r '$(symlinkprefix)/{}' \; -exec echo ln -s '$(prefix_SQ)/{}' '$(symlinkprefix)/{}' \;
- @cd '$(prefix_SQ)' && find . \( -type d -iname 'git*' -prune -o ! -type d \) -exec $(RM) -r '$(symlinkprefix)/{}' \; -exec ln -s '$(prefix_SQ)/{}' '$(symlinkprefix)/{}' \;
+ @: $(MAKE) && cd '$(prefix_SQ)' && $(FIND) . -type d ! \( -iname 'git*' -prune \) -exec echo $(INSTALL) -m 755 -d '$(symlinkprefix)/{}' \;
+ @cd '$(prefix_SQ)' && $(FIND) . -type d ! \( -iname 'git*' -prune \) -exec $(INSTALL) -m 755 -d '$(symlinkpre...
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Nigel Cunningham | Re: [PATCH] Remove process freezer from suspend to RAM pathway |
| Paul Mundt | Re: 2.6.22-rc4-mm2 |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
git: | |
| Arjan van de Ven | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Natalie Protasevich | [BUG] New Kernel Bugs |
