git-gui: Track our own embedded values and rebuild when they change
Like core-Git we now track the values that we embed into our shell script wrapper, and we "recompile" that wrapper if they are changed. This concept was lifted from git.git's Makefile, where a similar thing was done by Eygene Ryabinkin. Too bad it wasn't just done here in git-gui from the beginning, as the git.git Makefile support for GIT-GUI-VARS was really just because git-gui doesn't do it on its own. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Apr 29, 2007 at 03:02 UTC
c6a5e4030320c934bca70471d04aa9e7d8e2cd67
2 files changed
+16
-2
.gitignore
+1
@@ -1,3 +1,4 @@
1
GIT-VERSION-FILE
2
+GIT-GUI-VARS
3
git-citool
4
git-gui
Makefile
+15
-2
@@ -53,7 +53,19 @@ $(GITGUI_BUILT_INS): git-gui
53
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
54
55
# These can record GITGUI_VERSION
56
-$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE
56
+$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE GIT-GUI-VARS
57
+
58
+TRACK_VARS = \
59
+ $(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \
60
+ $(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \
61
+#end TRACK_VARS
62
+
63
+GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
64
+ @VARS='$(TRACK_VARS)'; \
65
+ if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
66
+ echo 1>&2 " * new locations or Tcl/Tk interpreter"; \
67
+ echo 1>$@ "$$VARS"; \
68
+ fi
69
70
all:: $(ALL_PROGRAMS)
71
@@ -67,7 +79,8 @@ dist-version:
79
@echo $(GITGUI_VERSION) > $(TARDIR)/version
80
81
clean::
70
- rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE
82
+ rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE GIT-GUI-VARS
83
84
.PHONY: all install dist-version clean
85
.PHONY: .FORCE-GIT-VERSION-FILE
86
+.PHONY: .FORCE-GIT-GUI-VARS