1259698Sdim# Makefile for PO directory in any package using GNU gettext.
2259698Sdim# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3259698Sdim#
4259698Sdim# This file can be copied and used freely without restrictions.  It can
5259698Sdim# be used in projects which are not available under the GNU General Public
6259698Sdim# License but which still want to provide support for the GNU gettext
7259698Sdim# functionality.
8259698Sdim# Please note that the actual code of GNU gettext is covered by the GNU
9259698Sdim# General Public License and is *not* in the public domain.
10259698Sdim#
11259698Sdim# Origin: gettext-0.18
12259698SdimGETTEXT_MACRO_VERSION = 0.18
13259698Sdim
14259698SdimPACKAGE = @PACKAGE@
15259698SdimVERSION = @VERSION@
16259698SdimPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
17259698Sdim
18259698SdimSHELL = /bin/sh
19259698Sdim@SET_MAKE@
20259698Sdim
21259698Sdimsrcdir = @srcdir@
22259698Sdimtop_srcdir = @top_srcdir@
23259698SdimVPATH = @srcdir@
24259698Sdim
25259698Sdimprefix = @prefix@
26259698Sdimexec_prefix = @exec_prefix@
27259698Sdimdatarootdir = @datarootdir@
28259698Sdimdatadir = @datadir@
29259698Sdimlocaledir = @localedir@
30259698Sdimgettextsrcdir = $(datadir)/gettext/po
31259698Sdim
32259698SdimINSTALL = @INSTALL@
33259698SdimINSTALL_DATA = @INSTALL_DATA@
34259698Sdim
35259698Sdim# We use $(mkdir_p).
36259698Sdim# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
37259698Sdim# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
38259698Sdim# @install_sh@ does not start with $(SHELL), so we add it.
39259698Sdim# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
40259698Sdim# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
41259698Sdim# versions, $(mkinstalldirs) and $(install_sh) are unused.
42259698Sdimmkinstalldirs = $(SHELL) @install_sh@ -d
43259698Sdiminstall_sh = $(SHELL) @install_sh@
44259698SdimMKDIR_P = @MKDIR_P@
45259698Sdimmkdir_p = @mkdir_p@
46259698Sdim
47259698SdimGMSGFMT_ = @GMSGFMT@
48259698SdimGMSGFMT_no = @GMSGFMT@
49259698SdimGMSGFMT_yes = @GMSGFMT_015@
50259698SdimGMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
51259698SdimMSGFMT_ = @MSGFMT@
52259698SdimMSGFMT_no = @MSGFMT@
53259698SdimMSGFMT_yes = @MSGFMT_015@
54259698SdimMSGFMT = $(MSGFMT_$(USE_MSGCTXT))
55259698SdimXGETTEXT_ = @XGETTEXT@
56259698SdimXGETTEXT_no = @XGETTEXT@
57259698SdimXGETTEXT_yes = @XGETTEXT_015@
58259698SdimXGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
59259698SdimMSGMERGE = msgmerge
60259698SdimMSGMERGE_UPDATE = @MSGMERGE@ --update
61259698SdimMSGINIT = msginit
62259698SdimMSGCONV = msgconv
63259698SdimMSGFILTER = msgfilter
64259698Sdim
65259698SdimPOFILES = @POFILES@
66259698SdimGMOFILES = @GMOFILES@
67259698SdimUPDATEPOFILES = @UPDATEPOFILES@
68259698SdimDUMMYPOFILES = @DUMMYPOFILES@
69259698SdimDISTFILES.common = Makefile.in.in remove-potcdate.sin \
70259698Sdim$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
71259698SdimDISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
72259698Sdim$(POFILES) $(GMOFILES) \
73259698Sdim$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
74259698Sdim
75259698SdimPOTFILES = \
76259698Sdim
77259698SdimCATALOGS = @CATALOGS@
78259698Sdim
79259698Sdim# Makevars gets inserted here. (Don't remove this line!)
80259698Sdim
81259698Sdim.SUFFIXES:
82259698Sdim.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
83259698Sdim
84259698Sdim.po.mo:
85259698Sdim	@echo "$(MSGFMT) -c -o $@ $<"; \
86259698Sdim	$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
87259698Sdim
88259698Sdim.po.gmo:
89259698Sdim	@lang=`echo $* | sed -e 's,.*/,,'`; \
90259698Sdim	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
91259698Sdim	echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
92259698Sdim	cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
93259698Sdim
94259698Sdim.sin.sed:
95259698Sdim	sed -e '/^#/d' $< > t-$@
96259698Sdim	mv t-$@ $@
97259698Sdim
98259698Sdim
99259698Sdimall: check-macro-version all-@USE_NLS@
100259698Sdim
101259698Sdimall-yes: stamp-po
102259698Sdimall-no:
103259698Sdim
104259698Sdim# Ensure that the gettext macros and this Makefile.in.in are in sync.
105259698Sdimcheck-macro-version:
106259698Sdim	@test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
107259698Sdim	  || { 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; \
108259698Sdim	       exit 1; \
109259698Sdim	     }
110259698Sdim
111259698Sdim# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
112259698Sdim# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
113259698Sdim# we don't want to bother translators with empty POT files). We assume that
114259698Sdim# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
115259698Sdim# In this case, stamp-po is a nop (i.e. a phony target).
116259698Sdim
117259698Sdim# stamp-po is a timestamp denoting the last time at which the CATALOGS have
118259698Sdim# been loosely updated. Its purpose is that when a developer or translator
119259698Sdim# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
120259698Sdim# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
121259698Sdim# invocations of "make" will do nothing. This timestamp would not be necessary
122259698Sdim# if updating the $(CATALOGS) would always touch them; however, the rule for
123259698Sdim# $(POFILES) has been designed to not touch files that don't need to be
124259698Sdim# changed.
125259698Sdimstamp-po: $(srcdir)/$(DOMAIN).pot
126259698Sdim	test ! -f $(srcdir)/$(DOMAIN).pot || \
127259698Sdim	  test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
128259698Sdim	@test ! -f $(srcdir)/$(DOMAIN).pot || { \
129259698Sdim	  echo "touch stamp-po" && \
130259698Sdim	  echo timestamp > stamp-poT && \
131259698Sdim	  mv stamp-poT stamp-po; \
132259698Sdim	}
133259698Sdim
134259698Sdim# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
135259698Sdim# otherwise packages like GCC can not be built if only parts of the source
136259698Sdim# have been downloaded.
137259698Sdim
138259698Sdim# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
139259698Sdim# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
140259698Sdim$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
141259698Sdim	if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
142259698Sdim	  package_gnu='GNU '; \
143259698Sdim	else \
144259698Sdim	  package_gnu=''; \
145259698Sdim	fi; \
146259698Sdim	if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
147259698Sdim	  msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
148259698Sdim	else \
149259698Sdim	  msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
150259698Sdim	fi; \
151259698Sdim	case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
152259698Sdim	  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
153259698Sdim	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
154259698Sdim	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
155259698Sdim	      --files-from=$(srcdir)/POTFILES.in \
156259698Sdim	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
157259698Sdim	      --msgid-bugs-address="$$msgid_bugs_address" \
158259698Sdim	    ;; \
159259698Sdim	  *) \
160259698Sdim	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
161259698Sdim	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
162259698Sdim	      --files-from=$(srcdir)/POTFILES.in \
163259698Sdim	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
164259698Sdim	      --package-name="$${package_gnu}@PACKAGE@" \
165259698Sdim	      --package-version='@VERSION@' \
166259698Sdim	      --msgid-bugs-address="$$msgid_bugs_address" \
167259698Sdim	    ;; \
168259698Sdim	esac
169259698Sdim	test ! -f $(DOMAIN).po || { \
170259698Sdim	  if test -f $(srcdir)/$(DOMAIN).pot; then \
171259698Sdim	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
172259698Sdim	    sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
173259698Sdim	    if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
174259698Sdim	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
175259698Sdim	    else \
176259698Sdim	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
177259698Sdim	      mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
178259698Sdim	    fi; \
179259698Sdim	  else \
180259698Sdim	    mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
181259698Sdim	  fi; \
182259698Sdim	}
183259698Sdim
184259698Sdim# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
185259698Sdim# every "make" invocation, only create it when it is missing.
186259698Sdim# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
187259698Sdim$(srcdir)/$(DOMAIN).pot:
188259698Sdim	$(MAKE) $(DOMAIN).pot-update
189259698Sdim
190259698Sdim# This target rebuilds a PO file if $(DOMAIN).pot has changed.
191259698Sdim# Note that a PO file is not touched if it doesn't need to be changed.
192259698Sdim$(POFILES): $(srcdir)/$(DOMAIN).pot
193259698Sdim	@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
194259698Sdim	if test -f "$(srcdir)/$${lang}.po"; then \
195259698Sdim	  test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
196259698Sdim	  echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
197259698Sdim	  cd $(srcdir) \
198259698Sdim	    && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
199259698Sdim	           '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
200259698Sdim	             $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
201259698Sdim	           *) \
202259698Sdim	             $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
203259698Sdim	         esac; \
204259698Sdim	       }; \
205259698Sdim	else \
206259698Sdim	  $(MAKE) $${lang}.po-create; \
207259698Sdim	fi
208259698Sdim
209259698Sdim
210259698Sdiminstall: install-exec install-data
211259698Sdiminstall-exec:
212259698Sdiminstall-data: install-data-@USE_NLS@
213259698Sdim	if test "$(PACKAGE)" = "gettext-tools"; then \
214259698Sdim	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
215259698Sdim	  for file in $(DISTFILES.common) Makevars.template; do \
216259698Sdim	    $(INSTALL_DATA) $(srcdir)/$$file \
217259698Sdim			    $(DESTDIR)$(gettextsrcdir)/$$file; \
218259698Sdim	  done; \
219259698Sdim	  for file in Makevars; do \
220259698Sdim	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
221259698Sdim	  done; \
222259698Sdim	else \
223259698Sdim	  : ; \
224259698Sdim	fi
225259698Sdiminstall-data-no: all
226259698Sdiminstall-data-yes: all
227259698Sdim	@catalogs='$(CATALOGS)'; \
228259698Sdim	for cat in $$catalogs; do \
229259698Sdim	  cat=`basename $$cat`; \
230259698Sdim	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
231259698Sdim	  dir=$(localedir)/$$lang/LC_MESSAGES; \
232259698Sdim	  $(mkdir_p) $(DESTDIR)$$dir; \
233259698Sdim	  if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
234259698Sdim	  $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
235259698Sdim	  echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
236259698Sdim	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
237259698Sdim	    if test -n "$$lc"; then \
238259698Sdim	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
239259698Sdim	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
240259698Sdim	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
241259698Sdim	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
242259698Sdim	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
243259698Sdim	         for file in *; do \
244259698Sdim	           if test -f $$file; then \
245259698Sdim	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
246259698Sdim	           fi; \
247259698Sdim	         done); \
248259698Sdim	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
249259698Sdim	      else \
250259698Sdim	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
251259698Sdim	          :; \
252259698Sdim	        else \
253259698Sdim	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
254259698Sdim	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
255259698Sdim	        fi; \
256259698Sdim	      fi; \
257259698Sdim	      rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
258259698Sdim	      ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
259259698Sdim	      ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
260259698Sdim	      cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
261259698Sdim	      echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
262259698Sdim	    fi; \
263259698Sdim	  done; \
264259698Sdim	done
265259698Sdim
266259698Sdiminstall-strip: install
267259698Sdim
268259698Sdiminstalldirs: installdirs-exec installdirs-data
269259698Sdiminstalldirs-exec:
270259698Sdiminstalldirs-data: installdirs-data-@USE_NLS@
271259698Sdim	if test "$(PACKAGE)" = "gettext-tools"; then \
272259698Sdim	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
273259698Sdim	else \
274259698Sdim	  : ; \
275259698Sdim	fi
276259698Sdiminstalldirs-data-no:
277259698Sdiminstalldirs-data-yes:
278259698Sdim	@catalogs='$(CATALOGS)'; \
279259698Sdim	for cat in $$catalogs; do \
280259698Sdim	  cat=`basename $$cat`; \
281259698Sdim	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
282259698Sdim	  dir=$(localedir)/$$lang/LC_MESSAGES; \
283259698Sdim	  $(mkdir_p) $(DESTDIR)$$dir; \
284259698Sdim	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
285259698Sdim	    if test -n "$$lc"; then \
286259698Sdim	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
287259698Sdim	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
288259698Sdim	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
289259698Sdim	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
290259698Sdim	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
291259698Sdim	         for file in *; do \
292259698Sdim	           if test -f $$file; then \
293259698Sdim	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
294259698Sdim	           fi; \
295259698Sdim	         done); \
296259698Sdim	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
297259698Sdim	      else \
298259698Sdim	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
299259698Sdim	          :; \
300259698Sdim	        else \
301259698Sdim	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
302259698Sdim	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
303259698Sdim	        fi; \
304259698Sdim	      fi; \
305259698Sdim	    fi; \
306259698Sdim	  done; \
307259698Sdim	done
308259698Sdim
309259698Sdim# Define this as empty until I found a useful application.
310259698Sdiminstallcheck:
311259698Sdim
312259698Sdimuninstall: uninstall-exec uninstall-data
313259698Sdimuninstall-exec:
314259698Sdimuninstall-data: uninstall-data-@USE_NLS@
315259698Sdim	if test "$(PACKAGE)" = "gettext-tools"; then \
316259698Sdim	  for file in $(DISTFILES.common) Makevars.template; do \
317259698Sdim	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
318259698Sdim	  done; \
319259698Sdim	else \
320259698Sdim	  : ; \
321259698Sdim	fi
322259698Sdimuninstall-data-no:
323259698Sdimuninstall-data-yes:
324259698Sdim	catalogs='$(CATALOGS)'; \
325259698Sdim	for cat in $$catalogs; do \
326259698Sdim	  cat=`basename $$cat`; \
327259698Sdim	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
328259698Sdim	  for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
329259698Sdim	    rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
330259698Sdim	  done; \
331259698Sdim	done
332259698Sdim
333259698Sdimcheck: all
334259698Sdim
335259698Sdiminfo dvi ps pdf html tags TAGS ctags CTAGS ID:
336259698Sdim
337259698Sdimmostlyclean:
338259698Sdim	rm -f remove-potcdate.sed
339259698Sdim	rm -f stamp-poT
340259698Sdim	rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
341259698Sdim	rm -fr *.o
342259698Sdim
343259698Sdimclean: mostlyclean
344259698Sdim
345259698Sdimdistclean: clean
346259698Sdim	rm -f Makefile Makefile.in POTFILES *.mo
347259698Sdim
348259698Sdimmaintainer-clean: distclean
349259698Sdim	@echo "This command is intended for maintainers to use;"
350259698Sdim	@echo "it deletes files that may require special tools to rebuild."
351259698Sdim	rm -f stamp-po $(GMOFILES)
352259698Sdim
353259698Sdimdistdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
354259698Sdimdist distdir:
355259698Sdim	$(MAKE) update-po
356259698Sdim	@$(MAKE) dist2
357259698Sdim# This is a separate target because 'update-po' must be executed before.
358259698Sdimdist2: stamp-po $(DISTFILES)
359259698Sdim	dists="$(DISTFILES)"; \
360259698Sdim	if test "$(PACKAGE)" = "gettext-tools"; then \
361259698Sdim	  dists="$$dists Makevars.template"; \
362259698Sdim	fi; \
363259698Sdim	if test -f $(srcdir)/$(DOMAIN).pot; then \
364259698Sdim	  dists="$$dists $(DOMAIN).pot stamp-po"; \
365259698Sdim	fi; \
366259698Sdim	if test -f $(srcdir)/ChangeLog; then \
367259698Sdim	  dists="$$dists ChangeLog"; \
368259698Sdim	fi; \
369259698Sdim	for i in 0 1 2 3 4 5 6 7 8 9; do \
370259698Sdim	  if test -f $(srcdir)/ChangeLog.$$i; then \
371259698Sdim	    dists="$$dists ChangeLog.$$i"; \
372259698Sdim	  fi; \
373259698Sdim	done; \
374259698Sdim	if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
375259698Sdim	for file in $$dists; do \
376259698Sdim	  if test -f $$file; then \
377259698Sdim	    cp -p $$file $(distdir) || exit 1; \
378259698Sdim	  else \
379259698Sdim	    cp -p $(srcdir)/$$file $(distdir) || exit 1; \
380259698Sdim	  fi; \
381259698Sdim	done
382259698Sdim
383259698Sdimupdate-po: Makefile
384259698Sdim	$(MAKE) $(DOMAIN).pot-update
385259698Sdim	test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
386259698Sdim	$(MAKE) update-gmo
387259698Sdim
388259698Sdim# General rule for creating PO files.
389259698Sdim
390259698Sdim.nop.po-create:
391259698Sdim	@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
392259698Sdim	echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
393259698Sdim	exit 1
394259698Sdim
395259698Sdim# General rule for updating PO files.
396259698Sdim
397259698Sdim.nop.po-update:
398259698Sdim	@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
399259698Sdim	if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
400259698Sdim	tmpdir=`pwd`; \
401259698Sdim	echo "$$lang:"; \
402259698Sdim	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
403259698Sdim	echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
404259698Sdim	cd $(srcdir); \
405259698Sdim	if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
406259698Sdim	       '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
407259698Sdim	         $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
408259698Sdim	       *) \
409259698Sdim	         $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
410259698Sdim	     esac; \
411259698Sdim	   }; then \
412259698Sdim	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
413259698Sdim	    rm -f $$tmpdir/$$lang.new.po; \
414259698Sdim	  else \
415259698Sdim	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
416259698Sdim	      :; \
417259698Sdim	    else \
418259698Sdim	      echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
419259698Sdim	      exit 1; \
420259698Sdim	    fi; \
421259698Sdim	  fi; \
422259698Sdim	else \
423259698Sdim	  echo "msgmerge for $$lang.po failed!" 1>&2; \
424259698Sdim	  rm -f $$tmpdir/$$lang.new.po; \
425259698Sdim	fi
426259698Sdim
427259698Sdim$(DUMMYPOFILES):
428259698Sdim
429259698Sdimupdate-gmo: Makefile $(GMOFILES)
430259698Sdim	@:
431259698Sdim
432259698Sdim# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
433259698Sdim# because execution permission bits may not work on the current file system.
434259698Sdim# Use @SHELL@, which is the shell determined by autoconf for the use by its
435259698Sdim# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
436259698SdimMakefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
437259698Sdim	cd $(top_builddir) \
438259698Sdim	  && @SHELL@ ./config.status $(subdir)/$@.in po-directories
439259698Sdim
440259698Sdimforce:
441259698Sdim
442259698Sdim# Tell versions [3.59,3.63) of GNU make not to export all variables.
443259698Sdim# Otherwise a system limit (for SysV at least) may be exceeded.
444259698Sdim.NOEXPORT:
445259698Sdim