X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=po%2FMakefile.in.in;h=516ad847c3185f690a8e7321052ac25bcf739f2e;hb=e54ae72e5fac6f750c3f7972c74bb42b57f3a049;hp=341782a6d651a2d2e7469b0dd4dfc451ab3c9d24;hpb=ded8e8a8e96ceaab3ea8873a0e441dd28f59bad1;p=lyx.git diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 341782a6d6..516ad847c3 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -1,5 +1,5 @@ # Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper +# Copyright (C) 1995-1997, 2000-2005 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public @@ -8,10 +8,11 @@ # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # -# Origin: gettext-0.14 +# Origin: gettext-0.14.4 PACKAGE = @PACKAGE@ VERSION = @VERSION@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ @@ -32,7 +33,6 @@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) -AWK = @AWK@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ @@ -49,11 +49,11 @@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) -DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) -DISTFILES.extra1 = lyx_pot.py +DISTFILES.extra1 = lyx_pot.py postats.sh pocheck.pl POTFILE_IN_DEPS = $(shell find $(top_srcdir)/src -name Makefile.am) @@ -86,6 +86,12 @@ all: all-@USE_NLS@ all-yes: stamp-po all-no: +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. +# In this case, stamp-po is a nop (i.e. a phony target). + # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, @@ -95,10 +101,13 @@ all-no: # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot - test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) - @echo "touch stamp-po" - @echo timestamp > stamp-poT - @mv stamp-poT stamp-po + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch stamp-po" && \ + echo timestamp > stamp-poT && \ + mv stamp-poT stamp-po; \ + } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source @@ -108,11 +117,16 @@ stamp-po: $(srcdir)/$(DOMAIN).pot # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed $(MAKE) l10n_pots + if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' + --msgid-bugs-address="$$msgid_bugs_address" test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ @@ -297,11 +311,14 @@ dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. -dist2: $(DISTFILES) +dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + dists="$$dists $(DOMAIN).pot stamp-po"; \ + fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ @@ -313,9 +330,9 @@ dist2: $(DISTFILES) if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ - cp -p $$file $(distdir); \ + cp -p $$file $(distdir) || exit 1; \ else \ - cp -p $(srcdir)/$$file $(distdir); \ + cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done @@ -362,7 +379,7 @@ $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: -Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@ +Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status @@ -371,34 +388,37 @@ ${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS) LC_ALL=C ; export LC_ALL ; \ rm -f $@-t \ && ( cd $(top_srcdir); \ - grep -l "_(\".*\")" `find src \( -name '*.[Cch]' -o -name '*.C.in' \) -print` |\ - grep -v -e "src/support/package.C$$" |\ + grep -l "_(\".*\")" `find src \( -name '*.h' -o -name '*.cpp' -o -name '*.cpp.in' \) -print` |\ + grep -v -e "src/support/Package.cpp$$" |\ sort | uniq ) > $@-t \ && mv $@-t $@ -l10n_pots: qt4_l10n.pot layouts_l10n.pot languages_l10n.pot ui_l10n.pot +l10n_pots: qt4_l10n.pot layouts_l10n.pot languages_l10n.pot ui_l10n.pot external_l10n.pot cat $^ | \ msguniq -o $(DOMAIN).po && rm -f $^ qt4_l10n.pot: $(top_srcdir)/src/frontends/qt4/ui/*.ui LC_ALL=C ; export LC_ALL ; \ - python $(srcdir)/lyx_pot.py -b .. -o $@ -t qt4 ${top_srcdir}/src/frontends/qt4/ui/*.ui + python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t qt4 ${top_srcdir}/src/frontends/qt4/ui/*.ui layouts_l10n.pot: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc LC_ALL=C ; export LC_ALL ; \ - python $(srcdir)/lyx_pot.py -b .. -o $@ -t layouts ${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc + python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t layouts ${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc languages_l10n.pot: $(top_srcdir)/lib/languages - python $(srcdir)/lyx_pot.py -b .. -o $@ -t languages ${top_srcdir}/lib/languages + python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t languages ${top_srcdir}/lib/languages ui_l10n.pot: $(top_srcdir)/lib/ui/*.ui $(top_srcdir)/lib/ui/*.inc LC_ALL=C ; export LC_ALL ; \ - python $(srcdir)/lyx_pot.py -b .. -o $@ -t ui ${top_srcdir}/lib/ui/*.ui ${top_srcdir}/lib/ui/*.inc + python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t ui ${top_srcdir}/lib/ui/*.ui ${top_srcdir}/lib/ui/*.inc i18n.php: $(POFILES) postats.sh (cd $(srcdir) ; ./postats.sh $(POFILES)) >$@ +external_l10n.pot: $(top_srcdir)/lib/external_templates + python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t external ${top_srcdir}/lib/external_templates + force: # Tell versions [3.59,3.63) of GNU make not to export all variables.