summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEygene Ryabinkin <rea-git@codelabs.ru>2007-03-28 04:22:02 -0700
committerJunio C Hamano <junkio@cox.net>2007-03-31 23:59:47 -0700
commit6bdb18a9cef9124937941c6e5bd2b645c9da6537 (patch)
tree2f9cc1b6662eb55f247b9071f2d95905ae3e8275 /Makefile
parent81b63c707ed5962d45bd575c946a7127c19a3e35 (diff)
downloadgit-6bdb18a9cef9124937941c6e5bd2b645c9da6537.tar.gz
Rewrite Tcl/Tk interpreter path for the GUI tools.
--with-tcltk=/path/to/wish sets the TCLTK_PATH variable that is used to substitute the location of the wish interpreter in the Tcl/Tk programs. New tracking file, GIT-GUI-VARS, was introduced: it tracks the location of the Tcl/Tk interpreter and activates the GUI tools rebuild if the interpreter path was changed. The separate tracker is better than the GIT-CFLAGS: there is no need to rebuild the whole git if the interpreter path was changed. Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 24 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index da086a7fed..88f9025e4c 100644
--- a/Makefile
+++ b/Makefile
@@ -241,7 +241,7 @@ ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
# what 'all' will build but not install in gitexecdir
OTHER_PROGRAMS = git$X gitweb/gitweb.cgi
ifndef NO_TCLTK
-OTHER_PROGRAMS += gitk
+OTHER_PROGRAMS += gitk-wish
endif
# Backward compatibility -- to be removed after 1.0
@@ -694,6 +694,12 @@ endif
strip: $(PROGRAMS) git$X
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
+gitk-wish: gitk GIT-GUI-VARS
+ $(QUIET_GEN)rm -f $@ $@+ && \
+ sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
+ chmod +x $@+ && \
+ mv -f $@+ $@
+
git$X: git.c common-cmds.h $(BUILTIN_OBJS) $(GITLIBS) GIT-CFLAGS
$(QUIET_LINK)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \
$(ALL_CFLAGS) -o $@ $(filter %.c,$^) \
@@ -872,6 +878,20 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS
echo "$$FLAGS" >GIT-CFLAGS; \
fi
+### Detect Tck/Tk interpreter path changes
+ifndef NO_TCLTK
+TRACK_VARS = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')
+
+GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
+ @VARS='$(TRACK_VARS)'; \
+ if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
+ echo 1>&2 " * new Tcl/Tk interpreter location"; \
+ echo "$$VARS" >$@; \
+ fi
+
+.PHONY: .FORCE-GIT-GUI-VARS
+endif
+
### Testing rules
# GNU make supports exporting all variables by "export" without parameters.
@@ -916,7 +936,7 @@ install: all
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
$(MAKE) -C perl prefix='$(prefix_SQ)' install
ifndef NO_TCLTK
- $(INSTALL) gitk '$(DESTDIR_SQ)$(bindir_SQ)'
+ $(INSTALL) gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
$(MAKE) -C git-gui install
endif
if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \
@@ -1000,9 +1020,10 @@ clean:
$(MAKE) -C templates/ clean
$(MAKE) -C t/ clean
ifndef NO_TCLTK
+ rm -f gitk-wish
$(MAKE) -C git-gui clean
endif
- rm -f GIT-VERSION-FILE GIT-CFLAGS
+ rm -f GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS
.PHONY: all install clean strip
.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS