diff options
author | Junio C Hamano <junkio@cox.net> | 2007-05-17 16:52:45 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-05-17 16:52:45 -0700 |
commit | e986e26a86616054f96373280e8f9cc89d7ea8ca (patch) | |
tree | 9a7192bd9f97ee049d3c73f76385d883d2055339 /git-gui/Makefile | |
parent | 2eb54efc6c12cb20403db9a4739bd736c3bfaad1 (diff) | |
parent | b9e7efb8b5f7d424466dd1ce61fd20658f60543f (diff) | |
download | git-e986e26a86616054f96373280e8f9cc89d7ea8ca.tar.gz git-e986e26a86616054f96373280e8f9cc89d7ea8ca.tar.xz |
Merge branch 'master' of git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui:
git-gui: Gracefully handle bad TCL_PATH at compile time
Diffstat (limited to 'git-gui/Makefile')
-rw-r--r-- | git-gui/Makefile | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/git-gui/Makefile b/git-gui/Makefile index e73b6453d..ee564219c 100644 --- a/git-gui/Makefile +++ b/git-gui/Makefile @@ -11,6 +11,7 @@ SCRIPT_SH = git-gui.sh GITGUI_BUILT_INS = git-citool ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH)) ALL_LIBFILES = $(wildcard lib/*.tcl) +PRELOAD_FILES = lib/class.tcl ifndef SHELL_PATH SHELL_PATH = /bin/sh @@ -32,6 +33,7 @@ ifndef V QUIET_GEN = @echo ' ' GEN $@; QUIET_BUILT_IN = @echo ' ' BUILTIN $@; QUIET_INDEX = @echo ' ' INDEX $(dir $@); + QUIET_2DEVNULL = 2>/dev/null endif TCL_PATH ?= tclsh @@ -45,6 +47,7 @@ endif DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) +TCL_PATH_SQ = $(subst ','\'',$(TCL_PATH)) TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) libdir ?= $(sharedir)/git-gui/lib @@ -64,16 +67,26 @@ $(GITGUI_BUILT_INS): git-gui $(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@ lib/tclIndex: $(ALL_LIBFILES) - $(QUIET_INDEX)echo \ - source lib/class.tcl \; \ + $(QUIET_INDEX)if echo \ + $(foreach p,$(PRELOAD_FILES),source $p\;) \ auto_mkindex lib '*.tcl' \ - | $(TCL_PATH) + | $(TCL_PATH) $(QUIET_2DEVNULL); then : ok; \ + else \ + echo 1>&2 " * $(TCL_PATH) failed; using unoptimized loading"; \ + rm -f $@ ; \ + echo '# Autogenerated by git-gui Makefile' >$@ && \ + echo >>$@ && \ + $(foreach p,$(PRELOAD_FILES) $(ALL_LIBFILES),echo '$(subst lib/,,$p)' >>$@ &&) \ + echo >>$@ ; \ + fi # These can record GITGUI_VERSION $(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE GIT-GUI-VARS +lib/tclIndex: GIT-GUI-VARS TRACK_VARS = \ $(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \ + $(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \ $(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \ $(subst ','\'',libdir='$(libdir_SQ)') \ #end TRACK_VARS |