1# Set the installation directories; this section is needed only in
2# gitk.git but probably not in git.git.
3ifndef gitexecdir
4 gitexecdir := $(shell git --exec-path)
5endif
6ifndef sharedir
7 sharedir := $(dir $(gitexecdir))share
8endif
9
10# From here on, these are needed in git.git/gitk/Makefile.
11gitk_libdir ?= $(sharedir)/gitk/lib
12msgsdir ?= $(gitk_libdir)/msgs
13msgsdir_SQ = $(subst ','\'',$(msgsdir))
14
15## Beginning of po-file creation rules
16XGETTEXT ?= xgettext
17MSGFMT ?= msgfmt
18PO_TEMPLATE = po/gitk.pot
19ALL_POFILES = $(wildcard po/*.po)
20ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
21
22all:: $(ALL_MSGFILES)
23
24$(PO_TEMPLATE): gitk
25 $(XGETTEXT) -kmc -LTcl -o $@ gitk
26update-po:: $(PO_TEMPLATE)
27 $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
28$(ALL_MSGFILES): %.msg : %.po
29 @echo Generating catalog $@
30 $(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
31
32clean::
33 rm -f $(ALL_PROGRAMS) po/*.msg
34## End of po-file creation rules
35
36# Install rules for po-files
37install: all
38 $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
39 $(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
40
41uninstall:
42 $(QUIET)$(foreach p,$(ALL_MSGFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
43 $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(REMOVE_D1)
44 $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(REMOVE_D1)
45 $(QUIET)$(REMOVE_D0)`dirname '$(DESTDIR_SQ)$(libdir_SQ)'` $(REMOVE_D1)