Merge branch 'js/export-with-assignment'
[git] / gitk-git / Makefile
1 # The default target of this Makefile is...
2 all::
3
4 prefix ?= $(HOME)
5 bindir ?= $(prefix)/bin
6 TCLTK_PATH ?= wish
7 INSTALL ?= install
8 RM ?= rm -f
9
10 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
11 bindir_SQ = $(subst ','\'',$(bindir))
12 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
13
14 ifndef V
15         QUIET          = @
16         QUIET_GEN      = $(QUIET)echo '   ' GEN $@ &&
17 endif
18
19 all:: gitk-wish
20 install:: all
21         $(INSTALL) gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
22 clean::
23         $(RM) gitk-wish
24
25 gitk-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 $@+ $@