Debian Codegraph @

po/Makefile.in.in

raw
1 # Makefile for PO directory in any package using GNU gettext.
2 # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <[email protected]>
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
12 GETTEXT_MACRO_VERSION = 0.18
13
14 PACKAGE = @PACKAGE@
15 VERSION = @VERSION@
16 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
17
18 SHELL = /bin/sh
19 @SET_MAKE@
20
21 srcdir = @srcdir@
22 top_srcdir = @top_srcdir@
23 VPATH = @srcdir@
24
25 prefix = @prefix@
26 exec_prefix = @exec_prefix@
27 datarootdir = @datarootdir@
28 datadir = @datadir@
29 localedir = @localedir@
30 gettextsrcdir = $(datadir)/gettext/po
31
32 INSTALL = @INSTALL@
33 INSTALL_DATA = @INSTALL_DATA@
34
35 # Define $(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 # @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.
42 # Gnulib provides a backport of autoconf 2.60's AC_PROG_MKDIR_P,
43 # with a fix from autoconf 2.62 for interoperability with automake 1.9.6,
44 # so use $(MKDIR_P) in the rest of this makefile.
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 --verbose -o $${lang}.gmo $${lang}.po"; \
95 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -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: 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 @$(CHECK_MACRO_VERSION)
130 test ! -f $(srcdir)/$(DOMAIN).pot || \
131 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
132 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
133 echo "touch stamp-po" && \
134 echo timestamp > stamp-poT && \
135 mv stamp-poT stamp-po; \
136 }
137
138 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
139 # otherwise packages like GCC can not be built if only parts of the source
140 # have been downloaded.
141
142 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
143 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
144 $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
145 if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
146 package_gnu='GNU '; \
147 else \
148 package_gnu=''; \
149 fi; \
150 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
151 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
152 else \
153 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
154 fi; \
155 case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
156 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
157 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
158 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
159 --files-from=$(srcdir)/POTFILES.in \
160 --copyright-holder='$(COPYRIGHT_HOLDER)' \
161 --msgid-bugs-address="$$msgid_bugs_address" \
162 ;; \
163 *) \
164 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
165 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
166 --files-from=$(srcdir)/POTFILES.in \
167 --copyright-holder='$(COPYRIGHT_HOLDER)' \
168 --package-name="$${package_gnu}@PACKAGE@" \
169 --package-version='@VERSION@' \
170 --msgid-bugs-address="$$msgid_bugs_address" \
171 ;; \
172 esac
173 test ! -f $(DOMAIN).po || { \
174 if test -f $(srcdir)/$(DOMAIN).pot; then \
175 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
176 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
177 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
178 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
179 else \
180 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
181 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
182 fi; \
183 else \
184 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
185 fi; \
186 }
187
188 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
189 # every "make" invocation, only create it when it is missing.
190 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
191 $(srcdir)/$(DOMAIN).pot:
192 $(MAKE) $(DOMAIN).pot-update
193
194 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
195 # Note that a PO file is not touched if it doesn't need to be changed.
196 $(POFILES): $(srcdir)/$(DOMAIN).pot
197 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
198 if test -f "$(srcdir)/$${lang}.po"; then \
199 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
200 echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
201 cd $(srcdir) \
202 && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
203 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
204 $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
205 *) \
206 $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
207 esac; \
208 }; \
209 else \
210 $(MAKE) $${lang}.po-create; \
211 fi
212
213
214 install: install-exec install-data
215 install-exec:
216 install-data: install-data-@USE_NLS@
217 if test "$(PACKAGE)" = "gettext-tools"; then \
218 $(MKDIR_P) $(DESTDIR)$(gettextsrcdir); \
219 for file in $(DISTFILES.common) Makevars.template; do \
220 $(INSTALL_DATA) $(srcdir)/$$file \
221 $(DESTDIR)$(gettextsrcdir)/$$file; \
222 done; \
223 for file in Makevars; do \
224 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
225 done; \
226 else \
227 : ; \
228 fi
229 install-data-no: all
230 install-data-yes: all
231 @catalogs='$(CATALOGS)'; \
232 for cat in $$catalogs; do \
233 cat=`basename $$cat`; \
234 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
235 dir=$(localedir)/$$lang/LC_MESSAGES; \
236 $(MKDIR_P) $(DESTDIR)$$dir; \
237 if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
238 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
239 echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
240 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
241 if test -n "$$lc"; then \
242 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
243 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
244 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
245 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
246 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
247 for file in *; do \
248 if test -f $$file; then \
249 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
250 fi; \
251 done); \
252 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
253 else \
254 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
255 :; \
256 else \
257 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
258 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
259 fi; \
260 fi; \
261 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
262 ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
263 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
264 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
265 echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
266 fi; \
267 done; \
268 done
269
270 install-strip: install
271
272 install-dvi install-html install-info install-pdf install-ps:
273 installdirs: installdirs-exec installdirs-data
274 installdirs-exec:
275 installdirs-data: installdirs-data-@USE_NLS@
276 if test "$(PACKAGE)" = "gettext-tools"; then \
277 $(MKDIR_P) $(DESTDIR)$(gettextsrcdir); \
278 else \
279 : ; \
280 fi
281 installdirs-data-no:
282 installdirs-data-yes:
283 @catalogs='$(CATALOGS)'; \
284 for cat in $$catalogs; do \
285 cat=`basename $$cat`; \
286 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
287 dir=$(localedir)/$$lang/LC_MESSAGES; \
288 $(MKDIR_P) $(DESTDIR)$$dir; \
289 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
290 if test -n "$$lc"; then \
291 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
292 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
293 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
294 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
295 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
296 for file in *; do \
297 if test -f $$file; then \
298 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
299 fi; \
300 done); \
301 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
302 else \
303 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
304 :; \
305 else \
306 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
307 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
308 fi; \
309 fi; \
310 fi; \
311 done; \
312 done
313
314 # Define this as empty until I found a useful application.
315 installcheck:
316
317 uninstall: uninstall-exec uninstall-data
318 uninstall-exec:
319 uninstall-data: uninstall-data-@USE_NLS@
320 if test "$(PACKAGE)" = "gettext-tools"; then \
321 for file in $(DISTFILES.common) Makevars.template; do \
322 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
323 done; \
324 else \
325 : ; \
326 fi
327 uninstall-data-no:
328 uninstall-data-yes:
329 catalogs='$(CATALOGS)'; \
330 for cat in $$catalogs; do \
331 cat=`basename $$cat`; \
332 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
333 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
334 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
335 done; \
336 done
337
338 check: all
339
340 info dvi ps pdf html tags TAGS ctags CTAGS ID:
341
342 mostlyclean:
343 rm -f remove-potcdate.sed
344 rm -f stamp-poT
345 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
346 rm -fr *.o
347
348 clean: mostlyclean
349
350 distclean: clean
351 rm -f Makefile Makefile.in POTFILES *.mo
352
353 maintainer-clean: distclean
354 @echo "This command is intended for maintainers to use;"
355 @echo "it deletes files that may require special tools to rebuild."
356 rm -f stamp-po $(GMOFILES)
357
358 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
359 dist distdir:
360 $(MAKE) update-po
361 @$(MAKE) dist2
362 # This is a separate target because 'update-po' must be executed before.
363 dist2: stamp-po $(DISTFILES)
364 dists="$(DISTFILES)"; \
365 if test "$(PACKAGE)" = "gettext-tools"; then \
366 dists="$$dists Makevars.template"; \
367 fi; \
368 if test -f $(srcdir)/$(DOMAIN).pot; then \
369 dists="$$dists $(DOMAIN).pot stamp-po"; \
370 fi; \
371 if test -f $(srcdir)/ChangeLog; then \
372 dists="$$dists ChangeLog"; \
373 fi; \
374 for i in 0 1 2 3 4 5 6 7 8 9; do \
375 if test -f $(srcdir)/ChangeLog.$$i; then \
376 dists="$$dists ChangeLog.$$i"; \
377 fi; \
378 done; \
379 if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
380 for file in $$dists; do \
381 if test -f $$file; then \
382 cp -p $$file $(distdir) || exit 1; \
383 else \
384 cp -p $(srcdir)/$$file $(distdir) || exit 1; \
385 fi; \
386 done
387
388 update-po: Makefile
389 $(MAKE) $(DOMAIN).pot-update
390 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
391 $(MAKE) update-gmo
392
393 # General rule for creating PO files.
394
395 .nop.po-create:
396 @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
397 echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
398 exit 1
399
400 # General rule for updating PO files.
401
402 .nop.po-update:
403 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
404 if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
405 tmpdir=`pwd`; \
406 echo "$$lang:"; \
407 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
408 echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
409 cd $(srcdir); \
410 if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
411 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
412 $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
413 *) \
414 $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
415 esac; \
416 }; then \
417 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
418 rm -f $$tmpdir/$$lang.new.po; \
419 else \
420 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
421 :; \
422 else \
423 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
424 exit 1; \
425 fi; \
426 fi; \
427 else \
428 echo "msgmerge for $$lang.po failed!" 1>&2; \
429 rm -f $$tmpdir/$$lang.new.po; \
430 fi
431
432 $(DUMMYPOFILES):
433
434 update-gmo: Makefile $(GMOFILES)
435 @:
436
437 # Recreate Makefile by invoking config.status. Explicitly invoke the shell,
438 # because execution permission bits may not work on the current file system.
439 # Use @SHELL@, which is the shell determined by autoconf for the use by its
440 # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
441 Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
442 cd $(top_builddir) \
443 && @SHELL@ ./config.status $(subdir)/[email protected] po-directories
444
445 force:
446
447 # Tell versions [3.59,3.63) of GNU make not to export all variables.
448 # Otherwise a system limit (for SysV at least) may be exceeded.
449 .NOEXPORT: