@matheusbsbs / matheus-bagliano / commits / 25ec938484
Fork 0

[PATCH] gitk i18n: Add Makefile with rules for po file creation and installation

The compiled .msg files will be installed into $(sharedir)/gitk/lib/msgs according to Junio's mailing list proposal on 2007-07-28. Signed-off-by: Christian Stimming <stimming@tuhh.de> Signed-off-by: Paul Mackerras <paulus@samba.org>

Christian Stimming committed Nov 7, 2007 at 18:39 UTC 25ec9384844d0cc855cf16672f61cf6b3be9f67d
1 file changed +45
Makefile new
+45
@@ -0,0 +1,45 @@
1 +# Set the installation directories; this section is needed only in
2 +# gitk.git but probably not in git.git.
3 +ifndef gitexecdir
4 + gitexecdir := $(shell git --exec-path)
5 +endif
6 +ifndef sharedir
7 + sharedir := $(dir $(gitexecdir))share
8 +endif
9 +
10 +# From here on, these are needed in git.git/gitk/Makefile.
11 +gitk_libdir ?= $(sharedir)/gitk/lib
12 +msgsdir ?= $(gitk_libdir)/msgs
13 +msgsdir_SQ = $(subst ','\'',$(msgsdir))
14 +
15 +## Beginning of po-file creation rules
16 +XGETTEXT ?= xgettext
17 +MSGFMT ?= msgfmt
18 +PO_TEMPLATE = po/gitk.pot
19 +ALL_POFILES = $(wildcard po/*.po)
20 +ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
21 +
22 +all:: $(ALL_MSGFILES)
23 +
24 +$(PO_TEMPLATE): gitk
25 + $(XGETTEXT) -kmc -LTcl -o $@ gitk
26 +update-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 +
32 +clean::
33 + rm -f $(ALL_PROGRAMS) po/*.msg
34 +## End of po-file creation rules
35 +
36 +# Install rules for po-files
37 +install: 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 +
41 +uninstall:
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)