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