]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Turn update-po.sh into a Makefile rule
authorDaiki Ueno <ueno@gnu.org>
Fri, 25 Apr 2014 03:31:11 +0000 (12:31 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 25 Apr 2014 03:42:12 +0000 (12:42 +0900)
Suggested by Andreas Stricker in:
<https://lists.gnu.org/archive/html/bug-gettext/2014-04/msg00020.html>.
* configure.ac (maintainer-update-po): New recursive rule.
* update-po.sh: Remove.
* autogen.sh: Don't mention update-po.sh.
* Makefile.am (maintainer-update-po-local): New rule.
* gettext-runtime/Makefile.am (maintainer-update-po): New rule.
* gettext-runtime/man/Makefile.am (update-man1): Remove; add explicit
dependency on the executable to each .1 rule.
* gettext-tools/man/Makefile.am (update-man1): Remove; add explicit
dependency on the executable to each .1 rule.

Makefile.am
autogen.sh
configure.ac
gettext-runtime/Makefile.am
gettext-runtime/man/Makefile.am
gettext-tools/Makefile.am
gettext-tools/examples/Makefile.am
gettext-tools/man/Makefile.am
gnulib-local/Makefile.am
update-po.sh [deleted file]

index 8b094a7218922b407d3012d6db895a01f665243b..22fe6144ddeb4fdec3c831cf8f8b2d36fd6274d4 100644 (file)
@@ -22,7 +22,7 @@ ACLOCAL_AMFLAGS = -I m4
 SUBDIRS = gnulib-local gettext-runtime gettext-tools
 
 EXTRA_DIST = \
-  DEPENDENCIES PACKAGING HACKING ChangeLog.0 autogen.sh update-po.sh \
+  DEPENDENCIES PACKAGING HACKING ChangeLog.0 autogen.sh \
   build-aux/ac-help.sed build-aux/moopp \
   m4/fixautomake.m4 m4/woe32-dll.m4 \
   m4/libtool.m4
@@ -127,3 +127,7 @@ $(top_srcdir)/.version:
        echo $(VERSION) > $@-t && mv $@-t $@
 dist-hook:
        echo $(VERSION) > $(distdir)/.tarball-version
+
+# PO files update.
+
+maintainer-update-po-local: $(top_builddir)/config.status
index 9ba27524d772436c2c70cfe5af0125d5f48eb72d..c5467ad9329fd594f262424be2b026a314580b91 100755 (executable)
@@ -15,8 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This script populates the build infrastructure in the source tree
-# checked-out from VCS.  To regenerate other materials, such as PO
-# files and manual pages, use update-po.sh.
+# checked-out from VCS.
 #
 # This script requires:
 #   - Autoconf
index 6627a4e0f0e47ef49ba261508483166de7586ad5..c1bee3706830fa83680a0509b1ce698a2f9959e7 100644 (file)
@@ -39,6 +39,8 @@ dnl Checks for library functions.
 
 AC_CONFIG_SUBDIRS([gettext-runtime gettext-tools])
 
+AM_EXTRA_RECURSIVE_TARGETS([maintainer-update-po])
+
 dnl Ensure that "configure --help" lists all the command line options that
 dnl are usable with the subdir configures. Really AC_CONFIG_SUBDIRS should
 dnl do it by itself.
index bd8fefc1120d0f420919195af5edfcbb77ddf987..823c4f198b0212bb3f51e814f9700ce6d9887e69 100644 (file)
@@ -54,3 +54,8 @@ EXTRA_DIST += gnulib-m4/gnulib-cache.m4
 # Woe32 support.
 
 EXTRA_DIST += README.woe32
+
+maintainer-update-po: $(top_builddir)/config.status
+       $(SHELL) ./config.status --recheck
+       $(SHELL) ./config.status po/Makefile.in po-directories
+       cd po && $(MAKE) update-po
index 46e0199c156764716dfd615a88612b02f23ff8a6..b91896fa4ba459a1fa2ba5da7950afca77e67e65 100644 (file)
@@ -60,6 +60,8 @@ HELP2MAN = $(PERL) -w -- $(srcdir)/help2man
 # groff 1.17 or newer.
 MAN2HTML = groff -mandoc -Thtml
 
+UPDATEMODE =
+
 
 # We distribute both the man pages and their HTML equivalent.
 # The user can generate the parts, via
@@ -84,25 +86,16 @@ ngettext.1: ngettext.1.in Makefile
        sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in > t-$@
        mv t-$@ $@
 
-gettext.1.in: gettext.x
+gettext.1.in: gettext.x ../src/gettext$(EXEEXT)
        IN_HELP2MAN=1 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/gettext$(EXEEXT) $(srcdir)/gettext.x gettext.1.in
-ngettext.1.in: ngettext.x
+ngettext.1.in: ngettext.x ../src/ngettext$(EXEEXT)
        IN_HELP2MAN=1 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/ngettext$(EXEEXT) $(srcdir)/ngettext.x ngettext.1.in
 
-envsubst.1: envsubst.x
+envsubst.1: envsubst.x ../src/envsubst$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/envsubst$(EXEEXT) $(srcdir)/envsubst.x envsubst.1
 
 $(man_MAN1IN) $(man_MAN1OTHER): help2man $(top_srcdir)/../.version
 
-# Update them also during "make dist", in order to propagate added command
-# line options that were added, even if .version didn't change.
-UPDATEMODE =
-update-man1:
-       $(MAKE) $(man_MAN1IN) $(man_MAN1OTHER) UPDATEMODE=--update
-       $(MAKE)
-# Hidden from automake, but really activated. Works around an automake-1.5 bug.
-#distdir: update-man1
-
 gettext.3: gettext.3.in $(top_srcdir)/../.version
        sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/gettext.3.in > t-$@
        mv t-$@ $@
index e93ab1ff0900201a1136a8c99ca190504916692c..3eb3238c755e2defea1a96693ebd4035f297df1e 100644 (file)
@@ -58,3 +58,9 @@ EXTRA_DIST += README.woe32
 # Cygwin support.
 
 EXTRA_DIST += woe32dll/export.h
+
+maintainer-update-po: $(top_builddir)/config.status
+       $(SHELL) ./config.status --recheck
+       $(SHELL) ./config.status po/Makefile.in po-directories
+       cd po && $(MAKE) update-po
+       cd examples && $(MAKE) maintainer-update-po
index 35ea4daf9c42878a7efb278633f365abfb0d7141..389489fcdea4ced665e2974734dea2e6678b1aff 100644 (file)
@@ -523,3 +523,8 @@ distdir1:
 # Temporary directories created by po/Makefile.
 clean-local:
        -rm -rf tmp-hello-*
+
+maintainer-update-po: $(top_builddir)/config.status
+       $(SHELL) ./config.status --recheck
+       $(SHELL) ./config.status po/Makefile
+       cd po && $(MAKE) update-po
index 2b420ef334ed2ca5ebf9f25a0422bdf28b740093..2e8fe7291b77a9629e8065352457d90678694dfa 100644 (file)
@@ -59,6 +59,8 @@ HELP2MAN = $(PERL) -w -- $(srcdir)/help2man
 # groff 1.17 or newer.
 MAN2HTML = groff -mandoc -Thtml
 
+UPDATEMODE =
+
 
 # We distribute both the man pages and their HTML equivalent.
 # The user can generate the parts, via
@@ -76,55 +78,46 @@ uninstall-local: uninstall-html
 # The progname.x files contain some extra information not found in the
 # "progname --help" output.
 
-msgcmp.1: msgcmp.x
+msgcmp.1: msgcmp.x ../src/msgcmp$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgcmp$(EXEEXT) $(srcdir)/msgcmp.x msgcmp.1
-msgfmt.1: msgfmt.x
+msgfmt.1: msgfmt.x ../src/msgfmt$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgfmt$(EXEEXT) $(srcdir)/msgfmt.x msgfmt.1
-msgmerge.1: msgmerge.x
+msgmerge.1: msgmerge.x ../src/msgmerge$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgmerge$(EXEEXT) $(srcdir)/msgmerge.x msgmerge.1
-msgunfmt.1: msgunfmt.x
+msgunfmt.1: msgunfmt.x ../src/msgunfmt$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgunfmt$(EXEEXT) $(srcdir)/msgunfmt.x msgunfmt.1
-xgettext.1: xgettext.x
+xgettext.1: xgettext.x ../src/xgettext$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/xgettext$(EXEEXT) $(srcdir)/xgettext.x xgettext.1
-msgattrib.1: msgattrib.x
+msgattrib.1: msgattrib.x ../src/msgattrib$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgattrib$(EXEEXT) $(srcdir)/msgattrib.x msgattrib.1
-msgcat.1: msgcat.x
+msgcat.1: msgcat.x ../src/msgcat$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgcat$(EXEEXT) $(srcdir)/msgcat.x msgcat.1
-msgcomm.1: msgcomm.x
+msgcomm.1: msgcomm.x ../src/msgcomm$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgcomm$(EXEEXT) $(srcdir)/msgcomm.x msgcomm.1
-msgconv.1: msgconv.x
+msgconv.1: msgconv.x ../src/msgconv$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgconv$(EXEEXT) $(srcdir)/msgconv.x msgconv.1
-msgen.1: msgen.x
+msgen.1: msgen.x ../src/msgen$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgen$(EXEEXT) $(srcdir)/msgen.x msgen.1
-msgexec.1: msgexec.x
+msgexec.1: msgexec.x ../src/msgexec$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgexec$(EXEEXT) $(srcdir)/msgexec.x msgexec.1
-msgfilter.1: msgfilter.x
+msgfilter.1: msgfilter.x ../src/msgfilter$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgfilter$(EXEEXT) $(srcdir)/msgfilter.x msgfilter.1
-msggrep.1: msggrep.x
+msggrep.1: msggrep.x ../src/msggrep$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msggrep$(EXEEXT) $(srcdir)/msggrep.x msggrep.1
-msginit.1: msginit.x
+msginit.1: msginit.x ../src/msginit$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msginit$(EXEEXT) $(srcdir)/msginit.x msginit.1
-msguniq.1: msguniq.x
+msguniq.1: msguniq.x ../src/msguniq$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msguniq$(EXEEXT) $(srcdir)/msguniq.x msguniq.1
-recode-sr-latin.1: recode-sr-latin.x
+recode-sr-latin.1: recode-sr-latin.x ../src/recode-sr-latin$(EXEEXT)
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/recode-sr-latin$(EXEEXT) $(srcdir)/recode-sr-latin.x recode-sr-latin.1
 
-gettextize.1: gettextize.x
+gettextize.1: gettextize.x ../misc/gettextize
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../misc/gettextize $(srcdir)/gettextize.x gettextize.1
-autopoint.1: autopoint.x
+autopoint.1: autopoint.x ../misc/autopoint
        $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../misc/autopoint $(srcdir)/autopoint.x autopoint.1
 
 $(man_MAN1): help2man $(top_srcdir)/../.version
 
-# Update them also during "make dist", in order to propagate added command
-# line options that were added, even if .version didn't change.
-UPDATEMODE =
-update-man1:
-       $(MAKE) $(man_MAN1) UPDATEMODE=--update
-       $(MAKE)
-# Hidden from automake, but really activated. Works around an automake-1.5 bug.
-#distdir: update-man1
-
 
 # Man pages in HTML format.
 
index ffe16f5ab54a9ac388d7200035e1bbecd680c597..2ffa65e8bcd19f2fbdeac756ff3aa4135aaa3d94 100644 (file)
@@ -325,3 +325,5 @@ tests/test-term-ostream-xterm-mingw.out \
 tests/test-term-ostream-xterm-16color.out \
 tests/test-term-ostream-xterm-88color.out \
 tests/test-term-ostream-xterm-256color.out
+
+maintainer-update-po:
diff --git a/update-po.sh b/update-po.sh
deleted file mode 100755 (executable)
index ab911d8..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# This script regenerates materials included in the released tarball,
-# such as PO files and manual pages.
-#
-# Before running this script, you need to have both gettext-runtime
-# and gettext-tools built in the source tree.  Parallel build trees
-# are not supported.
-#
-# Usage: ./update-po.sh
-
-# Nuisances.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-test -f gettext-runtime/config.status \
-  && test -f gettext-tools/config.status \
-  && test -f gettext-tools/examples/config.status \
-  || { echo "$0: *** build the source before running this script"; exit 1; }
-
-# Adjust the gettext_datadir and PATH envvars and run config.status
-# --recheck to prefer the included version of gettext-tools to the
-# installed version.
-prepend_path=
-case ${gettext_builddir--} in
-  -)
-    gettext_builddir=$PWD/gettext-tools/src
-    prepend_path="$gettext_builddir:$prepend_path"
-    ;;
-esac
-
-case ${gettext_datadir--} in
-  -)
-    gettext_datadir=$PWD/gettext-tools/misc
-    export gettext_datadir
-    prepend_path="$gettext_datadir:$prepend_path"
-    ;;
-esac
-
-test -n "$prepend_path" && PATH="$prepend_path:$PATH"
-export PATH
-
-echo "$0: updating PO files in gettext-runtime..."
-(cd gettext-runtime \
- && ./config.status --recheck \
- && ./config.status po/Makefile.in po-directories \
- && (cd po && make update-po)) || exit $?
-
-echo "$0: updating PO files in gettext-tools..."
-(cd gettext-tools \
- && ./config.status --recheck \
- && ./config.status po/Makefile.in po-directories \
- && (cd po && make update-po)) || exit $?
-
-echo "$0: updating manual pages in gettext-tools..."
-(cd gettext-tools/man && make update-man1) || exit $?
-
-echo "$0: updating PO files in gettext-tools/examples..."
-(cd gettext-tools/examples \
- && ./config.status --recheck \
- && ./config.status po/Makefile \
- && (cd po && make update-po)) || exit $?