jpayne@68: # Makefile for PO directory in any package using GNU gettext. jpayne@68: # Copyright (C) 1995-2000 Ulrich Drepper jpayne@68: # Copyright (C) 2000-2023 Free Software Foundation, Inc. jpayne@68: # jpayne@68: # Copying and distribution of this file, with or without modification, jpayne@68: # are permitted in any medium without royalty provided the copyright jpayne@68: # notice and this notice are preserved. This file is offered as-is, jpayne@68: # without any warranty. jpayne@68: # jpayne@68: # Origin: gettext-0.22 jpayne@68: GETTEXT_MACRO_VERSION = 0.20 jpayne@68: jpayne@68: PACKAGE = @PACKAGE@ jpayne@68: VERSION = @VERSION@ jpayne@68: PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ jpayne@68: jpayne@68: SED = @SED@ jpayne@68: SHELL = /bin/sh jpayne@68: @SET_MAKE@ jpayne@68: jpayne@68: srcdir = @srcdir@ jpayne@68: top_srcdir = @top_srcdir@ jpayne@68: VPATH = @srcdir@ jpayne@68: jpayne@68: prefix = @prefix@ jpayne@68: exec_prefix = @exec_prefix@ jpayne@68: datarootdir = @datarootdir@ jpayne@68: datadir = @datadir@ jpayne@68: localedir = @localedir@ jpayne@68: gettextsrcdir = $(datadir)/gettext/po jpayne@68: jpayne@68: INSTALL = @INSTALL@ jpayne@68: INSTALL_DATA = @INSTALL_DATA@ jpayne@68: jpayne@68: # We use $(mkdir_p). jpayne@68: # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as jpayne@68: # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, jpayne@68: # @install_sh@ does not start with $(SHELL), so we add it. jpayne@68: # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined jpayne@68: # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake jpayne@68: # versions, $(mkinstalldirs) and $(install_sh) are unused. jpayne@68: mkinstalldirs = $(SHELL) @install_sh@ -d jpayne@68: install_sh = $(SHELL) @install_sh@ jpayne@68: MKDIR_P = @MKDIR_P@ jpayne@68: mkdir_p = @mkdir_p@ jpayne@68: jpayne@68: # When building gettext-tools, we prefer to use the built programs jpayne@68: # rather than installed programs. However, we can't do that when we jpayne@68: # are cross compiling. jpayne@68: CROSS_COMPILING = @CROSS_COMPILING@ jpayne@68: jpayne@68: GMSGFMT_ = @GMSGFMT@ jpayne@68: GMSGFMT_no = @GMSGFMT@ jpayne@68: GMSGFMT_yes = @GMSGFMT_015@ jpayne@68: GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) jpayne@68: XGETTEXT_ = @XGETTEXT@ jpayne@68: XGETTEXT_no = @XGETTEXT@ jpayne@68: XGETTEXT_yes = @XGETTEXT_015@ jpayne@68: XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) jpayne@68: MSGMERGE = @MSGMERGE@ jpayne@68: MSGMERGE_UPDATE = @MSGMERGE@ --update jpayne@68: MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ jpayne@68: MSGINIT = msginit jpayne@68: MSGCONV = msgconv jpayne@68: MSGFILTER = msgfilter jpayne@68: jpayne@68: POFILES = @POFILES@ jpayne@68: GMOFILES = @GMOFILES@ jpayne@68: UPDATEPOFILES = @UPDATEPOFILES@ jpayne@68: DUMMYPOFILES = @DUMMYPOFILES@ jpayne@68: DISTFILES.common = Makefile.in.in remove-potcdate.sin \ jpayne@68: $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) jpayne@68: DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ jpayne@68: $(POFILES) $(GMOFILES) \ jpayne@68: $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) jpayne@68: jpayne@68: POTFILES = \ jpayne@68: jpayne@68: CATALOGS = @CATALOGS@ jpayne@68: jpayne@68: POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot jpayne@68: POFILESDEPS_yes = $(POFILESDEPS_) jpayne@68: POFILESDEPS_no = jpayne@68: POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) jpayne@68: jpayne@68: DISTFILESDEPS_ = update-po jpayne@68: DISTFILESDEPS_yes = $(DISTFILESDEPS_) jpayne@68: DISTFILESDEPS_no = jpayne@68: DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) jpayne@68: jpayne@68: # Makevars gets inserted here. (Don't remove this line!) jpayne@68: jpayne@68: all: all-@USE_NLS@ jpayne@68: jpayne@68: jpayne@68: .SUFFIXES: jpayne@68: .SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update jpayne@68: jpayne@68: # The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs. jpayne@68: # The GNU Coding Standards say in jpayne@68: # : jpayne@68: # "GNU distributions usually contain some files which are not source files jpayne@68: # ... . Since these files normally appear in the source directory, they jpayne@68: # should always appear in the source directory, not in the build directory. jpayne@68: # So Makefile rules to update them should put the updated files in the jpayne@68: # source directory." jpayne@68: # Therefore we put these files in the source directory, not the build directory. jpayne@68: jpayne@68: # During .po -> .gmo conversion, take into account the most recent changes to jpayne@68: # the .pot file. This eliminates the need to update the .po files when the jpayne@68: # .pot file has changed, which would be troublesome if the .po files are put jpayne@68: # under version control. jpayne@68: $(GMOFILES): $(srcdir)/$(DOMAIN).pot jpayne@68: .po.gmo: jpayne@68: @lang=`echo $* | sed -e 's,.*/,,'`; \ jpayne@68: test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ jpayne@68: echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \ jpayne@68: cd $(srcdir) && \ jpayne@68: rm -f $${lang}.gmo && \ jpayne@68: $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \ jpayne@68: $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \ jpayne@68: mv t-$${lang}.gmo $${lang}.gmo && \ jpayne@68: rm -f $${lang}.1po jpayne@68: jpayne@68: .sin.sed: jpayne@68: sed -e '/^#/d' $< > t-$@ jpayne@68: mv t-$@ $@ jpayne@68: jpayne@68: jpayne@68: all-yes: $(srcdir)/stamp-po jpayne@68: all-no: jpayne@68: jpayne@68: # Ensure that the gettext macros and this Makefile.in.in are in sync. jpayne@68: CHECK_MACRO_VERSION = \ jpayne@68: test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ jpayne@68: || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ jpayne@68: exit 1; \ jpayne@68: } jpayne@68: jpayne@68: # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no jpayne@68: # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because jpayne@68: # we don't want to bother translators with empty POT files). We assume that jpayne@68: # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. jpayne@68: # In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). jpayne@68: jpayne@68: # $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS jpayne@68: # have been loosely updated. Its purpose is that when a developer or translator jpayne@68: # checks out the package from a version control system, and the $(DOMAIN).pot jpayne@68: # file is not under version control, "make" will update the $(DOMAIN).pot and jpayne@68: # the $(CATALOGS), but subsequent invocations of "make" will do nothing. This jpayne@68: # timestamp would not be necessary if updating the $(CATALOGS) would always jpayne@68: # touch them; however, the rule for $(POFILES) has been designed to not touch jpayne@68: # files that don't need to be changed. jpayne@68: $(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot jpayne@68: @$(CHECK_MACRO_VERSION) jpayne@68: test ! -f $(srcdir)/$(DOMAIN).pot || \ jpayne@68: test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) jpayne@68: @test ! -f $(srcdir)/$(DOMAIN).pot || { \ jpayne@68: echo "touch $(srcdir)/stamp-po" && \ jpayne@68: echo timestamp > $(srcdir)/stamp-poT && \ jpayne@68: mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ jpayne@68: } jpayne@68: jpayne@68: # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', jpayne@68: # otherwise packages like GCC can not be built if only parts of the source jpayne@68: # have been downloaded. jpayne@68: jpayne@68: # This target rebuilds $(DOMAIN).pot; it is an expensive operation. jpayne@68: # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. jpayne@68: # The determination of whether the package xyz is a GNU one is based on the jpayne@68: # heuristic whether some file in the top level directory mentions "GNU xyz". jpayne@68: # If GNU 'find' is available, we avoid grepping through monster files. jpayne@68: $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed jpayne@68: package_gnu="$(PACKAGE_GNU)"; \ jpayne@68: test -n "$$package_gnu" || { \ jpayne@68: if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ jpayne@68: LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ jpayne@68: else \ jpayne@68: LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ jpayne@68: fi; \ jpayne@68: } | grep -v 'libtool:' >/dev/null; then \ jpayne@68: package_gnu=yes; \ jpayne@68: else \ jpayne@68: package_gnu=no; \ jpayne@68: fi; \ jpayne@68: }; \ jpayne@68: if test "$$package_gnu" = "yes"; then \ jpayne@68: package_prefix='GNU '; \ jpayne@68: else \ jpayne@68: package_prefix=''; \ jpayne@68: fi; \ jpayne@68: if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ jpayne@68: msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ jpayne@68: else \ jpayne@68: msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ jpayne@68: fi; \ jpayne@68: case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ jpayne@68: '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ jpayne@68: $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ jpayne@68: --add-comments=TRANSLATORS: \ jpayne@68: --files-from=$(srcdir)/POTFILES.in \ jpayne@68: --copyright-holder='$(COPYRIGHT_HOLDER)' \ jpayne@68: --msgid-bugs-address="$$msgid_bugs_address" \ jpayne@68: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ jpayne@68: ;; \ jpayne@68: *) \ jpayne@68: $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ jpayne@68: --add-comments=TRANSLATORS: \ jpayne@68: --files-from=$(srcdir)/POTFILES.in \ jpayne@68: --copyright-holder='$(COPYRIGHT_HOLDER)' \ jpayne@68: --package-name="$${package_prefix}@PACKAGE@" \ jpayne@68: --package-version='@VERSION@' \ jpayne@68: --msgid-bugs-address="$$msgid_bugs_address" \ jpayne@68: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ jpayne@68: ;; \ jpayne@68: esac jpayne@68: test ! -f $(DOMAIN).po || { \ jpayne@68: if test -f $(srcdir)/$(DOMAIN).pot-header; then \ jpayne@68: sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ jpayne@68: cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ jpayne@68: rm -f $(DOMAIN).1po \ jpayne@68: || exit 1; \ jpayne@68: fi; \ jpayne@68: if test -f $(srcdir)/$(DOMAIN).pot; then \ jpayne@68: sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ jpayne@68: sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ jpayne@68: if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ jpayne@68: rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ jpayne@68: else \ jpayne@68: rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ jpayne@68: mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ jpayne@68: fi; \ jpayne@68: else \ jpayne@68: mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ jpayne@68: fi; \ jpayne@68: } jpayne@68: jpayne@68: # This rule has no dependencies: we don't need to update $(DOMAIN).pot at jpayne@68: # every "make" invocation, only create it when it is missing. jpayne@68: # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. jpayne@68: $(srcdir)/$(DOMAIN).pot: jpayne@68: $(MAKE) $(DOMAIN).pot-update jpayne@68: jpayne@68: # This target rebuilds a PO file if $(DOMAIN).pot has changed. jpayne@68: # Note that a PO file is not touched if it doesn't need to be changed. jpayne@68: $(POFILES): $(POFILESDEPS) jpayne@68: @test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot jpayne@68: @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ jpayne@68: if test -f "$(srcdir)/$${lang}.po"; then \ jpayne@68: test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ jpayne@68: echo "$${cdcmd}$(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ jpayne@68: cd $(srcdir) \ jpayne@68: && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ jpayne@68: '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ jpayne@68: $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ jpayne@68: 0.1[1-5] | 0.1[1-5].*) \ jpayne@68: $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ jpayne@68: 0.1[6-7] | 0.1[6-7].*) \ jpayne@68: $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ jpayne@68: *) \ jpayne@68: $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ jpayne@68: esac; \ jpayne@68: }; \ jpayne@68: else \ jpayne@68: $(MAKE) $${lang}.po-create; \ jpayne@68: fi jpayne@68: jpayne@68: jpayne@68: install: install-exec install-data jpayne@68: install-exec: jpayne@68: install-data: install-data-@USE_NLS@ jpayne@68: if test "$(PACKAGE)" = "gettext-tools"; then \ jpayne@68: $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ jpayne@68: for file in $(DISTFILES.common) Makevars.template; do \ jpayne@68: $(INSTALL_DATA) $(srcdir)/$$file \ jpayne@68: $(DESTDIR)$(gettextsrcdir)/$$file; \ jpayne@68: done; \ jpayne@68: for file in Makevars; do \ jpayne@68: rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ jpayne@68: done; \ jpayne@68: else \ jpayne@68: : ; \ jpayne@68: fi jpayne@68: install-data-no: all jpayne@68: install-data-yes: all jpayne@68: @catalogs='$(CATALOGS)'; \ jpayne@68: for cat in $$catalogs; do \ jpayne@68: cat=`basename $$cat`; \ jpayne@68: lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ jpayne@68: dir=$(localedir)/$$lang/LC_MESSAGES; \ jpayne@68: $(mkdir_p) $(DESTDIR)$$dir; \ jpayne@68: if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ jpayne@68: $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ jpayne@68: echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ jpayne@68: for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ jpayne@68: if test -n "$$lc"; then \ jpayne@68: if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ jpayne@68: link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ jpayne@68: mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ jpayne@68: mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ jpayne@68: (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ jpayne@68: for file in *; do \ jpayne@68: if test -f $$file; then \ jpayne@68: ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ jpayne@68: fi; \ jpayne@68: done); \ jpayne@68: rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ jpayne@68: else \ jpayne@68: if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ jpayne@68: :; \ jpayne@68: else \ jpayne@68: rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ jpayne@68: mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ jpayne@68: fi; \ jpayne@68: fi; \ jpayne@68: rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ jpayne@68: ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ jpayne@68: ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ jpayne@68: cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ jpayne@68: echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ jpayne@68: fi; \ jpayne@68: done; \ jpayne@68: done jpayne@68: jpayne@68: install-strip: install jpayne@68: jpayne@68: installdirs: installdirs-exec installdirs-data jpayne@68: installdirs-exec: jpayne@68: installdirs-data: installdirs-data-@USE_NLS@ jpayne@68: if test "$(PACKAGE)" = "gettext-tools"; then \ jpayne@68: $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ jpayne@68: else \ jpayne@68: : ; \ jpayne@68: fi jpayne@68: installdirs-data-no: jpayne@68: installdirs-data-yes: jpayne@68: @catalogs='$(CATALOGS)'; \ jpayne@68: for cat in $$catalogs; do \ jpayne@68: cat=`basename $$cat`; \ jpayne@68: lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ jpayne@68: dir=$(localedir)/$$lang/LC_MESSAGES; \ jpayne@68: $(mkdir_p) $(DESTDIR)$$dir; \ jpayne@68: for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ jpayne@68: if test -n "$$lc"; then \ jpayne@68: if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ jpayne@68: link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ jpayne@68: mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ jpayne@68: mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ jpayne@68: (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ jpayne@68: for file in *; do \ jpayne@68: if test -f $$file; then \ jpayne@68: ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ jpayne@68: fi; \ jpayne@68: done); \ jpayne@68: rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ jpayne@68: else \ jpayne@68: if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ jpayne@68: :; \ jpayne@68: else \ jpayne@68: rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ jpayne@68: mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ jpayne@68: fi; \ jpayne@68: fi; \ jpayne@68: fi; \ jpayne@68: done; \ jpayne@68: done jpayne@68: jpayne@68: # Define this as empty until I found a useful application. jpayne@68: installcheck: jpayne@68: jpayne@68: uninstall: uninstall-exec uninstall-data jpayne@68: uninstall-exec: jpayne@68: uninstall-data: uninstall-data-@USE_NLS@ jpayne@68: if test "$(PACKAGE)" = "gettext-tools"; then \ jpayne@68: for file in $(DISTFILES.common) Makevars.template; do \ jpayne@68: rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ jpayne@68: done; \ jpayne@68: else \ jpayne@68: : ; \ jpayne@68: fi jpayne@68: uninstall-data-no: jpayne@68: uninstall-data-yes: jpayne@68: catalogs='$(CATALOGS)'; \ jpayne@68: for cat in $$catalogs; do \ jpayne@68: cat=`basename $$cat`; \ jpayne@68: lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ jpayne@68: for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ jpayne@68: rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ jpayne@68: done; \ jpayne@68: done jpayne@68: jpayne@68: check: all jpayne@68: jpayne@68: info dvi ps pdf html tags TAGS ctags CTAGS ID: jpayne@68: jpayne@68: install-dvi install-ps install-pdf install-html: jpayne@68: jpayne@68: mostlyclean: jpayne@68: rm -f remove-potcdate.sed jpayne@68: rm -f $(srcdir)/stamp-poT jpayne@68: rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po jpayne@68: rm -fr *.o jpayne@68: jpayne@68: clean: mostlyclean jpayne@68: jpayne@68: distclean: clean jpayne@68: rm -f Makefile Makefile.in POTFILES jpayne@68: jpayne@68: maintainer-clean: distclean jpayne@68: @echo "This command is intended for maintainers to use;" jpayne@68: @echo "it deletes files that may require special tools to rebuild." jpayne@68: rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES) jpayne@68: jpayne@68: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) jpayne@68: dist distdir: jpayne@68: test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) jpayne@68: @$(MAKE) dist2 jpayne@68: # This is a separate target because 'update-po' must be executed before. jpayne@68: dist2: $(srcdir)/stamp-po $(DISTFILES) jpayne@68: @dists="$(DISTFILES)"; \ jpayne@68: if test "$(PACKAGE)" = "gettext-tools"; then \ jpayne@68: dists="$$dists Makevars.template"; \ jpayne@68: fi; \ jpayne@68: if test -f $(srcdir)/$(DOMAIN).pot; then \ jpayne@68: dists="$$dists $(DOMAIN).pot stamp-po"; \ jpayne@68: else \ jpayne@68: case $(XGETTEXT) in \ jpayne@68: :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ jpayne@68: *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the contents of the POTFILES.in file and the XGETTEXT_OPTIONS in the Makevars file." 1>&2;; \ jpayne@68: esac; \ jpayne@68: fi; \ jpayne@68: if test -f $(srcdir)/ChangeLog; then \ jpayne@68: dists="$$dists ChangeLog"; \ jpayne@68: fi; \ jpayne@68: for i in 0 1 2 3 4 5 6 7 8 9; do \ jpayne@68: if test -f $(srcdir)/ChangeLog.$$i; then \ jpayne@68: dists="$$dists ChangeLog.$$i"; \ jpayne@68: fi; \ jpayne@68: done; \ jpayne@68: if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ jpayne@68: for file in $$dists; do \ jpayne@68: if test -f $$file; then \ jpayne@68: cp -p $$file $(distdir) || exit 1; \ jpayne@68: else \ jpayne@68: cp -p $(srcdir)/$$file $(distdir) || exit 1; \ jpayne@68: fi; \ jpayne@68: done jpayne@68: jpayne@68: update-po: Makefile jpayne@68: $(MAKE) $(DOMAIN).pot-update jpayne@68: test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) jpayne@68: $(MAKE) update-gmo jpayne@68: jpayne@68: # General rule for creating PO files. jpayne@68: jpayne@68: .nop.po-create: jpayne@68: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ jpayne@68: echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ jpayne@68: exit 1 jpayne@68: jpayne@68: # General rule for updating PO files. jpayne@68: jpayne@68: .nop.po-update: jpayne@68: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ jpayne@68: if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ jpayne@68: tmpdir=`pwd`; \ jpayne@68: echo "$$lang:"; \ jpayne@68: test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ jpayne@68: echo "$${cdcmd}$(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ jpayne@68: cd $(srcdir); \ jpayne@68: if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ jpayne@68: '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ jpayne@68: $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ jpayne@68: 0.1[1-5] | 0.1[1-5].*) \ jpayne@68: $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ jpayne@68: 0.1[6-7] | 0.1[6-7].*) \ jpayne@68: $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ jpayne@68: *) \ jpayne@68: $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ jpayne@68: esac; \ jpayne@68: }; then \ jpayne@68: if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ jpayne@68: rm -f $$tmpdir/$$lang.new.po; \ jpayne@68: else \ jpayne@68: if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ jpayne@68: :; \ jpayne@68: else \ jpayne@68: echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ jpayne@68: exit 1; \ jpayne@68: fi; \ jpayne@68: fi; \ jpayne@68: else \ jpayne@68: echo "msgmerge for $$lang.po failed!" 1>&2; \ jpayne@68: rm -f $$tmpdir/$$lang.new.po; \ jpayne@68: fi jpayne@68: jpayne@68: $(DUMMYPOFILES): jpayne@68: jpayne@68: update-gmo: Makefile $(GMOFILES) jpayne@68: @: jpayne@68: jpayne@68: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, jpayne@68: # because execution permission bits may not work on the current file system. jpayne@68: # Use @SHELL@, which is the shell determined by autoconf for the use by its jpayne@68: # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. jpayne@68: Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ jpayne@68: cd $(top_builddir) \ jpayne@68: && @SHELL@ ./config.status $(subdir)/$@.in po-directories jpayne@68: jpayne@68: force: jpayne@68: jpayne@68: # Tell versions [3.59,3.63) of GNU make not to export all variables. jpayne@68: # Otherwise a system limit (for SysV at least) may be exceeded. jpayne@68: .NOEXPORT: