1# Makefile for PO directory in any package using GNU gettext.
2# Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3#
4# This file can be copied and used freely without restrictions.  It can
5# be used in projects which are not available under the GNU General Public
6# License but which still want to provide support for the GNU gettext
7# functionality.
8# Please note that the actual code of GNU gettext is covered by the GNU
9# General Public License and is *not* in the public domain.
10#
11# Origin: gettext-0.17
12GETTEXT_MACRO_VERSION = 0.17
13
14PACKAGE = gettext-tools
15VERSION = 0.17
16PACKAGE_BUGREPORT = 
17
18SHELL = /bin/sh
19
20
21srcdir = .
22top_srcdir = ..
23
24
25prefix = /usr
26exec_prefix = ${prefix}
27datarootdir = ${prefix}/share
28datadir = ${datarootdir}
29localedir = ${datarootdir}/locale
30gettextsrcdir = $(datadir)/gettext/po
31
32INSTALL = /usr/bin/install -c
33INSTALL_DATA = ${INSTALL} -m 644
34
35# We use $(mkdir_p).
36# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
37# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
38# $(SHELL) ${TIMEMACHINE_PATH}/gettext-0.17/build-aux/install-sh does not start with $(SHELL), so we add it.
39# In automake >= 1.10, /bin/mkdir -p is derived from ${MKDIR_P}, which is defined
40# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
41# versions, $(mkinstalldirs) and $(install_sh) are unused.
42mkinstalldirs = $(SHELL) $(SHELL) ${TIMEMACHINE_PATH}/gettext-0.17/build-aux/install-sh -d
43install_sh = $(SHELL) $(SHELL) ${TIMEMACHINE_PATH}/gettext-0.17/build-aux/install-sh
44MKDIR_P = /bin/mkdir -p
45mkdir_p = /bin/mkdir -p
46
47GMSGFMT_ = /usr/bin/msgfmt
48GMSGFMT_no = /usr/bin/msgfmt
49GMSGFMT_yes = /usr/bin/msgfmt
50GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
51MSGFMT_ = /usr/bin/msgfmt
52MSGFMT_no = /usr/bin/msgfmt
53MSGFMT_yes = /usr/bin/msgfmt
54MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
55XGETTEXT_ = /usr/bin/xgettext
56XGETTEXT_no = /usr/bin/xgettext
57XGETTEXT_yes = /usr/bin/xgettext
58XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
59MSGMERGE = msgmerge
60MSGMERGE_UPDATE = /usr/bin/msgmerge --update
61MSGINIT = msginit
62MSGCONV = msgconv
63MSGFILTER = msgfilter
64
65POFILES =  be.po ca.po cs.po da.po de.po el.po en@quot.po en@boldquot.po es.po et.po eu.po fi.po fr.po gl.po id.po it.po ja.po ko.po nb.po nl.po nn.po pl.po pt.po pt_BR.po ro.po ru.po sk.po sl.po sr.po sv.po tr.po uk.po vi.po zh_CN.po zh_TW.po
66GMOFILES =  be.gmo ca.gmo cs.gmo da.gmo de.gmo el.gmo en@quot.gmo en@boldquot.gmo es.gmo et.gmo eu.gmo fi.gmo fr.gmo gl.gmo id.gmo it.gmo ja.gmo ko.gmo nb.gmo nl.gmo nn.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sl.gmo sr.gmo sv.gmo tr.gmo uk.gmo vi.gmo zh_CN.gmo zh_TW.gmo
67UPDATEPOFILES =  be.po-update ca.po-update cs.po-update da.po-update de.po-update el.po-update en@quot.po-update en@boldquot.po-update es.po-update et.po-update eu.po-update fi.po-update fr.po-update gl.po-update id.po-update it.po-update ja.po-update ko.po-update nb.po-update nl.po-update nn.po-update pl.po-update pt.po-update pt_BR.po-update ro.po-update ru.po-update sk.po-update sl.po-update sr.po-update sv.po-update tr.po-update uk.po-update vi.po-update zh_CN.po-update zh_TW.po-update
68DUMMYPOFILES =  be.nop ca.nop cs.nop da.nop de.nop el.nop en@quot.nop en@boldquot.nop es.nop et.nop eu.nop fi.nop fr.nop gl.nop id.nop it.nop ja.nop ko.nop nb.nop nl.nop nn.nop pl.nop pt.nop pt_BR.nop ro.nop ru.nop sk.nop sl.nop sr.nop sv.nop tr.nop uk.nop vi.nop zh_CN.nop zh_TW.nop
69DISTFILES.common = Makefile.in.in remove-potcdate.sin \
70$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
71DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
72$(POFILES) $(GMOFILES) \
73$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
74
75POTFILES = \
76     ../gnulib-lib/argmatch.c \
77     ../gnulib-lib/clean-temp.c \
78     ../gnulib-lib/closeout.c \
79     ../gnulib-lib/copy-file.c \
80     ../gnulib-lib/csharpcomp.c \
81     ../gnulib-lib/csharpexec.c \
82     ../gnulib-lib/error.c \
83     ../gnulib-lib/execute.c \
84     ../gnulib-lib/getopt.c \
85     ../gnulib-lib/javacomp.c \
86     ../gnulib-lib/javaexec.c \
87     ../gnulib-lib/javaversion.c \
88     ../gnulib-lib/obstack.c \
89     ../gnulib-lib/pipe.c \
90     ../gnulib-lib/quotearg.c \
91     ../gnulib-lib/w32spawn.h \
92     ../gnulib-lib/wait-process.c \
93     ../gnulib-lib/xmalloc.c \
94     ../gnulib-lib/xsetenv.c \
95     ../src/file-list.c \
96     ../src/format.c \
97     ../src/format-awk.c \
98     ../src/format-boost.c \
99     ../src/format-c.c \
100     ../src/format-csharp.c \
101     ../src/format-elisp.c \
102     ../src/format-gcc-internal.c \
103     ../src/format-invalid.h \
104     ../src/format-java.c \
105     ../src/format-librep.c \
106     ../src/format-lisp.c \
107     ../src/format-pascal.c \
108     ../src/format-perl.c \
109     ../src/format-perl-brace.c \
110     ../src/format-php.c \
111     ../src/format-python.c \
112     ../src/format-qt.c \
113     ../src/format-scheme.c \
114     ../src/format-sh.c \
115     ../src/format-tcl.c \
116     ../src/format-ycp.c \
117     ../src/hostname.c \
118     ../src/msgattrib.c \
119     ../src/msgcat.c \
120     ../src/msgcmp.c \
121     ../src/msgcomm.c \
122     ../src/msgconv.c \
123     ../src/msgen.c \
124     ../src/msgexec.c \
125     ../src/msgfilter.c \
126     ../src/msgfmt.c \
127     ../src/msggrep.c \
128     ../src/msginit.c \
129     ../src/msgl-cat.c \
130     ../src/msgl-charset.c \
131     ../src/msgl-check.c \
132     ../src/msgl-iconv.c \
133     ../src/msgmerge.c \
134     ../src/msgunfmt.c \
135     ../src/msguniq.c \
136     ../src/open-catalog.c \
137     ../src/po-charset.c \
138     ../src/po-gram-gen.y \
139     ../src/po-lex.c \
140     ../src/po-xerror.c \
141     ../src/read-catalog.c \
142     ../src/read-csharp.c \
143     ../src/read-java.c \
144     ../src/read-mo.c \
145     ../src/read-properties.c \
146     ../src/read-resources.c \
147     ../src/read-stringtable.c \
148     ../src/read-tcl.c \
149     ../src/recode-sr-latin.c \
150     ../src/urlget.c \
151     ../src/write-catalog.c \
152     ../src/write-csharp.c \
153     ../src/write-java.c \
154     ../src/write-mo.c \
155     ../src/write-po.c \
156     ../src/write-qt.c \
157     ../src/write-resources.c \
158     ../src/write-tcl.c \
159     ../src/x-awk.c \
160     ../src/x-c.c \
161     ../src/x-csharp.c \
162     ../src/x-elisp.c \
163     ../src/x-glade.c \
164     ../src/x-java.c \
165     ../src/x-librep.c \
166     ../src/x-lisp.c \
167     ../src/x-perl.c \
168     ../src/x-php.c \
169     ../src/x-po.c \
170     ../src/x-python.c \
171     ../src/x-rst.c \
172     ../src/x-scheme.c \
173     ../src/x-sh.c \
174     ../src/x-smalltalk.c \
175     ../src/x-tcl.c \
176     ../src/x-ycp.c \
177     ../src/xgettext.c \
178     ../src/user-email.sh.in \
179     ../libgettextpo/gettext-po.c
180
181CATALOGS =  be.gmo ca.gmo cs.gmo da.gmo de.gmo el.gmo en@quot.gmo en@boldquot.gmo es.gmo et.gmo eu.gmo fi.gmo fr.gmo gl.gmo id.gmo it.gmo ja.gmo ko.gmo nb.gmo nl.gmo nn.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sl.gmo sr.gmo sv.gmo tr.gmo uk.gmo vi.gmo zh_CN.gmo zh_TW.gmo
182
183# Makevars gets inserted here. (Don't remove this line!)
184# Makefile variables for PO directory in any package using GNU gettext.
185
186# Usually the message domain is the same as the package name.
187DOMAIN = $(PACKAGE)
188
189# These two variables depend on the location of this directory.
190subdir = po
191top_builddir = ..
192
193# These options get passed to xgettext.
194XGETTEXT_OPTIONS = \
195  --keyword=_ --flag=_:1:pass-c-format \
196  --keyword=N_ --flag=N_:1:pass-c-format \
197  --keyword='proper_name:1,"This is a proper name. See the gettext manual, section Names."' \
198  --keyword='proper_name_utf8:1,"This is a proper name. See the gettext manual, section Names."' \
199  --flag=error:3:c-format --flag=error_at_line:5:c-format \
200  --flag=asprintf:2:c-format --flag=vasprintf:2:c-format \
201  --flag=xasprintf:1:c-format --flag=error_logger:1:c-format \
202  --flag=po_error:3:c-format --flag=po_error_at_line:5:c-format \
203  --flag=po_gram_error:1:c-format --flag=po_gram_error_at_line:2:c-format
204
205# This is the copyright holder that gets inserted into the header of the
206# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
207# package.  (Note that the msgstr strings, extracted from the package's
208# sources, belong to the copyright holder of the package.)  Translators are
209# expected to transfer the copyright for their translations to this person
210# or entity, or to disclaim their copyright.  The empty string stands for
211# the public domain; in this case the translators are expected to disclaim
212# their copyright.
213COPYRIGHT_HOLDER = Free Software Foundation, Inc.
214
215# This is the email address or URL to which the translators shall report
216# bugs in the untranslated strings:
217# - Strings which are not entire sentences, see the maintainer guidelines
218#   in the GNU gettext documentation, section 'Preparing Strings'.
219# - Strings which use unclear terms or require additional context to be
220#   understood.
221# - Strings which make invalid assumptions about notation of date, time or
222#   money.
223# - Pluralisation problems.
224# - Incorrect English spelling.
225# - Incorrect formatting.
226# It can be your email address, or a mailing list address where translators
227# can write to without being subscribed, or the URL of a web page through
228# which the translators can contact you.
229MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org
230
231# This is the list of locale categories, beyond LC_MESSAGES, for which the
232# message catalogs shall be used.  It is usually empty.
233EXTRA_LOCALE_CATEGORIES =
234
235# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
236# context.  Possible values are "yes" and "no".  Set this to yes if the
237# package uses functions taking also a message context, like pgettext(), or
238# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
239USE_MSGCTXT = no
240
241.SUFFIXES:
242.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
243
244.po.mo:
245	@echo "$(MSGFMT) -c -o $@ $<"; \
246	$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
247
248.po.gmo:
249	@lang=`echo $* | sed -e 's,.*/,,'`; \
250	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
251	echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
252	cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
253
254.sin.sed:
255	sed -e '/^#/d' $< > t-$@
256	mv t-$@ $@
257
258
259all: check-macro-version all-yes
260
261all-yes: stamp-po
262all-no:
263
264# Ensure that the gettext macros and this Makefile.in.in are in sync.
265check-macro-version:
266	@test "$(GETTEXT_MACRO_VERSION)" = "0.17" \
267	  || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version 0.17" 1>&2; \
268	       exit 1; \
269	     }
270
271# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
272# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
273# we don't want to bother translators with empty POT files). We assume that
274# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
275# In this case, stamp-po is a nop (i.e. a phony target).
276
277# stamp-po is a timestamp denoting the last time at which the CATALOGS have
278# been loosely updated. Its purpose is that when a developer or translator
279# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
280# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
281# invocations of "make" will do nothing. This timestamp would not be necessary
282# if updating the $(CATALOGS) would always touch them; however, the rule for
283# $(POFILES) has been designed to not touch files that don't need to be
284# changed.
285stamp-po: $(srcdir)/$(DOMAIN).pot
286	test ! -f $(srcdir)/$(DOMAIN).pot || \
287	  test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
288	@test ! -f $(srcdir)/$(DOMAIN).pot || { \
289	  echo "touch stamp-po" && \
290	  echo timestamp > stamp-poT && \
291	  mv stamp-poT stamp-po; \
292	}
293
294# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
295# otherwise packages like GCC can not be built if only parts of the source
296# have been downloaded.
297
298# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
299# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
300$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
301	if LC_ALL=C grep 'GNU gettext-tools' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
302	  package_gnu='GNU '; \
303	else \
304	  package_gnu=''; \
305	fi; \
306	if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
307	  msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
308	else \
309	  msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
310	fi; \
311	case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
312	  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
313	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
314	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS)  --flag=error:3:c-format --flag=error_at_line:5:c-format --flag=asprintf:2:c-format --flag=vasprintf:2:c-format --flag=xasprintf:1:c-format --flag=error:3:c-format --flag=error_at_line:5:c-format --flag=asprintf:2:c-format --flag=vasprintf:2:c-format --flag=xasprintf:1:c-format \
315	      --files-from=$(srcdir)/POTFILES.in \
316	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
317	      --msgid-bugs-address="$$msgid_bugs_address" \
318	    ;; \
319	  *) \
320	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
321	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS)  --flag=error:3:c-format --flag=error_at_line:5:c-format --flag=asprintf:2:c-format --flag=vasprintf:2:c-format --flag=xasprintf:1:c-format --flag=error:3:c-format --flag=error_at_line:5:c-format --flag=asprintf:2:c-format --flag=vasprintf:2:c-format --flag=xasprintf:1:c-format \
322	      --files-from=$(srcdir)/POTFILES.in \
323	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
324	      --package-name="$${package_gnu}gettext-tools" \
325	      --package-version='0.17' \
326	      --msgid-bugs-address="$$msgid_bugs_address" \
327	    ;; \
328	esac
329	test ! -f $(DOMAIN).po || { \
330	  if test -f $(srcdir)/$(DOMAIN).pot; then \
331	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
332	    sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
333	    if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
334	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
335	    else \
336	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
337	      mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
338	    fi; \
339	  else \
340	    mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
341	  fi; \
342	}
343
344# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
345# every "make" invocation, only create it when it is missing.
346# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
347$(srcdir)/$(DOMAIN).pot:
348	$(MAKE) $(DOMAIN).pot-update
349
350# This target rebuilds a PO file if $(DOMAIN).pot has changed.
351# Note that a PO file is not touched if it doesn't need to be changed.
352$(POFILES): $(srcdir)/$(DOMAIN).pot
353	@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
354	if test -f "$(srcdir)/$${lang}.po"; then \
355	  test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
356	  echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
357	  cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
358	else \
359	  $(MAKE) $${lang}.po-create; \
360	fi
361
362
363install: install-exec install-data
364install-exec:
365install-data: install-data-yes
366	if test "$(PACKAGE)" = "gettext-tools"; then \
367	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
368	  for file in $(DISTFILES.common) Makevars.template; do \
369	    $(INSTALL_DATA) $(srcdir)/$$file \
370			    $(DESTDIR)$(gettextsrcdir)/$$file; \
371	  done; \
372	  for file in Makevars; do \
373	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
374	  done; \
375	else \
376	  : ; \
377	fi
378install-data-no: all
379install-data-yes: all
380	$(mkdir_p) $(DESTDIR)$(datadir)
381	@catalogs='$(CATALOGS)'; \
382	for cat in $$catalogs; do \
383	  cat=`basename $$cat`; \
384	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
385	  dir=$(localedir)/$$lang/LC_MESSAGES; \
386	  $(mkdir_p) $(DESTDIR)$$dir; \
387	  if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
388	  $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
389	  echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
390	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
391	    if test -n "$$lc"; then \
392	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
393	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
394	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
395	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
396	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
397	         for file in *; do \
398	           if test -f $$file; then \
399	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
400	           fi; \
401	         done); \
402	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
403	      else \
404	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
405	          :; \
406	        else \
407	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
408	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
409	        fi; \
410	      fi; \
411	      rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
412	      ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
413	      ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
414	      cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
415	      echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
416	    fi; \
417	  done; \
418	done
419
420install-strip: install
421
422installdirs: installdirs-exec installdirs-data
423installdirs-exec:
424installdirs-data: installdirs-data-yes
425	if test "$(PACKAGE)" = "gettext-tools"; then \
426	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
427	else \
428	  : ; \
429	fi
430installdirs-data-no:
431installdirs-data-yes:
432	$(mkdir_p) $(DESTDIR)$(datadir)
433	@catalogs='$(CATALOGS)'; \
434	for cat in $$catalogs; do \
435	  cat=`basename $$cat`; \
436	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
437	  dir=$(localedir)/$$lang/LC_MESSAGES; \
438	  $(mkdir_p) $(DESTDIR)$$dir; \
439	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
440	    if test -n "$$lc"; then \
441	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
442	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
443	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
444	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
445	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
446	         for file in *; do \
447	           if test -f $$file; then \
448	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
449	           fi; \
450	         done); \
451	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
452	      else \
453	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
454	          :; \
455	        else \
456	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
457	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
458	        fi; \
459	      fi; \
460	    fi; \
461	  done; \
462	done
463
464# Define this as empty until I found a useful application.
465installcheck:
466
467uninstall: uninstall-exec uninstall-data
468uninstall-exec:
469uninstall-data: uninstall-data-yes
470	if test "$(PACKAGE)" = "gettext-tools"; then \
471	  for file in $(DISTFILES.common) Makevars.template; do \
472	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
473	  done; \
474	else \
475	  : ; \
476	fi
477uninstall-data-no:
478uninstall-data-yes:
479	catalogs='$(CATALOGS)'; \
480	for cat in $$catalogs; do \
481	  cat=`basename $$cat`; \
482	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
483	  for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
484	    rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
485	  done; \
486	done
487
488check: all
489
490info dvi ps pdf html tags TAGS ctags CTAGS ID:
491
492mostlyclean:
493	rm -f remove-potcdate.sed
494	rm -f stamp-poT
495	rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
496	rm -fr *.o
497
498clean: mostlyclean
499
500distclean: clean
501	rm -f Makefile Makefile.in POTFILES *.mo
502
503maintainer-clean: distclean
504	@echo "This command is intended for maintainers to use;"
505	@echo "it deletes files that may require special tools to rebuild."
506	rm -f stamp-po $(GMOFILES)
507
508distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
509dist distdir:
510	$(MAKE) update-po
511	@$(MAKE) dist2
512# This is a separate target because 'update-po' must be executed before.
513dist2: stamp-po $(DISTFILES)
514	dists="$(DISTFILES)"; \
515	if test "$(PACKAGE)" = "gettext-tools"; then \
516	  dists="$$dists Makevars.template"; \
517	fi; \
518	if test -f $(srcdir)/$(DOMAIN).pot; then \
519	  dists="$$dists $(DOMAIN).pot stamp-po"; \
520	fi; \
521	if test -f $(srcdir)/ChangeLog; then \
522	  dists="$$dists ChangeLog"; \
523	fi; \
524	for i in 0 1 2 3 4 5 6 7 8 9; do \
525	  if test -f $(srcdir)/ChangeLog.$$i; then \
526	    dists="$$dists ChangeLog.$$i"; \
527	  fi; \
528	done; \
529	if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
530	for file in $$dists; do \
531	  if test -f $$file; then \
532	    cp -p $$file $(distdir) || exit 1; \
533	  else \
534	    cp -p $(srcdir)/$$file $(distdir) || exit 1; \
535	  fi; \
536	done
537
538update-po: Makefile
539	$(MAKE) $(DOMAIN).pot-update
540	test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
541	$(MAKE) update-gmo
542
543# General rule for creating PO files.
544
545.nop.po-create:
546	@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
547	echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
548	exit 1
549
550# General rule for updating PO files.
551
552.nop.po-update:
553	@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
554	if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
555	tmpdir=`pwd`; \
556	echo "$$lang:"; \
557	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
558	echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
559	cd $(srcdir); \
560	if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
561	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
562	    rm -f $$tmpdir/$$lang.new.po; \
563	  else \
564	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
565	      :; \
566	    else \
567	      echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
568	      exit 1; \
569	    fi; \
570	  fi; \
571	else \
572	  echo "msgmerge for $$lang.po failed!" 1>&2; \
573	  rm -f $$tmpdir/$$lang.new.po; \
574	fi
575
576$(DUMMYPOFILES):
577
578update-gmo: Makefile $(GMOFILES)
579	@:
580
581Makefile: Makefile.in.in Makevars $(top_builddir)/config.status POTFILES.in LINGUAS
582	cd $(top_builddir) \
583	  && $(SHELL) ./config.status $(subdir)/$@.in po-directories
584
585force:
586
587# Tell versions [3.59,3.63) of GNU make not to export all variables.
588# Otherwise a system limit (for SysV at least) may be exceeded.
589.NOEXPORT:
590# Special Makefile rules for English message catalogs with quotation marks.
591
592DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
593
594.SUFFIXES: .insert-header .po-update-en
595
596en@quot.po-create:
597	$(MAKE) en@quot.po-update
598en@boldquot.po-create:
599	$(MAKE) en@boldquot.po-update
600
601en@quot.po-update: en@quot.po-update-en
602en@boldquot.po-update: en@boldquot.po-update-en
603
604.insert-header.po-update-en:
605	@lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
606	if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
607	tmpdir=`pwd`; \
608	echo "$$lang:"; \
609	ll=`echo $$lang | sed -e 's/@.*//'`; \
610	LC_ALL=C; export LC_ALL; \
611	cd $(srcdir); \
612	if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
613	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
614	    rm -f $$tmpdir/$$lang.new.po; \
615	  else \
616	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
617	      :; \
618	    else \
619	      echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
620	      exit 1; \
621	    fi; \
622	  fi; \
623	else \
624	  echo "creation of $$lang.po failed!" 1>&2; \
625	  rm -f $$tmpdir/$$lang.new.po; \
626	fi
627
628en@quot.insert-header: insert-header.sin
629	sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
630
631en@boldquot.insert-header: insert-header.sin
632	sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
633
634mostlyclean: mostlyclean-quot
635mostlyclean-quot:
636	rm -f *.insert-header
637