1# -*- buffer-read-only: t -*- vi: set ro:
2# DO NOT EDIT! GENERATED AUTOMATICALLY!
3# Makefile for PO directory in any package using GNU gettext.
4# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
5#
6# This file can be copied and used freely without restrictions.  It can
7# be used in projects which are not available under the GNU General Public
8# License but which still want to provide support for the GNU gettext
9# functionality.
10# Please note that the actual code of GNU gettext is covered by the GNU
11# General Public License and is *not* in the public domain.
12#
13# Origin: gettext-0.16
14
15PACKAGE = @PACKAGE@
16VERSION = @VERSION@
17PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
18
19SHELL = /bin/sh
20@SET_MAKE@
21
22srcdir = @srcdir@
23top_srcdir = @top_srcdir@
24VPATH = @srcdir@
25
26prefix = @prefix@
27exec_prefix = @exec_prefix@
28datarootdir = @datarootdir@
29datadir = @datadir@
30localedir = @localedir@
31gettextsrcdir = $(datadir)/gettext/po
32
33INSTALL = @INSTALL@
34INSTALL_DATA = @INSTALL_DATA@
35
36# We use $(mkdir_p).
37# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
38# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
39# @install_sh@ does not start with $(SHELL), so we add it.
40# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
41# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
42# versions, $(mkinstalldirs) and $(install_sh) are unused.
43mkinstalldirs = $(SHELL) @install_sh@ -d
44install_sh = $(SHELL) @install_sh@
45MKDIR_P = @MKDIR_P@
46mkdir_p = @mkdir_p@
47
48GMSGFMT_ = @GMSGFMT@
49GMSGFMT_no = @GMSGFMT@
50GMSGFMT_yes = @GMSGFMT_015@
51GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
52MSGFMT_ = @MSGFMT@
53MSGFMT_no = @MSGFMT@
54MSGFMT_yes = @MSGFMT_015@
55MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
56XGETTEXT_ = @XGETTEXT@
57XGETTEXT_no = @XGETTEXT@
58XGETTEXT_yes = @XGETTEXT_015@
59XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
60MSGMERGE = msgmerge
61MSGMERGE_UPDATE = @MSGMERGE@ --update
62MSGINIT = msginit
63MSGCONV = msgconv
64MSGFILTER = msgfilter
65
66POFILES = @POFILES@
67GMOFILES = @GMOFILES@
68UPDATEPOFILES = @UPDATEPOFILES@
69DUMMYPOFILES = @DUMMYPOFILES@
70DISTFILES.common = Makefile.in.in remove-potcdate.sin \
71$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
72DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
73$(POFILES) $(GMOFILES) \
74$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
75
76POTFILES = \
77
78CATALOGS = @CATALOGS@
79
80# Makevars gets inserted here. (Don't remove this line!)
81
82.SUFFIXES:
83.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
84
85.po.mo:
86	@echo "$(MSGFMT) -c -o $@ $<"; \
87	$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
88
89.po.gmo:
90	@lang=`echo $* | sed -e 's,.*/,,'`; \
91	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
92	echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
93	cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
94
95.sin.sed:
96	sed -e '/^#/d' $< > t-$@
97	mv t-$@ $@
98
99
100all: all-@USE_NLS@
101
102all-yes: stamp-po
103all-no:
104
105# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
106# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
107# we don't want to bother translators with empty POT files). We assume that
108# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
109# In this case, stamp-po is a nop (i.e. a phony target).
110
111# stamp-po is a timestamp denoting the last time at which the CATALOGS have
112# been loosely updated. Its purpose is that when a developer or translator
113# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
114# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
115# invocations of "make" will do nothing. This timestamp would not be necessary
116# if updating the $(CATALOGS) would always touch them; however, the rule for
117# $(POFILES) has been designed to not touch files that don't need to be
118# changed.
119stamp-po: $(srcdir)/$(DOMAIN).pot
120	test ! -f $(srcdir)/$(DOMAIN).pot || \
121	  test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
122	@test ! -f $(srcdir)/$(DOMAIN).pot || { \
123	  echo "touch stamp-po" && \
124	  echo timestamp > stamp-poT && \
125	  mv stamp-poT stamp-po; \
126	}
127
128# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
129# otherwise packages like GCC can not be built if only parts of the source
130# have been downloaded.
131
132# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
133# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
134$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
135	if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
136	  msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
137	else \
138	  msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
139	fi; \
140	$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
141	  --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
142	  --files-from=$(srcdir)/POTFILES.in \
143	  --copyright-holder='$(COPYRIGHT_HOLDER)' \
144	  --msgid-bugs-address="$$msgid_bugs_address"
145	test ! -f $(DOMAIN).po || { \
146	  if test -f $(srcdir)/$(DOMAIN).pot; then \
147	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
148	    sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
149	    if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
150	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
151	    else \
152	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
153	      mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
154	    fi; \
155	  else \
156	    mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
157	  fi; \
158	}
159
160# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
161# every "make" invocation, only create it when it is missing.
162# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
163$(srcdir)/$(DOMAIN).pot:
164	$(MAKE) $(DOMAIN).pot-update
165
166# This target rebuilds a PO file if $(DOMAIN).pot has changed.
167# Note that a PO file is not touched if it doesn't need to be changed.
168$(POFILES): $(srcdir)/$(DOMAIN).pot
169	@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
170	if test -f "$(srcdir)/$${lang}.po"; then \
171	  test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
172	  echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
173	  cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
174	else \
175	  $(MAKE) $${lang}.po-create; \
176	fi
177
178
179install: install-exec install-data
180install-exec:
181install-data: install-data-@USE_NLS@
182	if test "$(PACKAGE)" = "gettext-tools"; then \
183	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
184	  for file in $(DISTFILES.common) Makevars.template; do \
185	    $(INSTALL_DATA) $(srcdir)/$$file \
186			    $(DESTDIR)$(gettextsrcdir)/$$file; \
187	  done; \
188	  for file in Makevars; do \
189	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
190	  done; \
191	else \
192	  : ; \
193	fi
194install-data-no: all
195install-data-yes: all
196	$(mkdir_p) $(DESTDIR)$(datadir)
197	@catalogs='$(CATALOGS)'; \
198	for cat in $$catalogs; do \
199	  cat=`basename $$cat`; \
200	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
201	  dir=$(localedir)/$$lang/LC_MESSAGES; \
202	  $(mkdir_p) $(DESTDIR)$$dir; \
203	  if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
204	  $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
205	  echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
206	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
207	    if test -n "$$lc"; then \
208	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
209	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
210	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
211	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
212	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
213	         for file in *; do \
214	           if test -f $$file; then \
215	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
216	           fi; \
217	         done); \
218	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
219	      else \
220	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
221	          :; \
222	        else \
223	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
224	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
225	        fi; \
226	      fi; \
227	      rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
228	      ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
229	      ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
230	      cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
231	      echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
232	    fi; \
233	  done; \
234	done
235
236install-strip: install
237
238installdirs: installdirs-exec installdirs-data
239installdirs-exec:
240installdirs-data: installdirs-data-@USE_NLS@
241	if test "$(PACKAGE)" = "gettext-tools"; then \
242	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
243	else \
244	  : ; \
245	fi
246installdirs-data-no:
247installdirs-data-yes:
248	$(mkdir_p) $(DESTDIR)$(datadir)
249	@catalogs='$(CATALOGS)'; \
250	for cat in $$catalogs; do \
251	  cat=`basename $$cat`; \
252	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
253	  dir=$(localedir)/$$lang/LC_MESSAGES; \
254	  $(mkdir_p) $(DESTDIR)$$dir; \
255	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
256	    if test -n "$$lc"; then \
257	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
258	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
259	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
260	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
261	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
262	         for file in *; do \
263	           if test -f $$file; then \
264	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
265	           fi; \
266	         done); \
267	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
268	      else \
269	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
270	          :; \
271	        else \
272	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
273	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
274	        fi; \
275	      fi; \
276	    fi; \
277	  done; \
278	done
279
280# Define this as empty until I found a useful application.
281installcheck:
282
283uninstall: uninstall-exec uninstall-data
284uninstall-exec:
285uninstall-data: uninstall-data-@USE_NLS@
286	if test "$(PACKAGE)" = "gettext-tools"; then \
287	  for file in $(DISTFILES.common) Makevars.template; do \
288	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
289	  done; \
290	else \
291	  : ; \
292	fi
293uninstall-data-no:
294uninstall-data-yes:
295	catalogs='$(CATALOGS)'; \
296	for cat in $$catalogs; do \
297	  cat=`basename $$cat`; \
298	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
299	  for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
300	    rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
301	  done; \
302	done
303
304check: all
305
306info dvi ps pdf html tags TAGS ctags CTAGS ID:
307
308mostlyclean:
309	rm -f remove-potcdate.sed
310	rm -f stamp-poT
311	rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
312	rm -fr *.o
313
314clean: mostlyclean
315
316distclean: clean
317	rm -f Makefile Makefile.in POTFILES *.mo
318
319maintainer-clean: distclean
320	@echo "This command is intended for maintainers to use;"
321	@echo "it deletes files that may require special tools to rebuild."
322	rm -f stamp-po $(GMOFILES)
323
324distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
325dist distdir:
326	$(MAKE) update-po
327	@$(MAKE) dist2
328# This is a separate target because 'update-po' must be executed before.
329dist2: stamp-po $(DISTFILES)
330	dists="$(DISTFILES)"; \
331	if test "$(PACKAGE)" = "gettext-tools"; then \
332	  dists="$$dists Makevars.template"; \
333	fi; \
334	if test -f $(srcdir)/$(DOMAIN).pot; then \
335	  dists="$$dists $(DOMAIN).pot stamp-po"; \
336	fi; \
337	if test -f $(srcdir)/ChangeLog; then \
338	  dists="$$dists ChangeLog"; \
339	fi; \
340	for i in 0 1 2 3 4 5 6 7 8 9; do \
341	  if test -f $(srcdir)/ChangeLog.$$i; then \
342	    dists="$$dists ChangeLog.$$i"; \
343	  fi; \
344	done; \
345	if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
346	for file in $$dists; do \
347	  if test -f $$file; then \
348	    cp -p $$file $(distdir) || exit 1; \
349	  else \
350	    cp -p $(srcdir)/$$file $(distdir) || exit 1; \
351	  fi; \
352	done
353
354update-po: Makefile
355	$(MAKE) $(DOMAIN).pot-update
356	test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
357	$(MAKE) update-gmo
358
359# General rule for creating PO files.
360
361.nop.po-create:
362	@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
363	echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
364	exit 1
365
366# General rule for updating PO files.
367
368.nop.po-update:
369	@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
370	if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
371	tmpdir=`pwd`; \
372	echo "$$lang:"; \
373	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
374	echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
375	cd $(srcdir); \
376	if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
377	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
378	    rm -f $$tmpdir/$$lang.new.po; \
379	  else \
380	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
381	      :; \
382	    else \
383	      echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
384	      exit 1; \
385	    fi; \
386	  fi; \
387	else \
388	  echo "msgmerge for $$lang.po failed!" 1>&2; \
389	  rm -f $$tmpdir/$$lang.new.po; \
390	fi
391
392$(DUMMYPOFILES):
393
394update-gmo: Makefile $(GMOFILES)
395	@:
396
397Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
398	cd $(top_builddir) \
399	  && $(SHELL) ./config.status $(subdir)/$@.in po-directories
400
401force:
402
403# Tell versions [3.59,3.63) of GNU make not to export all variables.
404# Otherwise a system limit (for SysV at least) may be exceeded.
405.NOEXPORT:
406