[gimp-help-2/gimp-help-2-6-2] Fix making pot files with image prerequisites



commit 6cc2e6749a178b306b1bab474c857a84bc14eef1
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date:   Thu Dec 23 18:55:42 2010 +0100

    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 1a06cd1..24a472f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -234,12 +234,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
@@ -304,6 +305,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),)
@@ -430,27 +433,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]