hg-to-git: improve popen calls
[git/spearce.git] / gitk-git / Makefile
blobae2b80b1083c18c6b0a15959fee304b6c43b3792
1 # The default target of this Makefile is...
2 all::
4 prefix ?= $(HOME)
5 bindir ?= $(prefix)/bin
6 sharedir ?= $(prefix)/share
7 gitk_libdir ?= $(sharedir)/gitk/lib
8 msgsdir ?= $(gitk_libdir)/msgs
9 msgsdir_SQ = $(subst ','\'',$(msgsdir))
11 TCLTK_PATH ?= wish
12 INSTALL ?= install
13 RM ?= rm -f
15 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
16 bindir_SQ = $(subst ','\'',$(bindir))
17 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
19 ## po-file creation rules
20 XGETTEXT ?= xgettext
21 ifdef NO_MSGFMT
22 MSGFMT ?= $(TCL_PATH) po/po2msg.sh
23 else
24 MSGFMT ?= msgfmt
25 endif
27 PO_TEMPLATE = po/gitk.pot
28 ALL_POFILES = $(wildcard po/*.po)
29 ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
31 ifndef V
32 QUIET = @
33 QUIET_GEN = $(QUIET)echo ' ' GEN $@ &&
34 endif
36 all:: gitk-wish $(ALL_MSGFILES)
38 install:: all
39 $(INSTALL) gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
40 $(INSTALL) -d '$(DESTDIR_SQ)$(msgsdir_SQ)'
41 $(foreach p,$(ALL_MSGFILES), $(INSTALL) $p '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
43 uninstall::
44 $(foreach p,$(ALL_MSGFILES), $(RM) '$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) &&) true
45 $(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
47 clean::
48 $(RM) gitk-wish po/*.msg
50 gitk-wish: gitk
51 $(QUIET_GEN)$(RM) $@ $@+ && \
52 sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
53 chmod +x $@+ && \
54 mv -f $@+ $@
56 $(PO_TEMPLATE): gitk
57 $(XGETTEXT) -kmc -LTcl -o $@ gitk
58 update-po:: $(PO_TEMPLATE)
59 $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
60 $(ALL_MSGFILES): %.msg : %.po
61 @echo Generating catalog $@
62 $(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)