# Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 1995-1997, 2000-2005 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
# 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
# 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@
prefix = @prefix@
exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
datadir = @datadir@
localedir = $(datadir)/locale
gettextsrcdir = $(datadir)/gettext/po
MKINSTALLDIRS = @MKINSTALLDIRS@
mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
-AWK = @AWK@
GMSGFMT = @GMSGFMT@
MSGFMT = @MSGFMT@
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 = \
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,
# $(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
# 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 && \
$(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; \
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
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
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: 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 $^
-qt_l10n.pot: $(top_srcdir)/src/frontends/qt3/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);\
- }\
- BEGIN { \
- previousline=""; \
- } \
- { \
- if (!(previousline ~ /^ *< *property *name *= *"shortcut" *> *$$/) \
- && $$0 ~ /<string>/) { \
- line=$$0; \
- sub(/.*<string>/, "", 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); \
- } \
- } \
- previousline=$$0; \
- }' \
- ${top_srcdir}/src/frontends/qt3/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); \
- 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 \
- | sed 's/\\/\\\\/g' > $@
+ 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.php: $(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.