[Mesa-dev] [PATCH] driconf: Add proper dependency for compiling .mo files from .po files.
Carl Worth
cworth at cworth.org
Mon Jan 7 13:33:31 PST 2013
Previously this was happening unconditionally, leading to some excessive
rebuilding/relinking during builds.
Note that the .po files are not automatically updated due to changes to the
t_options.h file. Instead, translators should continue to use "make po"
manually. This is because after new strings are merged into the existing .po
file, manual work is still required by translators to ensure that the
translations are correct.
---
This is a fix for my previously posted patch which led to some
excessive rebuilding. I'm not sure if the Android build system had a
similar bug. (It's not anything that led to build failure, just causing
"make" to run a few redundant commands.)
-Carl
src/mesa/drivers/dri/common/xmlpool/.gitignore | 1 +
src/mesa/drivers/dri/common/xmlpool/Makefile.am | 40 +++++++++++------------
2 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/src/mesa/drivers/dri/common/xmlpool/.gitignore b/src/mesa/drivers/dri/common/xmlpool/.gitignore
index d8b3246..f6ba5c8 100644
--- a/src/mesa/drivers/dri/common/xmlpool/.gitignore
+++ b/src/mesa/drivers/dri/common/xmlpool/.gitignore
@@ -5,3 +5,4 @@ nl
sv
options.h
Makefile
+xmlpool.pot
diff --git a/src/mesa/drivers/dri/common/xmlpool/Makefile.am b/src/mesa/drivers/dri/common/xmlpool/Makefile.am
index 526ae93..b2a423c 100644
--- a/src/mesa/drivers/dri/common/xmlpool/Makefile.am
+++ b/src/mesa/drivers/dri/common/xmlpool/Makefile.am
@@ -61,36 +61,34 @@ clean:
# Default target options.h
options.h: LOCALEDIR := .
-options.h: t_options.h mo
+options.h: t_options.h $(MOS)
$(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/gen_xmlpool.py t_options.h $(LOCALEDIR) $(LANGS) > options.h
# Update .mo files from the corresponding .po files.
-mo:
- @for mo in $(MOS); do \
- lang=$${mo%%/*}; \
- echo "Updating $$mo from $$lang.po."; \
- mkdir -p $${mo%/*}; \
- msgfmt -o $$mo $$lang.po; \
- done
+%/LC_MESSAGES/options.mo: %.po
+ @mo="$@" \
+ lang=$${mo%%/*}; \
+ echo "Updating ($$lang) $@ from $?."; \
+ mkdir -p $$lang/LC_MESSAGES; \
+ msgfmt -o $@ $?
# Use this target to create or update .po files with new messages in
# driconf.py.
-po: $(POS)
+po: $(POT)
+ @for po in $(POS); do \
+ if [ -f $$po ]; then \
+ echo "Merging new strings from $(POT) into $@."; \
+ mv $$po $$po~; \
+ msgmerge -o $$po $$po~ $(POT); \
+ else \
+ echo "Initializing $$po from $(POT)."; \
+ msginit -i $(POT) -o $$po~ --locale=$*; \
+ sed -e 's/charset=.*\\n/charset=UTF-8\\n/' $$po~ > $$po; \
+ fi \
+ done
pot: $(POT)
# Extract message catalog from driconf.py.
$(POT): t_options.h
xgettext -L C --from-code utf-8 -o $(POT) t_options.h
-
-# Create or update a .po file for a specific language.
-%.po: $(POT)
- @if [ -f $@ ]; then \
- echo "Merging new strings from $(POT) into $@."; \
- mv $@ $@~; \
- msgmerge -o $@ $@~ $(POT); \
- else \
- echo "Initializing $@ from $(POT)."; \
- msginit -i $(POT) -o $@~ --locale=$*; \
- sed -e 's/charset=.*\\n/charset=UTF-8\\n/' $@~ > $@; \
- fi
--
1.7.10.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130107/9bf6c699/attachment.pgp>
More information about the mesa-dev
mailing list