bug-gettext
[Top][All Lists]
Advanced

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

Re: [bug-gettext] Removing auto-update rules from po/Makefile.in.in


From: Daiki Ueno
Subject: Re: [bug-gettext] Removing auto-update rules from po/Makefile.in.in
Date: Thu, 01 May 2014 17:04:59 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Daiki Ueno <address@hidden> writes:

> Given the recent popularity of GIT, it doesn't make much sense to update
> PO files based on the timestamp of a POT file, IMHO.
[...]
> I'm attaching a patch for this.

After more consideration, I think the simplest way would be to just make
the dependencies of those rules controllable through Makevars.

Here is a patch in this direction.

>From aa8344ed9b280ec3a76db714dda7a2b1b76828c2 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <address@hidden>
Date: Thu, 1 May 2014 13:39:23 +0900
Subject: [PATCH] Makefile.in.in: Make dependencies of a PO file and 'dist'
 customizable

---
 gettext-runtime/po/Makefile.in.in |  8 ++++++--
 gettext-runtime/po/Makevars       | 10 ++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/gettext-runtime/po/Makefile.in.in 
b/gettext-runtime/po/Makefile.in.in
index fabdc76..a82e2fc 100644
--- a/gettext-runtime/po/Makefile.in.in
+++ b/gettext-runtime/po/Makefile.in.in
@@ -75,6 +75,9 @@ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
 
 POTFILES = \
 
+POFILESDEPS = $(srcdir)/$(DOMAIN).pot
+DISTFILESDEPS = update-po
+
 CATALOGS = @CATALOGS@
 
 # Makevars gets inserted here. (Don't remove this line!)
@@ -199,9 +202,10 @@ $(srcdir)/$(DOMAIN).pot:
 
 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
 # Note that a PO file is not touched if it doesn't need to be changed.
-$(POFILES): $(srcdir)/$(DOMAIN).pot
+$(POFILES): $(POFILESDEPS)
        @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
        if test -f "$(srcdir)/$${lang}.po"; then \
+         test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \
          test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
          echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} 
$${lang}.po $(DOMAIN).pot"; \
          cd $(srcdir) \
@@ -362,7 +366,7 @@ maintainer-clean: distclean
 
 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 dist distdir:
-       $(MAKE) update-po
+       test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
        @$(MAKE) dist2
 # This is a separate target because 'update-po' must be executed before.
 dist2: stamp-po $(DISTFILES)
diff --git a/gettext-runtime/po/Makevars b/gettext-runtime/po/Makevars
index 477dc67..c77e8b8 100644
--- a/gettext-runtime/po/Makevars
+++ b/gettext-runtime/po/Makevars
@@ -54,3 +54,13 @@ USE_MSGCTXT = no
 #   --previous            to keep previous msgids of translated messages,
 #   --quiet               to reduce the verbosity.
 MSGMERGE_OPTIONS =
+
+# This is the list of dependencies of each PO file target.  By
+# default, it includes $(DOMAIN).pot, that means a PO file is updated
+# when the POT file has changed.  Uncomment this to suppress the behavior.
+# POFILESDEPS =
+
+# This is the list of dependencies of the 'dist' rule.  By default, it
+# includes 'update-po', that means all PO files are updated before
+# creating a distribution.  Uncomment this to suppress the behavior.
+# DISTFILESDEPS =
-- 
1.9.0

Regards,
--
Daiki Ueno

reply via email to

[Prev in Thread] Current Thread [Next in Thread]