From: Daiki Ueno Date: Fri, 25 Apr 2014 03:31:11 +0000 (+0900) Subject: build: Turn update-po.sh into a Makefile rule X-Git-Tag: v0.19~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41a2f19194e11830064583a7d7b5f86743b941ad;p=thirdparty%2Fgettext.git build: Turn update-po.sh into a Makefile rule Suggested by Andreas Stricker in: . * 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. --- diff --git a/Makefile.am b/Makefile.am index 8b094a721..22fe6144d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/autogen.sh b/autogen.sh index 9ba27524d..c5467ad93 100755 --- a/autogen.sh +++ b/autogen.sh @@ -15,8 +15,7 @@ # along with this program. If not, see . # 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 diff --git a/configure.ac b/configure.ac index 6627a4e0f..c1bee3706 100644 --- a/configure.ac +++ b/configure.ac @@ -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. diff --git a/gettext-runtime/Makefile.am b/gettext-runtime/Makefile.am index bd8fefc11..823c4f198 100644 --- a/gettext-runtime/Makefile.am +++ b/gettext-runtime/Makefile.am @@ -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 diff --git a/gettext-runtime/man/Makefile.am b/gettext-runtime/man/Makefile.am index 46e0199c1..b91896fa4 100644 --- a/gettext-runtime/man/Makefile.am +++ b/gettext-runtime/man/Makefile.am @@ -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-$@ $@ diff --git a/gettext-tools/Makefile.am b/gettext-tools/Makefile.am index e93ab1ff0..3eb3238c7 100644 --- a/gettext-tools/Makefile.am +++ b/gettext-tools/Makefile.am @@ -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 diff --git a/gettext-tools/examples/Makefile.am b/gettext-tools/examples/Makefile.am index 35ea4daf9..389489fcd 100644 --- a/gettext-tools/examples/Makefile.am +++ b/gettext-tools/examples/Makefile.am @@ -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 diff --git a/gettext-tools/man/Makefile.am b/gettext-tools/man/Makefile.am index 2b420ef33..2e8fe7291 100644 --- a/gettext-tools/man/Makefile.am +++ b/gettext-tools/man/Makefile.am @@ -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. diff --git a/gnulib-local/Makefile.am b/gnulib-local/Makefile.am index ffe16f5ab..2ffa65e8b 100644 --- a/gnulib-local/Makefile.am +++ b/gnulib-local/Makefile.am @@ -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 index ab911d8a1..000000000 --- a/update-po.sh +++ /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 . - -# 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 $?