3 # Define V=1 to have a more verbose compile.
6 GIT-VERSION-FILE
: .FORCE-GIT-VERSION-FILE
7 @
$(SHELL_PATH
) .
/GIT-VERSION-GEN
8 -include GIT-VERSION-FILE
10 SCRIPT_SH
= git-gui.sh
11 GITGUI_BUILT_INS
= git-citool
12 ALL_PROGRAMS
= $(GITGUI_BUILT_INS
) $(patsubst %.sh
,%,$(SCRIPT_SH
))
13 ALL_LIBFILES
= $(wildcard lib
/*.tcl
)
20 gitexecdir
:= $(shell git
--exec-path
)
24 sharedir
:= $(dir $(gitexecdir
))/share
32 QUIET_GEN
= @echo
' ' GEN
$@
;
33 QUIET_BUILT_IN
= @echo
' ' BUILTIN
$@
;
34 QUIET_INDEX
= @echo
' ' INDEX
$(dir $@
);
40 ifeq ($(findstring $(MAKEFLAGS
),s
),s
)
45 DESTDIR_SQ
= $(subst ','\'',$(DESTDIR))
46 gitexecdir_SQ = $(subst ','\'',$(gitexecdir
))
47 SHELL_PATH_SQ
= $(subst ','\'',$(SHELL_PATH))
48 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH
))
50 libdir ?
= $(sharedir
)/git-gui
/lib
51 libdir_SQ
= $(subst ','\'',$(libdir))
53 $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
54 $(QUIET_GEN)rm -f $@ $@+ && \
55 sed -e '1s|
#!.*/sh|#!$(SHELL_PATH_SQ)|' \
56 -e
's|^exec wish "$$0"|exec $(subst |,'\|
',$(TCLTK_PATH_SQ)) "$$0"|' \
57 -e
's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
58 -e
's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \
63 $(GITGUI_BUILT_INS
): git-gui
64 $(QUIET_BUILT_IN
)rm -f
$@
&& ln git-gui
$@
66 lib
/tclIndex
: $(ALL_LIBFILES
)
68 source lib
/class.tcl \
; \
69 auto_mkindex lib
'*.tcl' \
72 # These can record GITGUI_VERSION
73 $(patsubst %.sh
,%,$(SCRIPT_SH
)): GIT-VERSION-FILE GIT-GUI-VARS
76 $(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ
)') \
77 $(subst ','\'',TCLTK_PATH
='$(TCLTK_PATH_SQ)') \
78 $(subst ','\'',libdir='$(libdir_SQ
)') \
81 GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
82 @VARS='$(TRACK_VARS
)'; \
83 if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
84 echo 1>&2 " * new locations or Tcl/Tk interpreter"; \
88 all:: $(ALL_PROGRAMS) lib/tclIndex
91 $(INSTALL) -d -m755 '$(DESTDIR_SQ
)$(gitexecdir_SQ
)'
92 $(INSTALL) git-gui '$(DESTDIR_SQ
)$(gitexecdir_SQ
)'
93 $(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ
)$(gitexecdir_SQ
)/$p' && ln '$(DESTDIR_SQ
)$(gitexecdir_SQ
)/git-gui
' '$(DESTDIR_SQ
)$(gitexecdir_SQ
)/$p' ;)
94 $(INSTALL) -d -m755 '$(DESTDIR_SQ
)$(libdir_SQ
)'
95 $(INSTALL) -m644 lib/tclIndex '$(DESTDIR_SQ
)$(libdir_SQ
)'
96 $(foreach p,$(ALL_LIBFILES), $(INSTALL) -m644 $p '$(DESTDIR_SQ
)$(libdir_SQ
)' ;)
100 @echo $(GITGUI_VERSION) > $(TARDIR)/version
103 rm -f $(ALL_PROGRAMS) lib/tclIndex
104 rm -f GIT-VERSION-FILE GIT-GUI-VARS
106 .PHONY: all install dist-version clean
107 .PHONY: .FORCE-GIT-VERSION-FILE
108 .PHONY: .FORCE-GIT-GUI-VARS