[PATCH] gitk.git: Add Makefile with rules for po file creation.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Christian Stimming <stimming@xxxxxxx>
---
Similar to the previous patch with the message markup, this one has also been created against the kernel.org gitk.git. These would be the necessary Makefile rules for string extraction by gettext.

 Makefile |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d7b75fb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+# Set the installation directories; this section is needed only in
+# gitk.git but not in git.git.
+ifndef gitexecdir
+	gitexecdir := $(shell git --exec-path)
+endif
+ifndef sharedir
+	sharedir := $(dir $(gitexecdir))share
+endif
+
+# From here on, all is needed in git.git/Makefile.
+libdir   ?= $(sharedir)/gitk/lib
+msgsdir    ?= $(libdir)/msgs
+msgsdir_SQ  = $(subst ','\'',$(msgsdir))
+
+## Beginning of po-file creation rules
+XGETTEXT   ?= xgettext
+PO_TEMPLATE = po/gitk.pot
+ALL_POFILES = $(wildcard po/*.po)
+ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
+
+$(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 $@)
+
+all:: $(ALL_MSGFILES)
+
+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
+
-- 
1.5.2

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux