1# The default target of this Makefile is...
2all::
3
4prefix ?= $(HOME)
5bindir ?= $(prefix)/bin
6TCLTK_PATH ?= wish
7INSTALL ?= install
8RM ?= rm -f
9
10DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
11bindir_SQ = $(subst ','\'',$(bindir))
12TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
13
14ifndef V
15 QUIET = @
16 QUIET_GEN = $(QUIET)echo ' ' GEN $@ &&
17endif
18
19all:: gitk-wish
20install:: all
21 $(INSTALL) gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
22clean::
23 $(RM) gitk-wish
24
25gitk-wish: gitk
26 $(QUIET_GEN)$(RM) $@ $@+ && \
27 sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
28 chmod +x $@+ && \
29 mv -f $@+ $@