# $Id: Makefile.am,v 1.19 2006/05/29 21:17:02 vanbaal Exp $ # $Source: /cvsroot/logreport/service/all/po/Makefile.am,v $ # Makefile for various po files. # See # http://www.iro.umontreal.ca/translation/HTML/index.html # for hints on how to start your own translation COPYRIGHT_HOLDER = Stichting LogReport Foundation MSGID_BUGS_ADDRESS = bugs@logreport.org CONFIG_SPEC_DIR = all/lib/config-spec CONFIG_SPEC = lire.xml CONFIG_SPEC_IN = lire.xml.in CONFIG_SPECS = \ $(wildcard $(top_srcdir)/all/lib/Lire/ChartTypes/*.xml) \ $(wildcard $(top_srcdir)/all/lib/Lire/OutputFormats/*.xml) SPECS = config_spec:$(top_builddir)/$(CONFIG_SPEC_DIR)/$(CONFIG_SPEC) \ $(addprefix config_spec:, $(CONFIG_SPECS)) TEXTDOMAIN = lire XML_POT_SRC = config-spec.pot.pl LINGUAS = fr nl TEMPLATES = $(TEXTDOMAIN).pot CATALOGS = $(addsuffix .po, $(LINGUAS)) MO_FILES = $(addsuffix .mo, $(LINGUAS)) POTFILES = $(shell (find $(srcdir)/.. -name '*.pm' -o -name '*.in' | xargs grep -l 'use Locale::TextDomain' | grep -v Makefile )) LR_SPEC2POT = $(top_builddir)/all/script/lr_spec2pot SUFFIXES = .po .mo .pot BUILT_SOURCES = $(TEMPLATES) $(MO_FILES) $(XML_POT_SRC) lire-xml-stamp EXTRA_DIST = $(CATALOGS) $(BUILT_SOURCES) MAINTAINERCLEANFILES = $(BUILT_SOURCES) lire-xml-stamp : $(top_builddir)/$(CONFIG_SPEC_DIR)/$(CONFIG_SPEC_IN) cd $(top_builddir)/all/lib/config-spec && make lire.xml touch $@ $(LR_SPEC2POT): $(top_srcdir)/all/script/lr_spec2pot.in cd $(top_builddir)/all/script && $(MAKE) lr_spec2pot $(XML_POT_SRC): $(CONFIG_SPECS) lire-xml-stamp @PERL@ -I$(top_srcdir)/all/lib $(LR_SPEC2POT) \ --cfgspecdir $(top_srcdir)/all/lib/config-spec \ --schemasdir $(top_srcdir)/all/schemas \ $(SPECS) schema:lire_import_stats schema:lire_import_log \ > $(builddir)$(XML_POT_SRC) || ( rm -f $(XML_POT_SRC); false) $(TEMPLATES): $(POTFILES) $(XML_POT_SRC) @echo Updating \'$@\' catalog template. $(XGETTEXT) --sort-output --foreign-user \ --add-comments=REFERENCE: \ --copyright-holder="$(COPYRIGHT_HOLDER)" \ --msgid-bugs-address="$(MSGID_BUGS_ADDRESS)" \ --keyword='$$__' --keyword=__ --keyword=__x \ --keyword=__n:1,2 --keyword=__nx:1,2 --keyword=__xn:1,2 \ --keyword=N__ --language=Perl --output $@ $^ $(CATALOGS): $(TEMPLATES) @echo Updating \'$@\' catalog. @if test -f $@; then : ; else cp $< $@; fi $(MSGMERGE) -U $@ $< && touch $@ .po.mo: @echo Generating \'$@\'. $(MSGFMT) --check --statistics --verbose -o $@ $< install-data-local: @cd $(srcdir); \ targetdir='$(DESTDIR)$(LR_PERL5LIBDIR)/LocaleData'; \ languages='$(LINGUAS)'; \ for lang in $$languages; do \ mkdir -p "$$targetdir/$$lang/LC_MESSAGES" || exit 1; \ dest="$$targetdir/$$lang/LC_MESSAGES/$(TEXTDOMAIN).mo"; \ cat="$$lang.mo"; \ echo "Installing $$cat as $$dest"; \ cp -f $$cat $$dest && chmod 644 $$dest || exit 1; \ done uninstall-local: @cd $(srcdir); \ targetdir='$(DESTDIR)$(LR_PERL5LIBDIR)/LocaleData'; \ languages='$(LINGUAS)'; \ for lang in $$languages; do \ rm -f $$targetdir/$$lang/LC_MESSAGES/$(TEXTDOMAIN).mo; \ done