]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
po, examples: Change .po -> .gmo rules to consider the newest changes to the POT...
authorBruno Haible <bruno@clisp.org>
Wed, 24 Oct 2018 23:41:42 +0000 (01:41 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 25 Oct 2018 01:13:57 +0000 (03:13 +0200)
Reported by Claude Paroz <claude@2xlibre.net>
in <https://savannah.gnu.org/bugs/?50910>.

* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Set MSGMERGE_FOR_MSGFMT_OPTION.
* gettext-runtime/po/Makefile.in.in (MSGMERGE): Use GNU msgmerge, even if not
first in $PATH.
(MSGMERGE_FOR_MSGFMT_OPTION): New variable.
(.po.gmo): Depend on the POT file. Use msgmerge on the fly, to take into
account the most recent POT file changes.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise, also for the .po.qm,
update-properties, update-classes targets.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile
(MSGMERGE_FOR_MSGFMT_OPTION): New variable.
($(STRINGSFILES)): Depend on the POT file. Use msgmerge on the fly, to take
into account the most recent POT file changes.

25 files changed:
gettext-runtime/m4/po.m4
gettext-runtime/po/Makefile.in.in
gettext-tools/examples/hello-c++-qt/po/Makefile.am
gettext-tools/examples/hello-c++-wxwidgets/po/Makefile.am
gettext-tools/examples/hello-clisp/po/Makefile.am
gettext-tools/examples/hello-csharp-forms/po/Makefile.am
gettext-tools/examples/hello-csharp/po/Makefile.am
gettext-tools/examples/hello-gawk/po/Makefile.am
gettext-tools/examples/hello-guile/po/Makefile.am
gettext-tools/examples/hello-java-awt/po/Makefile.am
gettext-tools/examples/hello-java-qtjambi/po/Makefile.am
gettext-tools/examples/hello-java-swing/po/Makefile.am
gettext-tools/examples/hello-java/po/Makefile.am
gettext-tools/examples/hello-librep/po/Makefile.am
gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile
gettext-tools/examples/hello-pascal/po/Makefile.am
gettext-tools/examples/hello-perl/po/Makefile.am
gettext-tools/examples/hello-php/po/Makefile.am
gettext-tools/examples/hello-python/po/Makefile.am
gettext-tools/examples/hello-sh/po/Makefile.am
gettext-tools/examples/hello-smalltalk/po/Makefile.am
gettext-tools/examples/hello-tcl-tk/po/Makefile.am
gettext-tools/examples/hello-tcl/po/Makefile.am
gettext-tools/examples/hello-ycp/po/Makefile.am
gettext-tools/examples/po/Makefile.am

index fba008a0a410eba4d6c9b9d7c37cc3bd5cef2d40..96c738078e46ab888d3a83adc688807fbdfe00da 100644 (file)
@@ -1,4 +1,4 @@
-# po.m4 serial 28 (gettext-0.19.9)
+# po.m4 serial 29 (gettext-0.19.9)
 dnl Copyright (C) 1995-2014, 2016, 2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -76,6 +76,22 @@ changequote([,])dnl
   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
     [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
+  dnl Test whether it is GNU msgmerge >= 0.19.9.
+  if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
+    MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
+  else
+    dnl Test whether it is GNU msgmerge >= 0.12.
+    if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
+      MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
+    else
+      dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is
+      dnl slow. But this is not a big problem, as such old gettext versions are
+      dnl hardly in use any more.
+      MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
+    fi
+  fi
+  AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION])
+
   dnl Support for AM_XGETTEXT_OPTION.
   test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
   AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
index 332b2d9f336fa958f15ff930bc5856bb1bad777a..0fe4157bcc95fe53767f0a390329928e2babe79d 100644 (file)
@@ -57,8 +57,9 @@ XGETTEXT_ = @XGETTEXT@
 XGETTEXT_no = @XGETTEXT@
 XGETTEXT_yes = @XGETTEXT_015@
 XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -92,11 +93,30 @@ DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
 .SUFFIXES:
 .SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index c0f195e557298ca56012698eb81a06cb648e409b..cf1067ebecb2168d4c423d7640595efc32b0e118 100644 (file)
@@ -65,8 +65,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -89,11 +90,30 @@ CATALOGS = @QTCATALOGS@
 
 SUFFIXES = .po .qm .sed .sin .nop .po-create .po-update
 
-.po.qm:
+# The .pot file, stamp-po, .po files, and .qm files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .qm conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.qm: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.qm && $(GMSGFMT) -c --qt --statistics --verbose -o $${lang}.qm $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.qm && $(GMSGFMT) -c --qt --statistics --verbose -o t-$${lang}.qm $${lang}.po && mv t-$${lang}.qm $${lang}.qm
+       echo "$${cdcmd}rm -f $${lang}.qm && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --qt --statistics --verbose -o $${lang}.qm $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.qm && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --qt --statistics --verbose -o t-$${lang}.qm $${lang}.1po && \
+       mv t-$${lang}.qm $${lang}.qm && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index 558ed2a303e6ebaaca3fe3ff10be4daa095c2f56..61658fcc5f730b4fafde5cf71639fd31f25fd3eb 100644 (file)
@@ -68,8 +68,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -92,11 +93,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index d1955fb2be74d4db619bab4b339862a552811acf..2d012b1842a2e2962519ffae0326dc05836cf3c9 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index 02921ca4971e199a3ef48dc46db50f0666434b4d..24ed7fdcbdc13c5fe8158fab9efb596ef979f16e 100644 (file)
@@ -60,8 +60,9 @@ MSGINIT_OPTIONS =
 
 pkglibdir = $(libdir)/$(PACKAGE)
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -84,6 +85,17 @@ CATALOGS = @CSHARPCATALOGS@
 
 SUFFIXES = .sed .sin .nop .po-create .po-update
 
+# The .pot file, stamp-po, .po files, and .resources.dll files appear in release
+# tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@
index 02921ca4971e199a3ef48dc46db50f0666434b4d..24ed7fdcbdc13c5fe8158fab9efb596ef979f16e 100644 (file)
@@ -60,8 +60,9 @@ MSGINIT_OPTIONS =
 
 pkglibdir = $(libdir)/$(PACKAGE)
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -84,6 +85,17 @@ CATALOGS = @CSHARPCATALOGS@
 
 SUFFIXES = .sed .sin .nop .po-create .po-update
 
+# The .pot file, stamp-po, .po files, and .resources.dll files appear in release
+# tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@
index db6b258732c2ca1bc748d58a33f6c257a5b728ee..960c773e62bdacb5ecc4bbd031060ae06b26658a 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index b60d3c75133a7332238c829567f16071729cb957..793bddd78d6602d65b582d3fbde92fcfaf23ac3b 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index f26518e1a834c49bb203bf54f0db6b04d42049e7..ae880a8337731eefc80e0c70e232fa7a2b010fe5 100644 (file)
@@ -58,8 +58,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGCAT = msgcat
 MSGINIT = msginit
 MSGCONV = msgconv
@@ -85,6 +86,16 @@ CATALOGS = @JAVACATALOGS@
 
 SUFFIXES = .po .sed .sin .nop .po-create .po-update
 
+# The .pot file, stamp-po, .po files, and .properties or .class files appear
+# in release tarballs. The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@
@@ -287,6 +298,11 @@ update-po: Makefile
 
 $(DUMMYPOFILES):
 
+# During .po -> .properties or .class conversion, take into account the most
+# recent changes to the .pot file. This eliminates the need to update the .po
+# files when the .pot file has changed, which would be troublesome if the .po
+# files are put under version control.
+
 update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(srcdir)/$(DOMAIN).properties"; \
        $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(DOMAIN).properties || { rm -f $(DOMAIN).properties; exit 1; }
@@ -301,10 +317,12 @@ update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        fi
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
-         echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po"; \
-         $(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po || exit 1; \
-         echo "$(MSGCAT) --properties-output -o $(srcdir)/$(DOMAIN)_$$lang.properties $(srcdir)/$${lang}.po"; \
-         $(MSGCAT) --properties-output -o $(DOMAIN)_$$lang.properties.tmp $(srcdir)/$${lang}.po || exit 1; \
+         echo "$(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot"; \
+         $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot || exit 1; \
+         echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $${lang}.1po"; \
+         $(GMSGFMT) -c --statistics --verbose -o /dev/null $${lang}.1po || exit 1; \
+         echo "$(MSGCAT) --properties-output -o $(srcdir)/$(DOMAIN)_$$lang.properties $${lang}.1po"; \
+         $(MSGCAT) --properties-output -o $(DOMAIN)_$$lang.properties.tmp $${lang}.1po || exit 1; \
          if test '$(srcdir)' = .; then \
            mv -f $(DOMAIN)_$$lang.properties.tmp $(DOMAIN)_$$lang.properties || exit 1; \
          else \
@@ -314,6 +332,7 @@ update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
              mv -f $(DOMAIN)_$$lang.properties.tmp $(srcdir)/$(DOMAIN)_$$lang.properties || exit 1; \
            fi; \
          fi; \
+         rm -f $${lang}.1po; \
        done
 
 # Alternatively, we could create classes instead of properties files.
@@ -331,8 +350,10 @@ update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        fi
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
-         echo "$(GMSGFMT) -c --statistics --verbose -j -d $(srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \
-         $(GMSGFMT) -c --statistics --verbose -j -d . -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po || exit 1; \
+         echo "$(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot"; \
+         $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot || exit 1; \
+         echo "$(GMSGFMT) -c --statistics --verbose -j -d $(srcdir) -r $(DOMAIN) -l $${lang} $${lang}.1po"; \
+         $(GMSGFMT) -c --statistics --verbose -j -d . -r $(DOMAIN) -l $${lang} $${lang}.1po || exit 1; \
          if test '$(srcdir)' != .; then \
            if test -f $(srcdir)/$(DOMAIN)_$$lang.class && cmp $(DOMAIN)_$$lang.class $(srcdir)/$(DOMAIN)_$$lang.class >/dev/null; then \
              rm -f $(DOMAIN)_$$lang.class; \
@@ -340,6 +361,7 @@ update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
              mv -f $(DOMAIN)_$$lang.class $(srcdir)/$(DOMAIN)_$$lang.class || exit 1; \
            fi; \
          fi; \
+         rm -f $${lang}.1po; \
        done
 
 echo-catalogs:
index f26518e1a834c49bb203bf54f0db6b04d42049e7..ae880a8337731eefc80e0c70e232fa7a2b010fe5 100644 (file)
@@ -58,8 +58,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGCAT = msgcat
 MSGINIT = msginit
 MSGCONV = msgconv
@@ -85,6 +86,16 @@ CATALOGS = @JAVACATALOGS@
 
 SUFFIXES = .po .sed .sin .nop .po-create .po-update
 
+# The .pot file, stamp-po, .po files, and .properties or .class files appear
+# in release tarballs. The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@
@@ -287,6 +298,11 @@ update-po: Makefile
 
 $(DUMMYPOFILES):
 
+# During .po -> .properties or .class conversion, take into account the most
+# recent changes to the .pot file. This eliminates the need to update the .po
+# files when the .pot file has changed, which would be troublesome if the .po
+# files are put under version control.
+
 update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(srcdir)/$(DOMAIN).properties"; \
        $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(DOMAIN).properties || { rm -f $(DOMAIN).properties; exit 1; }
@@ -301,10 +317,12 @@ update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        fi
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
-         echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po"; \
-         $(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po || exit 1; \
-         echo "$(MSGCAT) --properties-output -o $(srcdir)/$(DOMAIN)_$$lang.properties $(srcdir)/$${lang}.po"; \
-         $(MSGCAT) --properties-output -o $(DOMAIN)_$$lang.properties.tmp $(srcdir)/$${lang}.po || exit 1; \
+         echo "$(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot"; \
+         $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot || exit 1; \
+         echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $${lang}.1po"; \
+         $(GMSGFMT) -c --statistics --verbose -o /dev/null $${lang}.1po || exit 1; \
+         echo "$(MSGCAT) --properties-output -o $(srcdir)/$(DOMAIN)_$$lang.properties $${lang}.1po"; \
+         $(MSGCAT) --properties-output -o $(DOMAIN)_$$lang.properties.tmp $${lang}.1po || exit 1; \
          if test '$(srcdir)' = .; then \
            mv -f $(DOMAIN)_$$lang.properties.tmp $(DOMAIN)_$$lang.properties || exit 1; \
          else \
@@ -314,6 +332,7 @@ update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
              mv -f $(DOMAIN)_$$lang.properties.tmp $(srcdir)/$(DOMAIN)_$$lang.properties || exit 1; \
            fi; \
          fi; \
+         rm -f $${lang}.1po; \
        done
 
 # Alternatively, we could create classes instead of properties files.
@@ -331,8 +350,10 @@ update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        fi
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
-         echo "$(GMSGFMT) -c --statistics --verbose -j -d $(srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \
-         $(GMSGFMT) -c --statistics --verbose -j -d . -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po || exit 1; \
+         echo "$(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot"; \
+         $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot || exit 1; \
+         echo "$(GMSGFMT) -c --statistics --verbose -j -d $(srcdir) -r $(DOMAIN) -l $${lang} $${lang}.1po"; \
+         $(GMSGFMT) -c --statistics --verbose -j -d . -r $(DOMAIN) -l $${lang} $${lang}.1po || exit 1; \
          if test '$(srcdir)' != .; then \
            if test -f $(srcdir)/$(DOMAIN)_$$lang.class && cmp $(DOMAIN)_$$lang.class $(srcdir)/$(DOMAIN)_$$lang.class >/dev/null; then \
              rm -f $(DOMAIN)_$$lang.class; \
@@ -340,6 +361,7 @@ update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
              mv -f $(DOMAIN)_$$lang.class $(srcdir)/$(DOMAIN)_$$lang.class || exit 1; \
            fi; \
          fi; \
+         rm -f $${lang}.1po; \
        done
 
 echo-catalogs:
index f26518e1a834c49bb203bf54f0db6b04d42049e7..ae880a8337731eefc80e0c70e232fa7a2b010fe5 100644 (file)
@@ -58,8 +58,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGCAT = msgcat
 MSGINIT = msginit
 MSGCONV = msgconv
@@ -85,6 +86,16 @@ CATALOGS = @JAVACATALOGS@
 
 SUFFIXES = .po .sed .sin .nop .po-create .po-update
 
+# The .pot file, stamp-po, .po files, and .properties or .class files appear
+# in release tarballs. The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@
@@ -287,6 +298,11 @@ update-po: Makefile
 
 $(DUMMYPOFILES):
 
+# During .po -> .properties or .class conversion, take into account the most
+# recent changes to the .pot file. This eliminates the need to update the .po
+# files when the .pot file has changed, which would be troublesome if the .po
+# files are put under version control.
+
 update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(srcdir)/$(DOMAIN).properties"; \
        $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(DOMAIN).properties || { rm -f $(DOMAIN).properties; exit 1; }
@@ -301,10 +317,12 @@ update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        fi
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
-         echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po"; \
-         $(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po || exit 1; \
-         echo "$(MSGCAT) --properties-output -o $(srcdir)/$(DOMAIN)_$$lang.properties $(srcdir)/$${lang}.po"; \
-         $(MSGCAT) --properties-output -o $(DOMAIN)_$$lang.properties.tmp $(srcdir)/$${lang}.po || exit 1; \
+         echo "$(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot"; \
+         $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot || exit 1; \
+         echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $${lang}.1po"; \
+         $(GMSGFMT) -c --statistics --verbose -o /dev/null $${lang}.1po || exit 1; \
+         echo "$(MSGCAT) --properties-output -o $(srcdir)/$(DOMAIN)_$$lang.properties $${lang}.1po"; \
+         $(MSGCAT) --properties-output -o $(DOMAIN)_$$lang.properties.tmp $${lang}.1po || exit 1; \
          if test '$(srcdir)' = .; then \
            mv -f $(DOMAIN)_$$lang.properties.tmp $(DOMAIN)_$$lang.properties || exit 1; \
          else \
@@ -314,6 +332,7 @@ update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
              mv -f $(DOMAIN)_$$lang.properties.tmp $(srcdir)/$(DOMAIN)_$$lang.properties || exit 1; \
            fi; \
          fi; \
+         rm -f $${lang}.1po; \
        done
 
 # Alternatively, we could create classes instead of properties files.
@@ -331,8 +350,10 @@ update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        fi
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
-         echo "$(GMSGFMT) -c --statistics --verbose -j -d $(srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \
-         $(GMSGFMT) -c --statistics --verbose -j -d . -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po || exit 1; \
+         echo "$(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot"; \
+         $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot || exit 1; \
+         echo "$(GMSGFMT) -c --statistics --verbose -j -d $(srcdir) -r $(DOMAIN) -l $${lang} $${lang}.1po"; \
+         $(GMSGFMT) -c --statistics --verbose -j -d . -r $(DOMAIN) -l $${lang} $${lang}.1po || exit 1; \
          if test '$(srcdir)' != .; then \
            if test -f $(srcdir)/$(DOMAIN)_$$lang.class && cmp $(DOMAIN)_$$lang.class $(srcdir)/$(DOMAIN)_$$lang.class >/dev/null; then \
              rm -f $(DOMAIN)_$$lang.class; \
@@ -340,6 +361,7 @@ update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
              mv -f $(DOMAIN)_$$lang.class $(srcdir)/$(DOMAIN)_$$lang.class || exit 1; \
            fi; \
          fi; \
+         rm -f $${lang}.1po; \
        done
 
 echo-catalogs:
index f26518e1a834c49bb203bf54f0db6b04d42049e7..ae880a8337731eefc80e0c70e232fa7a2b010fe5 100644 (file)
@@ -58,8 +58,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGCAT = msgcat
 MSGINIT = msginit
 MSGCONV = msgconv
@@ -85,6 +86,16 @@ CATALOGS = @JAVACATALOGS@
 
 SUFFIXES = .po .sed .sin .nop .po-create .po-update
 
+# The .pot file, stamp-po, .po files, and .properties or .class files appear
+# in release tarballs. The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@
@@ -287,6 +298,11 @@ update-po: Makefile
 
 $(DUMMYPOFILES):
 
+# During .po -> .properties or .class conversion, take into account the most
+# recent changes to the .pot file. This eliminates the need to update the .po
+# files when the .pot file has changed, which would be troublesome if the .po
+# files are put under version control.
+
 update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(srcdir)/$(DOMAIN).properties"; \
        $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(DOMAIN).properties || { rm -f $(DOMAIN).properties; exit 1; }
@@ -301,10 +317,12 @@ update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        fi
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
-         echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po"; \
-         $(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po || exit 1; \
-         echo "$(MSGCAT) --properties-output -o $(srcdir)/$(DOMAIN)_$$lang.properties $(srcdir)/$${lang}.po"; \
-         $(MSGCAT) --properties-output -o $(DOMAIN)_$$lang.properties.tmp $(srcdir)/$${lang}.po || exit 1; \
+         echo "$(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot"; \
+         $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot || exit 1; \
+         echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $${lang}.1po"; \
+         $(GMSGFMT) -c --statistics --verbose -o /dev/null $${lang}.1po || exit 1; \
+         echo "$(MSGCAT) --properties-output -o $(srcdir)/$(DOMAIN)_$$lang.properties $${lang}.1po"; \
+         $(MSGCAT) --properties-output -o $(DOMAIN)_$$lang.properties.tmp $${lang}.1po || exit 1; \
          if test '$(srcdir)' = .; then \
            mv -f $(DOMAIN)_$$lang.properties.tmp $(DOMAIN)_$$lang.properties || exit 1; \
          else \
@@ -314,6 +332,7 @@ update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
              mv -f $(DOMAIN)_$$lang.properties.tmp $(srcdir)/$(DOMAIN)_$$lang.properties || exit 1; \
            fi; \
          fi; \
+         rm -f $${lang}.1po; \
        done
 
 # Alternatively, we could create classes instead of properties files.
@@ -331,8 +350,10 @@ update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
        fi
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
-         echo "$(GMSGFMT) -c --statistics --verbose -j -d $(srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \
-         $(GMSGFMT) -c --statistics --verbose -j -d . -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po || exit 1; \
+         echo "$(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot"; \
+         $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $(srcdir)/$${lang}.po $(srcdir)/$(DOMAIN).pot || exit 1; \
+         echo "$(GMSGFMT) -c --statistics --verbose -j -d $(srcdir) -r $(DOMAIN) -l $${lang} $${lang}.1po"; \
+         $(GMSGFMT) -c --statistics --verbose -j -d . -r $(DOMAIN) -l $${lang} $${lang}.1po || exit 1; \
          if test '$(srcdir)' != .; then \
            if test -f $(srcdir)/$(DOMAIN)_$$lang.class && cmp $(DOMAIN)_$$lang.class $(srcdir)/$(DOMAIN)_$$lang.class >/dev/null; then \
              rm -f $(DOMAIN)_$$lang.class; \
@@ -340,6 +361,7 @@ update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
              mv -f $(DOMAIN)_$$lang.class $(srcdir)/$(DOMAIN)_$$lang.class || exit 1; \
            fi; \
          fi; \
+         rm -f $${lang}.1po; \
        done
 
 echo-catalogs:
index d59a4b96063af6e26f1babc59d6cd2c5c5b8eae4..424f335e3d004ff7f5af2fb4e1df0b5b233fec5e 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index ef6ae9e33c76d87340593f1a2934bd0604aaad59..8c9113b0ac16d8f80d3d8a350eb6756c74b9aeed 100644 (file)
@@ -70,6 +70,7 @@ PACKAGE_VERSION = 0
 XGETTEXT = xgettext
 MSGMERGE = msgmerge
 MSGMERGE_UPDATE = msgmerge --update
+MSGMERGE_FOR_MSGFMT_OPTION = --for-msgfmt
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -245,14 +246,16 @@ $(DUMMYPOFILES):
 update-strings: $(CATALOGS)
        @:
 
-# I don't know how to make a dependency from a particular .strings file to its
-# corresponding .po file; therefore I put here a dependency towards all .po
-# files. It's safer than no dependency at all.
-$(STRINGSFILES): $(POFILES)
-       $(MAKE) $(UNIXLOCALE_$(patsubst %.lproj,%, $(notdir $(patsubst %/,%, $(dir $@))))).po
+# During .po -> .strings conversion, take into account the most recent changes
+# to the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+$(STRINGSFILES): $(DOMAIN).pot $(POFILES)
        mkdir -p $(patsubst %/,%, $(dir $@))
-       msgcat --stringtable-output -o $@.tmp $(UNIXLOCALE_$(patsubst %.lproj,%, $(notdir $(patsubst %/,%, $(dir $@))))).po
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $@.1po $(UNIXLOCALE_$(patsubst %.lproj,%, $(notdir $(patsubst %/,%, $(dir $@))))).po $(DOMAIN).pot
+       msgcat --stringtable-output -o $@.tmp $@.1po
        mv $@.tmp $@
+       rm -f $@.1po
 
 $(ENSTRINGSFILES): $(DOMAIN).pot
        mkdir -p $(patsubst %/,%, $(dir $@))
index e34b6149b9fe39a1615fa54590d16b74597d2226..b79d1afbe71b0c6552c3cd0857ae1a5c501e5071 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index 3231d8c2d15f85366f060ac2c000024ed0383a50..0809acf05297593d4123be2145cb6c3acb13b920 100644 (file)
@@ -72,8 +72,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -96,11 +97,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index c8e15586104991f8f6a09c31093584842ddbd77c..4eeee736093a18361e2f0d6f1bdb279e22aae794 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index b1bfdbff3cbafb3a53f149729b4a3ac146295b5f..41d41398ec5393f60dd6e9a2f3bf80a80743dfb2 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index 3251cf0471f4b3f236e0bbcfbfbab9445730eb56..bc006d5c56a74f6178377858979954ab18fb7f75 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index 46269cfee52354db5d5977bd072f8846acaf2d44..5d20248163badc33d9aed044575898307ef71cf6 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index 69ca0279f49f2d0b965256f67300b9e7835f4614..bf3225611c7ec79d4df845bce8ae25929e1f4949 100644 (file)
@@ -58,8 +58,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -82,6 +83,16 @@ CATALOGS = @TCLCATALOGS@
 
 SUFFIXES = .sed .sin .nop .po-create .po-update
 
+# The .pot file, stamp-po, .po files, and .msg files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@
index 69ca0279f49f2d0b965256f67300b9e7835f4614..bf3225611c7ec79d4df845bce8ae25929e1f4949 100644 (file)
@@ -58,8 +58,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -82,6 +83,16 @@ CATALOGS = @TCLCATALOGS@
 
 SUFFIXES = .sed .sin .nop .po-create .po-update
 
+# The .pot file, stamp-po, .po files, and .msg files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@
index 89c4da989b00e0f0a068199c4bdf0ec52d07b9bb..2456e768ae41ac37c7d7f85e7b40d23033588b18 100644 (file)
@@ -62,8 +62,9 @@ MSGMERGE_OPTIONS = --quiet
 # MSGINIT_OPTIONS.
 MSGINIT_OPTIONS =
 
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -86,11 +87,30 @@ CATALOGS = @CATALOGS@
 
 SUFFIXES = .po .gmo .sed .sin .nop .po-create .po-update
 
-.po.gmo:
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+.po.gmo: $(srcdir)/$(DOMAIN).pot
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
index 3078c58468320d0cb2be1edde867d2a06a92421f..5892280fe2cc632375209105b238d8290c6536b5 100644 (file)
@@ -152,6 +152,16 @@ DUMMYPOFILES = @DUMMYPOFILES@
 
 SUFFIXES = .po .sed .sin .nop .po-update
 
+# The .pot file, stamp-po, and .po files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@