Makefile rules for translation catalog generation and installation.
[jes: with fixes by the i18n team.] Signed-off-by: Christian Stimming <stimming@tuhh.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Christian Stimming committed
Jul 21, 2007 at 14:17 UTC
3845048064352f4e213363239298f4fa3190ddb9
1 file changed
+19
-2
Makefile
+19
-2
@@ -103,6 +103,21 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
103
$(GITGUI_BUILT_INS): git-gui
104
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
105
106
+XGETTEXT ?= xgettext
107
+msgsdir ?= $(libdir)/msgs
108
+msgsdir_SQ = $(subst ','\'',$(msgsdir))
109
+PO_TEMPLATE = po/git-gui.pot
110
+ALL_POFILES = $(wildcard po/*.po)
111
+ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
112
+
113
+$(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
114
+ $(XGETTEXT) -kmc -LTcl -o $@ $(SCRIPT_SH) $(ALL_LIBFILES)
115
+update-po:: $(PO_TEMPLATE)
116
+ $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
117
+$(ALL_MSGFILES): %.msg : %.po
118
+ @echo Generating catalog $@
119
+ msgfmt --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
120
+
121
lib/tclIndex: $(ALL_LIBFILES)
122
$(QUIET_INDEX)if echo \
123
$(foreach p,$(PRELOAD_FILES),source $p\;) \
@@ -136,7 +151,7 @@ GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
151
echo 1>$@ "$$VARS"; \
152
fi
153
139
-all:: $(ALL_PROGRAMS) lib/tclIndex
154
+all:: $(ALL_PROGRAMS) lib/tclIndex $(ALL_MSGFILES)
155
156
install: all
157
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
@@ -145,13 +160,15 @@ install: all
160
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1)
161
$(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
162
$(QUIET)$(foreach p,$(ALL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
163
+ $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
164
+ $(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
165
166
dist-version:
167
@mkdir -p $(TARDIR)
168
@echo $(GITGUI_VERSION) > $(TARDIR)/version
169
170
clean::
154
- rm -f $(ALL_PROGRAMS) lib/tclIndex
171
+ rm -f $(ALL_PROGRAMS) lib/tclIndex po/*.msg
172
rm -f GIT-VERSION-FILE GIT-GUI-VARS
173
174
.PHONY: all install dist-version clean