1 # The default target of this Makefile is...
5 bindir ?= $(prefix)/bin
6 sharedir ?= $(prefix)/share
7 gitk_libdir ?= $(sharedir)/gitk/lib
8 msgsdir ?= $(gitk_libdir)/msgs
9 msgsdir_SQ = $(subst ','\'',$(msgsdir))
15 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
16 bindir_SQ = $(subst ','\'',$(bindir))
17 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
19 ## po-file creation rules
22 PO_TEMPLATE = po/gitk.pot
23 ALL_POFILES = $(wildcard po/*.po)
24 ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
28 QUIET_GEN = $(QUIET)echo ' ' GEN $@ &&
31 all:: gitk-wish $(ALL_MSGFILES)
34 $(INSTALL) gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
35 $(INSTALL) -d '$(DESTDIR_SQ)$(msgsdir_SQ)'
36 $(foreach p,$(ALL_MSGFILES), $(INSTALL) $p '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
39 $(foreach p,$(ALL_MSGFILES), $(RM) '$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) &&) true
40 $(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
43 $(RM) gitk-wish po/*.msg
46 $(QUIET_GEN)$(RM) $@ $@+ && \
47 sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
52 $(XGETTEXT) -kmc -LTcl -o $@ gitk
53 update-po:: $(PO_TEMPLATE)
54 $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
55 $(ALL_MSGFILES): %.msg : %.po
56 @echo Generating catalog $@
57 $(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)