[gimp-help-2] [make] Fix making pot files with image prerequisites
- From: Ulf-D. Ehlert <ulfehlert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp-help-2] [make] Fix making pot files with image prerequisites
- Date: Thu, 23 Dec 2010 19:28:40 +0000 (UTC)
commit d2a89fa98e56b1df86a31e2752f6fd20216fa10c
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date: Thu Dec 23 18:55:42 2010 +0100
[make] Fix making pot files with image prerequisites
Makefile.GNU | 7 ++++---
Makefile.am | 16 ++++++++++------
2 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/Makefile.GNU b/Makefile.GNU
index 102c29e..80ceaec 100644
--- a/Makefile.GNU
+++ b/Makefile.GNU
@@ -180,6 +180,7 @@ endif
# $(call xml2pot,xml-files,pot-file)
# Parameters:
# $1 - input: original (untranslated) XML files
+# and other prerequisites, e.g. images or "FORCE"
# $2 - output: POT template file containing translatable tags
xml2pot = $(XML2PO) $(XML2POFLAGS) --output='-' $(filter %.xml,$(1)) \
| $(MSGUNIQ) $(MSGUNIQFLAGS) \
@@ -366,7 +367,7 @@ pot/%.pot: src/$$*/*.xml FORCE
endif
$(cmd) $(call make_target_dir,$@)
$(msg) "[POT] $@"
- $(cmd) $(call xml2pot,$(filter-out FORCE,$^),$@)
+ $(cmd) $(call xml2pot,$^,$@)
# Special case: rename pot file for toplevel xml files
ifeq ($(filter pot/%.pot po/%.po,$(MAKECMDGOALS)),)
pot/gimp.pot: src/*.xml $(wildcard images/C/*.*)
@@ -375,7 +376,7 @@ pot/gimp.pot: src/*.xml FORCE
endif
$(cmd) $(call make_target_dir,$@)
$(msg) "[POT] $@"
- $(cmd) $(call xml2pot,$(filter-out FORCE,$^),$@)
+ $(cmd) $(call xml2pot,$^,$@)
# Special case: pot file for the authors DocBook file
# requires an additional prerequisite
AUTHORS_POT = $(AUTHORS_DOCBOOK_XML:src/%/$(AUTHORS_DOCBOOK_FILENAME)=pot/%.pot)
@@ -387,7 +388,7 @@ $(AUTHORS_POT): $(AUTHORS_DOCBOOK_XML) $(wildcard $(AUTHORS_DOCBOOK_DIRNAME)*.xm
endif
$(cmd) $(call make_target_dir,$@)
$(msg) "[POT] $@"
- $(cmd) $(call xml2pot,$(filter-out FORCE,$^),$@)
+ $(cmd) $(call xml2pot,$^,$@)
# Remove left over pot files
cleanup-pot:
diff --git a/Makefile.am b/Makefile.am
index fe4d167..bb7118b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -231,12 +231,13 @@ if HAVE_I18N_TOOLS
# $(call xml2pot,xml-files,pot-file)
# Parameters:
# $1 - input: original (untranslated) XML files
+# and other prerequisites, e.g. images or "FORCE"
# $2 - output: POT template file containing translatable tags
-xml2pot = $(XML2PO) $(XML2POFLAGS) --output='-' $(1) \
+xml2pot = $(XML2PO) $(XML2POFLAGS) --output='-' $(filter %.xml,$(1)) \
| $(MSGUNIQ) $(MSGUNIQFLAGS) \
| $(MSGCAT) $(MSGCATFLAGS) - > "$(2)"; \
test -s "$(2)" || rm -f "$(2)"; \
- touch -c -r `ls -t $(1) | $(SED) 1q` "$(2)" || true; \
+ touch -c -r $(call get_recent_file,$(1)) "$(2)" || true; \
test -s "$(2)"
# Merge template (pot) and message catalog (po) or create a new catalog
@@ -301,6 +302,8 @@ endif
make_target_dir = f=$(1); d=$${f%/*}; test -d $$d || $(MKDIR_P) $$d
+get_recent_file = $(shell ls -t $(1) | $(SED) 1q)
+
copy = $(LN_S) $(abs_srcdir)/$(1) $(2)
# HIDE FROM AUTOMAKE #ifneq ($(COMPENDIUM),)
@@ -427,27 +430,28 @@ MAINTAINERS: gimp-help-2.doap $(DOAP_STYLESHEET)
# HIDE FROM AUTOMAKE #endif
# HIDE FROM AUTOMAKE # $(cmd) $(call make_target_dir,$@)
# HIDE FROM AUTOMAKE # $(msg) "[POT] $@"
-# HIDE FROM AUTOMAKE # $(cmd) $(call xml2pot,$(filter-out FORCE,$^),$@)
+# HIDE FROM AUTOMAKE # $(cmd) $(call xml2pot,$^,$@)
# Special case: rename pot file for toplevel xml files
# HIDE FROM AUTOMAKE #ifeq ($(filter pot/%.pot,$(MAKECMDGOALS)),)
-# HIDE FROM AUTOMAKE #pot/gimp.pot: $(srcdir)/src/*.xml
+# HIDE FROM AUTOMAKE #pot/gimp.pot: $(srcdir)/src/*.xml $(wildcard images/C/*.*)
# HIDE FROM AUTOMAKE #else
# HIDE FROM AUTOMAKE #pot/gimp.pot: $(srcdir)/src/*.xml FORCE
# HIDE FROM AUTOMAKE #endif
# HIDE FROM AUTOMAKE # $(cmd) $(call make_target_dir,$@)
# HIDE FROM AUTOMAKE # $(msg) "[POT] $@"
-# HIDE FROM AUTOMAKE # $(cmd) $(call xml2pot,$(filter-out FORCE,$^),$@)
+# HIDE FROM AUTOMAKE # $(cmd) $(call xml2pot,$^,$@)
# Special case: pot file for the authors DocBook file
# requires an additional prerequisite
# HIDE FROM AUTOMAKE #AUTHORS_POT = $(AUTHORS_DOCBOOK_XML:src/%/$(AUTHORS_DOCBOOK_FILENAME)=pot/%.pot)
# HIDE FROM AUTOMAKE #ifeq ($(filter pot/%.pot,$(MAKECMDGOALS)),)
+# HIDE FROM AUTOMAKE ## TODO: add images to prerequisites if necessary
# HIDE FROM AUTOMAKE #$(AUTHORS_POT): $(AUTHORS_DOCBOOK_XML) $(wildcard $(AUTHORS_DOCBOOK_DIRNAME)*.xml)
# HIDE FROM AUTOMAKE #else
# HIDE FROM AUTOMAKE #$(AUTHORS_POT): $(AUTHORS_DOCBOOK_XML) $(wildcard $(AUTHORS_DOCBOOK_DIRNAME)*.xml) FORCE
# HIDE FROM AUTOMAKE #endif
# HIDE FROM AUTOMAKE # $(cmd) $(call make_target_dir,$@)
# HIDE FROM AUTOMAKE # $(msg) "[POT] $@"
-# HIDE FROM AUTOMAKE # $(cmd) $(call xml2pot,$(filter-out FORCE,$^),$@)
+# HIDE FROM AUTOMAKE # $(cmd) $(call xml2pot,$^,$@)
# Remove left over pot files
cleanup-pot:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]