[gimp-help-2] [make] Use image files as pot prerequisites



commit c8563b892388c11357546c066ce28985981acca4
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date:   Wed Feb 24 19:55:23 2010 +0100

    [make] Use image files as pot prerequisites
    
    Makefile.GNU only (for now): rebuild a pot file not only if a relevant
    source file changed, but also if a relevant image file changed.
    This will work only for image files in a directory under images/C
    parallel to the source directory:
    pot/path/to/file.pot: src/path/to/file/*.xml images/C/path/to/file/*.*

 Makefile.GNU |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/Makefile.GNU b/Makefile.GNU
index d8f347e..6853427 100644
--- a/Makefile.GNU
+++ b/Makefile.GNU
@@ -181,7 +181,7 @@ endif
 #
 # Hint: Don't use 'grep' for filtering-out the warning messages,
 #       since grep's exit status is 1 if there is no match.
-xml2pot = $(XML2PO) $(XML2POFLAGS) --output='-' $(1) \
+xml2pot = $(XML2PO) $(XML2POFLAGS) --output='-' $(filter %.xml,$(1)) \
           | $(MSGUNIQ) $(MSGUNIQFLAGS) \
           | $(MSGCAT) $(MSGCATFLAGS) - > "$(2)"; \
           test -s "$(2)" || rm -f "$(2)"; \
@@ -351,7 +351,7 @@ POT_FILES += pot/gimp.pot
 
 # General case
 ifeq ($(filter pot/%.pot po/%.po,$(MAKECMDGOALS)),)
-pot/%.pot: src/%/*.xml
+pot/%.pot: src/%/*.xml $(wildcard images/C/%/*.*)
 else
 pot/%.pot: src/%/*.xml FORCE
 endif
@@ -360,7 +360,7 @@ endif
 	$(cmd) $(call xml2pot,$(filter-out FORCE,$^),$@)
 # Special case: rename pot file for toplevel xml files
 ifeq ($(filter pot/%.pot po/%.po,$(MAKECMDGOALS)),)
-pot/gimp.pot: src/*.xml
+pot/gimp.pot: src/*.xml $(wildcard images/C/*.*)
 else
 pot/gimp.pot: src/*.xml FORCE
 endif
@@ -371,6 +371,7 @@ endif
 # requires an additional prerequisite
 AUTHORS_POT = $(AUTHORS_DOCBOOK_XML:src/%/$(AUTHORS_DOCBOOK_FILENAME)=pot/%.pot)
 ifeq ($(filter pot/%.pot po/%.po,$(MAKECMDGOALS)),)
+# TODO: add images to prerequisites if necessary
 $(AUTHORS_POT): $(AUTHORS_DOCBOOK_XML) $(wildcard $(AUTHORS_DOCBOOK_DIRNAME)*.xml)
 else
 $(AUTHORS_POT): $(AUTHORS_DOCBOOK_XML) $(wildcard $(AUTHORS_DOCBOOK_DIRNAME)*.xml) FORCE



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