1# Makefile for PO directory in any package using GNU gettext.
2# Copyright (C) 1995-1997, 2000-2007, 2009-2010 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.18.2
12GETTEXT_MACRO_VERSION = 0.18
13
14PACKAGE = elfutils
15VERSION = 0.161
16PACKAGE_BUGREPORT = https://bugzilla.redhat.com/
17
18SHELL = /bin/sh
19
20
21srcdir = .
22top_srcdir = ..
23
24
25prefix = /usr/local
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} /huge-ssd/aosp-arm64/external/elfutils/src/config/install-sh does not start with $(SHELL), so we add it.
39# In automake >= 1.10, $(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} /huge-ssd/aosp-arm64/external/elfutils/src/config/install-sh -d
43install_sh = $(SHELL) ${SHELL} /huge-ssd/aosp-arm64/external/elfutils/src/config/install-sh
44MKDIR_P = /bin/mkdir -p
45mkdir_p = $(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 =  de.po es.po ja.po pl.po uk.po en@quot.po en@boldquot.po
66GMOFILES =  de.gmo es.gmo ja.gmo pl.gmo uk.gmo en@quot.gmo en@boldquot.gmo
67UPDATEPOFILES =  de.po-update es.po-update ja.po-update pl.po-update uk.po-update en@quot.po-update en@boldquot.po-update
68DUMMYPOFILES =  de.nop es.nop ja.nop pl.nop uk.nop en@quot.nop en@boldquot.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     ../lib/xmalloc.c \
77     ../lib/xstrndup.c \
78     ../libasm/asm_error.c \
79     ../libdw/dwarf_error.c \
80     ../libdwfl/argp-std.c \
81     ../libdwfl/libdwflP.h \
82     ../libebl/eblbackendname.c \
83     ../libebl/eblcorenotetypename.c \
84     ../libebl/ebldynamictagname.c \
85     ../libebl/eblobjecttypename.c \
86     ../libebl/eblobjnote.c \
87     ../libebl/eblobjnotetypename.c \
88     ../libebl/eblosabiname.c \
89     ../libebl/eblsectionname.c \
90     ../libebl/eblsectiontypename.c \
91     ../libebl/eblsegmenttypename.c \
92     ../libebl/eblsymbolbindingname.c \
93     ../libebl/eblsymboltypename.c \
94     ../libelf/elf_error.c \
95     ../src/addr2line.c \
96     ../src/ar.c \
97     ../src/arlib.c \
98     ../src/elfcmp.c \
99     ../src/elflint.c \
100     ../src/findtextrel.c \
101     ../src/i386_ld.c \
102     ../src/ld.c \
103     ../src/ldgeneric.c \
104     ../src/ldscript.y \
105     ../src/nm.c \
106     ../src/objdump.c \
107     ../src/ranlib.c \
108     ../src/readelf.c \
109     ../src/size.c \
110     ../src/strings.c \
111     ../src/strip.c \
112     ../src/unstrip.c
113
114CATALOGS =  de.gmo es.gmo ja.gmo pl.gmo uk.gmo en@quot.gmo en@boldquot.gmo
115
116# Makevars gets inserted here. (Don't remove this line!)
117# Makefile variables for PO directory in any package using GNU gettext.
118
119# Usually the message domain is the same as the package name.
120DOMAIN = $(PACKAGE)
121
122# These two variables depend on the location of this directory.
123subdir = po
124top_builddir = ..
125
126# These options get passed to xgettext.
127XGETTEXT_OPTIONS = --keyword=_ --keyword=N_  --flag=error:3:c-format \
128		   --flag=ERROR:1:c-format --flag=argp_error:2:c-format
129
130# This is the copyright holder that gets inserted into the header of the
131# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
132# package.  (Note that the msgstr strings, extracted from the package's
133# sources, belong to the copyright holder of the package.)  Translators are
134# expected to transfer the copyright for their translations to this person
135# or entity, or to disclaim their copyright.  The empty string stands for
136# the public domain; in this case the translators are expected to disclaim
137# their copyright.
138COPYRIGHT_HOLDER = Red Hat, Inc.
139
140# This is the email address or URL to which the translators shall report
141# bugs in the untranslated strings:
142# - Strings which are not entire sentences, see the maintainer guidelines
143#   in the GNU gettext documentation, section 'Preparing Strings'.
144# - Strings which use unclear terms or require additional context to be
145#   understood.
146# - Strings which make invalid assumptions about notation of date, time or
147#   money.
148# - Pluralisation problems.
149# - Incorrect English spelling.
150# - Incorrect formatting.
151# It can be your email address, or a mailing list address where translators
152# can write to without being subscribed, or the URL of a web page through
153# which the translators can contact you.
154MSGID_BUGS_ADDRESS = http://bugzilla.redhat.com/
155
156# This is the list of locale categories, beyond LC_MESSAGES, for which the
157# message catalogs shall be used.  It is usually empty.
158EXTRA_LOCALE_CATEGORIES =
159
160.SUFFIXES:
161.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
162
163.po.mo:
164	@echo "$(MSGFMT) -c -o $@ $<"; \
165	$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
166
167.po.gmo:
168	@lang=`echo $* | sed -e 's,.*/,,'`; \
169	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
170	echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
171	cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
172
173.sin.sed:
174	sed -e '/^#/d' $< > t-$@
175	mv t-$@ $@
176
177
178all: all-yes
179
180all-yes: stamp-po
181all-no:
182
183# Ensure that the gettext macros and this Makefile.in.in are in sync.
184CHECK_MACRO_VERSION = \
185	test "$(GETTEXT_MACRO_VERSION)" = "0.18" \
186	  || { 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.18" 1>&2; \
187	       exit 1; \
188	     }
189
190# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
191# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
192# we don't want to bother translators with empty POT files). We assume that
193# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
194# In this case, stamp-po is a nop (i.e. a phony target).
195
196# stamp-po is a timestamp denoting the last time at which the CATALOGS have
197# been loosely updated. Its purpose is that when a developer or translator
198# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
199# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
200# invocations of "make" will do nothing. This timestamp would not be necessary
201# if updating the $(CATALOGS) would always touch them; however, the rule for
202# $(POFILES) has been designed to not touch files that don't need to be
203# changed.
204stamp-po: $(srcdir)/$(DOMAIN).pot
205	@$(CHECK_MACRO_VERSION)
206	test ! -f $(srcdir)/$(DOMAIN).pot || \
207	  test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
208	@test ! -f $(srcdir)/$(DOMAIN).pot || { \
209	  echo "touch stamp-po" && \
210	  echo timestamp > stamp-poT && \
211	  mv stamp-poT stamp-po; \
212	}
213
214# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
215# otherwise packages like GCC can not be built if only parts of the source
216# have been downloaded.
217
218# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
219# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
220# The determination of whether the package xyz is a GNU one is based on the
221# heuristic whether some file in the top level directory mentions "GNU xyz".
222# If GNU 'find' is available, we avoid grepping through monster files.
223$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
224	if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
225	       LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU elfutils' /dev/null '{}' ';' 2>/dev/null; \
226	     else \
227	       LC_ALL=C grep 'GNU elfutils' $(top_srcdir)/* 2>/dev/null; \
228	     fi; \
229	   } | grep -v 'libtool:' >/dev/null; then \
230	  package_gnu='GNU '; \
231	else \
232	  package_gnu=''; \
233	fi; \
234	if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
235	  msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
236	else \
237	  msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
238	fi; \
239	case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
240	  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
241	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
242	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS)  \
243	      --files-from=$(srcdir)/POTFILES.in \
244	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
245	      --msgid-bugs-address="$$msgid_bugs_address" \
246	    ;; \
247	  *) \
248	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
249	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS)  \
250	      --files-from=$(srcdir)/POTFILES.in \
251	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
252	      --package-name="$${package_gnu}elfutils" \
253	      --package-version='0.161' \
254	      --msgid-bugs-address="$$msgid_bugs_address" \
255	    ;; \
256	esac
257	test ! -f $(DOMAIN).po || { \
258	  if test -f $(srcdir)/$(DOMAIN).pot; then \
259	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
260	    sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
261	    if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
262	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
263	    else \
264	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
265	      mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
266	    fi; \
267	  else \
268	    mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
269	  fi; \
270	}
271
272# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
273# every "make" invocation, only create it when it is missing.
274# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
275$(srcdir)/$(DOMAIN).pot:
276	$(MAKE) $(DOMAIN).pot-update
277
278# This target rebuilds a PO file if $(DOMAIN).pot has changed.
279# Note that a PO file is not touched if it doesn't need to be changed.
280$(POFILES): $(srcdir)/$(DOMAIN).pot
281	@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
282	if test -f "$(srcdir)/$${lang}.po"; then \
283	  test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
284	  echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
285	  cd $(srcdir) \
286	    && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
287	           '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
288	             $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
289	           *) \
290	             $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
291	         esac; \
292	       }; \
293	else \
294	  $(MAKE) $${lang}.po-create; \
295	fi
296
297
298install: install-exec install-data
299install-exec:
300install-data: install-data-yes
301	if test "$(PACKAGE)" = "gettext-tools"; then \
302	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
303	  for file in $(DISTFILES.common) Makevars.template; do \
304	    $(INSTALL_DATA) $(srcdir)/$$file \
305			    $(DESTDIR)$(gettextsrcdir)/$$file; \
306	  done; \
307	  for file in Makevars; do \
308	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
309	  done; \
310	else \
311	  : ; \
312	fi
313install-data-no: all
314install-data-yes: all
315	@catalogs='$(CATALOGS)'; \
316	for cat in $$catalogs; do \
317	  cat=`basename $$cat`; \
318	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
319	  dir=$(localedir)/$$lang/LC_MESSAGES; \
320	  $(mkdir_p) $(DESTDIR)$$dir; \
321	  if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
322	  $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
323	  echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
324	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
325	    if test -n "$$lc"; then \
326	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
327	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
328	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
329	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
330	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
331	         for file in *; do \
332	           if test -f $$file; then \
333	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
334	           fi; \
335	         done); \
336	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
337	      else \
338	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
339	          :; \
340	        else \
341	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
342	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
343	        fi; \
344	      fi; \
345	      rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
346	      ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
347	      ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
348	      cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
349	      echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
350	    fi; \
351	  done; \
352	done
353
354install-strip: install
355
356installdirs: installdirs-exec installdirs-data
357installdirs-exec:
358installdirs-data: installdirs-data-yes
359	if test "$(PACKAGE)" = "gettext-tools"; then \
360	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
361	else \
362	  : ; \
363	fi
364installdirs-data-no:
365installdirs-data-yes:
366	@catalogs='$(CATALOGS)'; \
367	for cat in $$catalogs; do \
368	  cat=`basename $$cat`; \
369	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
370	  dir=$(localedir)/$$lang/LC_MESSAGES; \
371	  $(mkdir_p) $(DESTDIR)$$dir; \
372	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
373	    if test -n "$$lc"; then \
374	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
375	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
376	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
377	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
378	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
379	         for file in *; do \
380	           if test -f $$file; then \
381	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
382	           fi; \
383	         done); \
384	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
385	      else \
386	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
387	          :; \
388	        else \
389	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
390	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
391	        fi; \
392	      fi; \
393	    fi; \
394	  done; \
395	done
396
397# Define this as empty until I found a useful application.
398installcheck:
399
400uninstall: uninstall-exec uninstall-data
401uninstall-exec:
402uninstall-data: uninstall-data-yes
403	if test "$(PACKAGE)" = "gettext-tools"; then \
404	  for file in $(DISTFILES.common) Makevars.template; do \
405	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
406	  done; \
407	else \
408	  : ; \
409	fi
410uninstall-data-no:
411uninstall-data-yes:
412	catalogs='$(CATALOGS)'; \
413	for cat in $$catalogs; do \
414	  cat=`basename $$cat`; \
415	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
416	  for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
417	    rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
418	  done; \
419	done
420
421check: all
422
423info dvi ps pdf html tags TAGS ctags CTAGS ID:
424
425mostlyclean:
426	rm -f remove-potcdate.sed
427	rm -f stamp-poT
428	rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
429	rm -fr *.o
430
431clean: mostlyclean
432
433distclean: clean
434	rm -f Makefile Makefile.in POTFILES *.mo
435
436maintainer-clean: distclean
437	@echo "This command is intended for maintainers to use;"
438	@echo "it deletes files that may require special tools to rebuild."
439	rm -f stamp-po $(GMOFILES)
440
441distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
442dist distdir:
443	$(MAKE) update-po
444	@$(MAKE) dist2
445# This is a separate target because 'update-po' must be executed before.
446dist2: stamp-po $(DISTFILES)
447	dists="$(DISTFILES)"; \
448	if test "$(PACKAGE)" = "gettext-tools"; then \
449	  dists="$$dists Makevars.template"; \
450	fi; \
451	if test -f $(srcdir)/$(DOMAIN).pot; then \
452	  dists="$$dists $(DOMAIN).pot stamp-po"; \
453	fi; \
454	if test -f $(srcdir)/ChangeLog; then \
455	  dists="$$dists ChangeLog"; \
456	fi; \
457	for i in 0 1 2 3 4 5 6 7 8 9; do \
458	  if test -f $(srcdir)/ChangeLog.$$i; then \
459	    dists="$$dists ChangeLog.$$i"; \
460	  fi; \
461	done; \
462	if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
463	for file in $$dists; do \
464	  if test -f $$file; then \
465	    cp -p $$file $(distdir) || exit 1; \
466	  else \
467	    cp -p $(srcdir)/$$file $(distdir) || exit 1; \
468	  fi; \
469	done
470
471update-po: Makefile
472	$(MAKE) $(DOMAIN).pot-update
473	test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
474	$(MAKE) update-gmo
475
476# General rule for creating PO files.
477
478.nop.po-create:
479	@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
480	echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
481	exit 1
482
483# General rule for updating PO files.
484
485.nop.po-update:
486	@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
487	if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
488	tmpdir=`pwd`; \
489	echo "$$lang:"; \
490	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
491	echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
492	cd $(srcdir); \
493	if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
494	       '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
495	         $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
496	       *) \
497	         $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
498	     esac; \
499	   }; then \
500	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
501	    rm -f $$tmpdir/$$lang.new.po; \
502	  else \
503	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
504	      :; \
505	    else \
506	      echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
507	      exit 1; \
508	    fi; \
509	  fi; \
510	else \
511	  echo "msgmerge for $$lang.po failed!" 1>&2; \
512	  rm -f $$tmpdir/$$lang.new.po; \
513	fi
514
515$(DUMMYPOFILES):
516
517update-gmo: Makefile $(GMOFILES)
518	@:
519
520# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
521# because execution permission bits may not work on the current file system.
522# Use /bin/sh, which is the shell determined by autoconf for the use by its
523# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
524Makefile: Makefile.in.in Makevars $(top_builddir)/config.status POTFILES.in LINGUAS
525	cd $(top_builddir) \
526	  && /bin/sh ./config.status $(subdir)/$@.in po-directories
527
528force:
529
530# Tell versions [3.59,3.63) of GNU make not to export all variables.
531# Otherwise a system limit (for SysV at least) may be exceeded.
532.NOEXPORT:
533# Special Makefile rules for English message catalogs with quotation marks.
534
535DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
536
537.SUFFIXES: .insert-header .po-update-en
538
539en@quot.po-create:
540	$(MAKE) en@quot.po-update
541en@boldquot.po-create:
542	$(MAKE) en@boldquot.po-update
543
544en@quot.po-update: en@quot.po-update-en
545en@boldquot.po-update: en@boldquot.po-update-en
546
547.insert-header.po-update-en:
548	@lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
549	if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
550	tmpdir=`pwd`; \
551	echo "$$lang:"; \
552	ll=`echo $$lang | sed -e 's/@.*//'`; \
553	LC_ALL=C; export LC_ALL; \
554	cd $(srcdir); \
555	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 \
556	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
557	    rm -f $$tmpdir/$$lang.new.po; \
558	  else \
559	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
560	      :; \
561	    else \
562	      echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
563	      exit 1; \
564	    fi; \
565	  fi; \
566	else \
567	  echo "creation of $$lang.po failed!" 1>&2; \
568	  rm -f $$tmpdir/$$lang.new.po; \
569	fi
570
571en@quot.insert-header: insert-header.sin
572	sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
573
574en@boldquot.insert-header: insert-header.sin
575	sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
576
577mostlyclean: mostlyclean-quot
578mostlyclean-quot:
579	rm -f *.insert-header
580