summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Stimming <stimming@tuhh.de>2007-11-07 17:39:08 (GMT)
committerPaul Mackerras <paulus@samba.org>2007-12-19 23:19:07 (GMT)
commit25ec9384844d0cc855cf16672f61cf6b3be9f67d (patch)
tree2b7c306ebf76826a0a1fdd608ead1dbea695ae0e /Makefile
parent7388bcbc5431552718dde5c3259d861d2fa75a12 (diff)
downloadgit-25ec9384844d0cc855cf16672f61cf6b3be9f67d.zip
git-25ec9384844d0cc855cf16672f61cf6b3be9f67d.tar.gz
git-25ec9384844d0cc855cf16672f61cf6b3be9f67d.tar.bz2
[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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..38154b6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+# Set the installation directories; this section is needed only in
+# gitk.git but probably not in git.git.
+ifndef gitexecdir
+ gitexecdir := $(shell git --exec-path)
+endif
+ifndef sharedir
+ sharedir := $(dir $(gitexecdir))share
+endif
+
+# From here on, these are needed in git.git/gitk/Makefile.
+gitk_libdir ?= $(sharedir)/gitk/lib
+msgsdir ?= $(gitk_libdir)/msgs
+msgsdir_SQ = $(subst ','\'',$(msgsdir))
+
+## Beginning of po-file creation rules
+XGETTEXT ?= xgettext
+MSGFMT ?= msgfmt
+PO_TEMPLATE = po/gitk.pot
+ALL_POFILES = $(wildcard po/*.po)
+ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
+
+all:: $(ALL_MSGFILES)
+
+$(PO_TEMPLATE): gitk
+ $(XGETTEXT) -kmc -LTcl -o $@ gitk
+update-po:: $(PO_TEMPLATE)
+ $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
+$(ALL_MSGFILES): %.msg : %.po
+ @echo Generating catalog $@
+ $(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
+
+clean::
+ rm -f $(ALL_PROGRAMS) po/*.msg
+## End of po-file creation rules
+
+# Install rules for po-files
+install: all
+ $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
+ $(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
+
+uninstall:
+ $(QUIET)$(foreach p,$(ALL_MSGFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
+ $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(REMOVE_D1)
+ $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(REMOVE_D1)
+ $(QUIET)$(REMOVE_D0)`dirname '$(DESTDIR_SQ)$(libdir_SQ)'` $(REMOVE_D1)