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