X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=po%2FMakefile.in.in;h=516ad847c3185f690a8e7321052ac25bcf739f2e;hb=e54ae72e5fac6f750c3f7972c74bb42b57f3a049;hp=b2795cab813cc5803b5356f9e39c661c51597958;hpb=05680d3e4fa9b80c48e099be3787a8cb0df45264;p=lyx.git diff --git a/po/Makefile.in.in b/po/Makefile.in.in index b2795cab81..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@ @@ -22,6 +23,7 @@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/po @@ -31,7 +33,6 @@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) -AWK = @AWK@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ @@ -48,10 +49,12 @@ 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 postats.sh pocheck.pl + POTFILE_IN_DEPS = $(shell find $(top_srcdir)/src -name Makefile.am) POTFILES = \ @@ -83,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, @@ -92,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 @@ -105,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 && \ @@ -294,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; \ @@ -310,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 @@ -359,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 @@ -368,157 +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` |\ - sed -e '/xforms.forms/d'| 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: xforms_l10n.pot qt_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 $^ -xforms_l10n.pot: $(top_srcdir)/src/frontends/xforms/forms/*.fd - LC_ALL=C ; export LC_ALL ; \ - $(AWK) -v top_srcdir="$(top_srcdir)" ' \ - function fixupfilename() \ - {\ - return substr(FILENAME, length(top_srcdir "/") + 1);\ - }\ - BEGIN { \ - print "#, fuzzy"; \ - print "msgid \"\""; \ - print "msgstr \"\""; \ - print "\"Content-Type: text/plain; charset=ISO-8859-1\\n\""; \ - print "\"Content-Transfer-Encoding: 8bit\\n\""; \ - print "\n"; \ - skip=0; \ - } \ - /style: 15/ { \ - skip=1; \ - } \ - /label: / { \ - if (NF > 1 && skip == 0) { \ - line=$$0;\ - sub(/label: /,"",line);\ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", fixupfilename(), FNR, line);\ - }\ - skip=0; \ - }' \ - ${top_srcdir}/src/frontends/xforms/forms/*.fd > $@ - -qt_l10n.pot: $(top_srcdir)/src/frontends/qt2/ui/*.ui + +qt4_l10n.pot: $(top_srcdir)/src/frontends/qt4/ui/*.ui LC_ALL=C ; export LC_ALL ; \ - $(AWK) -v top_srcdir="$(top_srcdir)" ' \ - function fixupfilename() \ - {\ - return substr(FILENAME, length(top_srcdir "/") + 1);\ - }\ - // { \ - line=$$0; \ - sub(/.*/, "", line); \ - sub(/<\/string>.*/, "", line); \ - gsub(/&/, "\\&", line); \ - gsub(/</, "<", line); \ - gsub(/>/, ">", line); \ - gsub(/\"/, "\\\"", line); \ - if (length(line) > 0) {\ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n",\ - fixupfilename(), FNR, line); \ - } \ - }' \ - ${top_srcdir}/src/frontends/qt2/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 ; \ - $(AWK) -v top_srcdir="$(top_srcdir)" ' \ - function fixupfilename() \ - {\ - return substr(FILENAME, length(top_srcdir "/") + 1);\ - }\ - /^Style / { \ - line=$$0; \ - sub(/Style /, "", line); \ - gsub(/\"/, "", line); \ - gsub(/_/, " ", line); \ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \ - fixupfilename(), FNR, line); \ - } \ - /LabelString[A-Za-z]*/ { \ - line=$$0; \ - sub(/[[:space:]]*LabelString[A-Za-z]*[[:space:]]*/, "", line); \ - gsub(/"/, "", line); \ - gsub(/\\/, "\\\\", line); \ - if (line != "") \ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \ - fixupfilename(), FNR, line); \ - } \ - /GuiName/ { \ - line=$$0; \ - sub(/[[:space:]]*GuiName[[:space:]]*/, "", line); \ - gsub(/"/, "", line); \ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \ - fixupfilename(), FNR, line); \ - } \ - /ListName/ { \ - line=$$0; \ - sub(/[[:space:]]*ListName[[:space:]]*/, "", line); \ - gsub(/"/, "", line); \ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \ - fixupfilename(), FNR, line); \ - }' \ - ${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 - $(AWK) -v top_srcdir="$(top_srcdir)" ' \ - function fixupfilename() \ - {\ - return substr(FILENAME, length(top_srcdir "/") + 1);\ - }\ - /^#/ { \ - next; \ - } \ - { \ - match($$0,"\"[^\"]*\""); \ - lang=substr($$0,RSTART,RLENGTH); \ - gsub(/\"/, "", lang); \ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \ - fixupfilename(), FNR, lang); \ - }' \ - ${top_srcdir}/lib/languages > $@ - -ui_l10n.pot: $(top_srcdir)/lib/ui/*.ui + 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 ; \ - $(AWK) -v top_srcdir="$(top_srcdir)" ' \ - function fixupfilename() \ - {\ - return substr(FILENAME, length(top_srcdir "/") + 1);\ - }\ - /^[^#]*Submenu/ { \ - line=$$0; \ - sub(/[^"]*"/, "", line); \ - sub(/".*/, "", line); \ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \ - fixupfilename(), FNR, line); \ - } \ - /^[^#]*Toolbar/ { \ - line=$$0; \ - sub(/[^"]*"/, "", line); \ - sub(/".*/, "", line); \ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \ - fixupfilename(), FNR, line); \ - } \ - /^[^#]*Item/ { \ - line=$$0; \ - sub(/[^"]*"/, "", line); \ - sub(/".*/, "", line); \ - printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \ - fixupfilename(), FNR, line); \ - }' \ - ${top_srcdir}/lib/ui/*.ui > $@ - -i18n.php3: $(POFILES) + 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.