summaryrefslogtreecommitdiff
path: root/git-gui/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'git-gui/Makefile')
-rw-r--r--git-gui/Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/git-gui/Makefile b/git-gui/Makefile
index ee564219c0..3de0de1a23 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -22,7 +22,7 @@ ifndef gitexecdir
endif
ifndef sharedir
- sharedir := $(dir $(gitexecdir))/share
+ sharedir := $(dir $(gitexecdir))share
endif
ifndef INSTALL
@@ -53,12 +53,19 @@ TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
libdir ?= $(sharedir)/git-gui/lib
libdir_SQ = $(subst ','\'',$(libdir))
+exedir = $(dir $(gitexecdir))share/git-gui/lib
+exedir_SQ = $(subst ','\'',$(exedir))
+
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
$(QUIET_GEN)rm -f $@ $@+ && \
+ if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \
+ GITGUI_RELATIVE=1; \
+ fi && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
- -e 's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \
+ -e 's|@@GITGUI_RELATIVE@@|'$$GITGUI_RELATIVE'|' \
+ -e $$GITGUI_RELATIVE's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \
$@.sh >$@+ && \
chmod +x $@+ && \
mv $@+ $@
@@ -88,6 +95,7 @@ TRACK_VARS = \
$(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \
$(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \
$(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \
+ $(subst ','\'',gitexecdir='$(gitexecdir_SQ)') \
$(subst ','\'',libdir='$(libdir_SQ)') \
#end TRACK_VARS