Code

Merge branch 'maint'
[git.git] / git-gui / Makefile
index fd82d9d16dd17d1030c4414f6a30af56ed4deaa1..b29d7d1e68d2489fd07612c8d0062d3491f04719 100644 (file)
@@ -1,5 +1,8 @@
 all::
 
+# Define V=1 to have a more verbose compile.
+#
+
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
 -include GIT-VERSION-FILE
@@ -20,20 +23,34 @@ ifndef INSTALL
        INSTALL = install
 endif
 
+ifndef V
+       QUIET_GEN      = @echo '   ' GEN $@;
+       QUIET_BUILT_IN = @echo '   ' BUILTIN $@;
+endif
+
+TCLTK_PATH ?= wish
+
+ifeq ($(findstring $(MAKEFLAGS),s),s)
+QUIET_GEN =
+QUIET_BUILT_IN =
+endif
+
 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
+TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
 
 $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
-       rm -f $@ $@+
+       $(QUIET_GEN)rm -f $@ $@+ && \
        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' \
-               $@.sh >$@+
-       chmod +x $@+
+               $@.sh >$@+ && \
+       chmod +x $@+ && \
        mv $@+ $@
 
 $(GITGUI_BUILT_INS): git-gui
-       rm -f $@ && ln git-gui $@
+       $(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
 
 # These can record GITGUI_VERSION
 $(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE