From: Daiki Ueno Date: Thu, 1 May 2014 04:39:23 +0000 (+0900) Subject: Makefile.in.in: Make dependencies of a PO file and 'dist' customizable X-Git-Tag: v0.19~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82f0951f725828edb2c5f258de25e3ef119e945e;p=thirdparty%2Fgettext.git Makefile.in.in: Make dependencies of a PO file and 'dist' customizable * Makevars (POFILESDEPS): New variable. (DISTFILESDEPS): New variable. * Makefile.in.in ($(POFILES)): Depend on $(POFILESDEPS) instead of $(srcdir)/$(DOMAIN).pot. (dist distdir): Run $(DISTFILEDEPS) instead of 'update-po'. --- diff --git a/gettext-runtime/po/ChangeLog b/gettext-runtime/po/ChangeLog index d3f2cdc35..f5af2af5b 100644 --- a/gettext-runtime/po/ChangeLog +++ b/gettext-runtime/po/ChangeLog @@ -1,3 +1,12 @@ +2014-05-01 Daiki Ueno + + Makefile.in.in: Make dependencies of a PO file and 'dist' customizable + * Makevars (POFILESDEPS): New variable. + (DISTFILESDEPS): New variable. + * Makefile.in.in ($(POFILES)): Depend on $(POFILESDEPS) instead of + $(srcdir)/$(DOMAIN).pot. + (dist distdir): Run $(DISTFILEDEPS) instead of 'update-po'. + 2014-04-21 Daiki Ueno * Rules-quot: Use built-in filter if possible. diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in index fabdc76c9..5ac3f4c88 100644 --- a/gettext-runtime/po/Makefile.in.in +++ b/gettext-runtime/po/Makefile.in.in @@ -199,9 +199,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 +363,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 477dc6763..146ee3518 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. Set this to empty to suppress the behavior. +POFILESDEPS = $(srcdir)/$(DOMAIN).pot + +# 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. Set this to empty to suppress the behavior. +DISTFILESDEPS = update-po