]>
Commit | Line | Data |
---|---|---|
a04eba3f | 1 | # Makefile for PO directory in any package using GNU gettext. |
e598c29b | 2 | # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu> |
5bc5a89c | 3 | # |
e598c29b TT |
4 | # Copying and distribution of this file, with or without modification, |
5 | # are permitted in any medium without royalty provided the copyright | |
6 | # notice and this notice are preserved. This file is offered as-is, | |
7 | # without any warranty. | |
b0cacab0 | 8 | # |
e598c29b TT |
9 | # Origin: gettext-0.19.8 |
10 | GETTEXT_MACRO_VERSION = 0.19 | |
5bc5a89c TT |
11 | |
12 | PACKAGE = @PACKAGE@ | |
13 | VERSION = @VERSION@ | |
e598c29b | 14 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ |
5bc5a89c | 15 | |
e598c29b | 16 | SED = @SED@ |
5bc5a89c TT |
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@ | |
b6b65c3d | 26 | datarootdir = @datarootdir@ |
a04eba3f | 27 | datadir = @datadir@ |
e598c29b | 28 | localedir = @localedir@ |
a04eba3f | 29 | gettextsrcdir = $(datadir)/gettext/po |
5bc5a89c TT |
30 | |
31 | INSTALL = @INSTALL@ | |
32 | INSTALL_DATA = @INSTALL_DATA@ | |
5bc5a89c | 33 | |
e598c29b TT |
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 | # When building gettext-tools, we prefer to use the built programs | |
47 | # rather than installed programs. However, we can't do that when we | |
48 | # are cross compiling. | |
49 | CROSS_COMPILING = @CROSS_COMPILING@ | |
50 | ||
51 | GMSGFMT_ = @GMSGFMT@ | |
52 | GMSGFMT_no = @GMSGFMT@ | |
53 | GMSGFMT_yes = @GMSGFMT_015@ | |
54 | GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) | |
55 | MSGFMT_ = @MSGFMT@ | |
56 | MSGFMT_no = @MSGFMT@ | |
57 | MSGFMT_yes = @MSGFMT_015@ | |
58 | MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) | |
59 | XGETTEXT_ = @XGETTEXT@ | |
60 | XGETTEXT_no = @XGETTEXT@ | |
61 | XGETTEXT_yes = @XGETTEXT_015@ | |
62 | XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) | |
a04eba3f TT |
63 | MSGMERGE = msgmerge |
64 | MSGMERGE_UPDATE = @MSGMERGE@ --update | |
65 | MSGINIT = msginit | |
66 | MSGCONV = msgconv | |
67 | MSGFILTER = msgfilter | |
5bc5a89c | 68 | |
5bc5a89c TT |
69 | POFILES = @POFILES@ |
70 | GMOFILES = @GMOFILES@ | |
a04eba3f TT |
71 | UPDATEPOFILES = @UPDATEPOFILES@ |
72 | DUMMYPOFILES = @DUMMYPOFILES@ | |
b0cacab0 | 73 | DISTFILES.common = Makefile.in.in remove-potcdate.sin \ |
a04eba3f | 74 | $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) |
e598c29b | 75 | DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ |
a04eba3f TT |
76 | $(POFILES) $(GMOFILES) \ |
77 | $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) | |
5bc5a89c TT |
78 | |
79 | POTFILES = \ | |
80 | ||
81 | CATALOGS = @CATALOGS@ | |
5bc5a89c | 82 | |
e598c29b TT |
83 | POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot |
84 | POFILESDEPS_yes = $(POFILESDEPS_) | |
85 | POFILESDEPS_no = | |
86 | POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) | |
87 | ||
88 | DISTFILESDEPS_ = update-po | |
89 | DISTFILESDEPS_yes = $(DISTFILESDEPS_) | |
90 | DISTFILESDEPS_no = | |
91 | DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) | |
92 | ||
a04eba3f | 93 | # Makevars gets inserted here. (Don't remove this line!) |
5bc5a89c | 94 | |
a04eba3f | 95 | .SUFFIXES: |
b0cacab0 | 96 | .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update |
5bc5a89c TT |
97 | |
98 | .po.mo: | |
ba526aae TT |
99 | $(E) "$(MSGFMT) -c -o $@ $<"; \ |
100 | $(Q) $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ | |
5bc5a89c TT |
101 | |
102 | .po.gmo: | |
a04eba3f TT |
103 | @lang=`echo $* | sed -e 's,.*/,,'`; \ |
104 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ | |
e598c29b TT |
105 | echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ |
106 | cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo | |
5bc5a89c | 107 | |
a04eba3f TT |
108 | .sin.sed: |
109 | sed -e '/^#/d' $< > t-$@ | |
110 | mv t-$@ $@ | |
5bc5a89c TT |
111 | |
112 | ||
113 | all: all-@USE_NLS@ | |
114 | ||
ba526aae | 115 | all-yes: @MAINTAINER_CMT@stamp-po |
5bc5a89c | 116 | all-no: |
ba526aae TT |
117 | all-static: |
118 | depend: | |
119 | coverage.txt: | |
e598c29b TT |
120 | |
121 | # Ensure that the gettext macros and this Makefile.in.in are in sync. | |
122 | CHECK_MACRO_VERSION = \ | |
123 | test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ | |
124 | || { 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; \ | |
125 | exit 1; \ | |
126 | } | |
127 | ||
128 | # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no | |
129 | # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because | |
130 | # we don't want to bother translators with empty POT files). We assume that | |
131 | # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. | |
132 | # In this case, stamp-po is a nop (i.e. a phony target). | |
5bc5a89c | 133 | |
b0cacab0 TT |
134 | # stamp-po is a timestamp denoting the last time at which the CATALOGS have |
135 | # been loosely updated. Its purpose is that when a developer or translator | |
136 | # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, | |
137 | # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent | |
138 | # invocations of "make" will do nothing. This timestamp would not be necessary | |
139 | # if updating the $(CATALOGS) would always touch them; however, the rule for | |
140 | # $(POFILES) has been designed to not touch files that don't need to be | |
141 | # changed. | |
142 | stamp-po: $(srcdir)/$(DOMAIN).pot | |
e598c29b TT |
143 | @$(CHECK_MACRO_VERSION) |
144 | test ! -f $(srcdir)/$(DOMAIN).pot || \ | |
145 | test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) | |
146 | @test ! -f $(srcdir)/$(DOMAIN).pot || { \ | |
147 | echo "touch stamp-po" && \ | |
148 | echo timestamp > stamp-poT && \ | |
149 | mv stamp-poT stamp-po; \ | |
150 | } | |
b0cacab0 | 151 | |
a04eba3f TT |
152 | # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', |
153 | # otherwise packages like GCC can not be built if only parts of the source | |
154 | # have been downloaded. | |
155 | ||
b0cacab0 TT |
156 | # This target rebuilds $(DOMAIN).pot; it is an expensive operation. |
157 | # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. | |
e598c29b TT |
158 | # The determination of whether the package xyz is a GNU one is based on the |
159 | # heuristic whether some file in the top level directory mentions "GNU xyz". | |
160 | # If GNU 'find' is available, we avoid grepping through monster files. | |
ba526aae TT |
161 | $(DOMAIN).pot-update: $(srcdir)/POTFILES.in remove-potcdate.sed \ |
162 | $(srcdir)/at-expand.pl | |
e598c29b TT |
163 | package_gnu="$(PACKAGE_GNU)"; \ |
164 | test -n "$$package_gnu" || { \ | |
165 | if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ | |
166 | LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \ | |
167 | -size -10000000c -exec grep 'GNU @PACKAGE@' \ | |
168 | /dev/null '{}' ';' 2>/dev/null; \ | |
169 | else \ | |
170 | LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ | |
171 | fi; \ | |
172 | } | grep -v 'libtool:' >/dev/null; then \ | |
173 | package_gnu=yes; \ | |
174 | else \ | |
175 | package_gnu=no; \ | |
176 | fi; \ | |
177 | }; \ | |
178 | if test "$$package_gnu" = "yes"; then \ | |
179 | package_prefix='GNU '; \ | |
180 | else \ | |
181 | package_prefix=''; \ | |
182 | fi; \ | |
183 | if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ | |
184 | msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ | |
185 | else \ | |
186 | msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ | |
187 | fi; \ | |
188 | case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ | |
189 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ | |
190 | $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ | |
ba526aae | 191 | --directory=$(top_builddir) \ |
e598c29b TT |
192 | --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ |
193 | --files-from=$(srcdir)/POTFILES.in \ | |
194 | --copyright-holder='$(COPYRIGHT_HOLDER)' \ | |
195 | --msgid-bugs-address="$$msgid_bugs_address" \ | |
196 | ;; \ | |
197 | *) \ | |
198 | $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ | |
ba526aae | 199 | --directory=$(top_builddir) \ |
e598c29b TT |
200 | --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ |
201 | --files-from=$(srcdir)/POTFILES.in \ | |
202 | --copyright-holder='$(COPYRIGHT_HOLDER)' \ | |
203 | --package-name="$${package_prefix}@PACKAGE@" \ | |
204 | --package-version='@VERSION@' \ | |
205 | --msgid-bugs-address="$$msgid_bugs_address" \ | |
206 | ;; \ | |
207 | esac | |
ba526aae TT |
208 | perl $(srcdir)/at-expand.pl < $(DOMAIN).po > $(DOMAIN).po.new |
209 | mv $(DOMAIN).po $(DOMAIN).po.bak | |
210 | mv $(DOMAIN).po.new $(DOMAIN).po | |
a04eba3f | 211 | test ! -f $(DOMAIN).po || { \ |
e598c29b TT |
212 | if test -f $(srcdir)/$(DOMAIN).pot-header; then \ |
213 | sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ | |
214 | cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po; \ | |
215 | rm -f $(DOMAIN).1po; \ | |
216 | fi; \ | |
a04eba3f TT |
217 | if test -f $(srcdir)/$(DOMAIN).pot; then \ |
218 | sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ | |
219 | sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ | |
220 | if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ | |
221 | rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ | |
222 | else \ | |
223 | rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ | |
224 | mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ | |
225 | fi; \ | |
226 | else \ | |
227 | mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ | |
228 | fi; \ | |
229 | } | |
230 | ||
b0cacab0 TT |
231 | # This rule has no dependencies: we don't need to update $(DOMAIN).pot at |
232 | # every "make" invocation, only create it when it is missing. | |
233 | # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. | |
a04eba3f TT |
234 | $(srcdir)/$(DOMAIN).pot: |
235 | $(MAKE) $(DOMAIN).pot-update | |
236 | ||
b0cacab0 TT |
237 | # This target rebuilds a PO file if $(DOMAIN).pot has changed. |
238 | # Note that a PO file is not touched if it doesn't need to be changed. | |
e598c29b | 239 | $(POFILES): $(POFILESDEPS) |
a04eba3f | 240 | @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ |
b0cacab0 | 241 | if test -f "$(srcdir)/$${lang}.po"; then \ |
e598c29b | 242 | test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \ |
b0cacab0 | 243 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ |
e598c29b TT |
244 | echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ |
245 | cd $(srcdir) \ | |
246 | && { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ | |
247 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ | |
248 | $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ | |
249 | *) \ | |
250 | $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ | |
251 | esac; \ | |
252 | }; \ | |
b0cacab0 TT |
253 | else \ |
254 | $(MAKE) $${lang}.po-create; \ | |
255 | fi | |
5bc5a89c TT |
256 | |
257 | ||
258 | install: install-exec install-data | |
259 | install-exec: | |
260 | install-data: install-data-@USE_NLS@ | |
b0cacab0 | 261 | if test "$(PACKAGE)" = "gettext-tools"; then \ |
e598c29b | 262 | $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ |
b0cacab0 | 263 | for file in $(DISTFILES.common) Makevars.template; do \ |
a04eba3f TT |
264 | $(INSTALL_DATA) $(srcdir)/$$file \ |
265 | $(DESTDIR)$(gettextsrcdir)/$$file; \ | |
266 | done; \ | |
b0cacab0 TT |
267 | for file in Makevars; do \ |
268 | rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ | |
269 | done; \ | |
5bc5a89c | 270 | else \ |
a04eba3f | 271 | : ; \ |
5bc5a89c | 272 | fi |
a04eba3f TT |
273 | install-data-no: all |
274 | install-data-yes: all | |
5bc5a89c TT |
275 | @catalogs='$(CATALOGS)'; \ |
276 | for cat in $$catalogs; do \ | |
277 | cat=`basename $$cat`; \ | |
a04eba3f TT |
278 | lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ |
279 | dir=$(localedir)/$$lang/LC_MESSAGES; \ | |
e598c29b | 280 | $(mkdir_p) $(DESTDIR)$$dir; \ |
a04eba3f TT |
281 | if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ |
282 | $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ | |
283 | echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ | |
284 | for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ | |
285 | if test -n "$$lc"; then \ | |
286 | if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ | |
287 | link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ | |
288 | mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ | |
289 | mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ | |
290 | (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ | |
291 | for file in *; do \ | |
292 | if test -f $$file; then \ | |
293 | ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ | |
294 | fi; \ | |
295 | done); \ | |
296 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ | |
297 | else \ | |
298 | if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ | |
299 | :; \ | |
300 | else \ | |
301 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ | |
302 | mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ | |
303 | fi; \ | |
304 | fi; \ | |
305 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ | |
306 | ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ | |
307 | ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ | |
308 | cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ | |
309 | echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ | |
5bc5a89c | 310 | fi; \ |
a04eba3f | 311 | done; \ |
5bc5a89c | 312 | done |
a04eba3f TT |
313 | |
314 | install-strip: install | |
315 | ||
316 | installdirs: installdirs-exec installdirs-data | |
317 | installdirs-exec: | |
318 | installdirs-data: installdirs-data-@USE_NLS@ | |
b0cacab0 | 319 | if test "$(PACKAGE)" = "gettext-tools"; then \ |
e598c29b | 320 | $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ |
5bc5a89c TT |
321 | else \ |
322 | : ; \ | |
323 | fi | |
a04eba3f TT |
324 | installdirs-data-no: |
325 | installdirs-data-yes: | |
a04eba3f TT |
326 | @catalogs='$(CATALOGS)'; \ |
327 | for cat in $$catalogs; do \ | |
328 | cat=`basename $$cat`; \ | |
329 | lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ | |
330 | dir=$(localedir)/$$lang/LC_MESSAGES; \ | |
e598c29b | 331 | $(mkdir_p) $(DESTDIR)$$dir; \ |
a04eba3f TT |
332 | for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ |
333 | if test -n "$$lc"; then \ | |
334 | if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ | |
335 | link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ | |
336 | mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ | |
337 | mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ | |
338 | (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ | |
339 | for file in *; do \ | |
340 | if test -f $$file; then \ | |
341 | ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ | |
342 | fi; \ | |
343 | done); \ | |
344 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ | |
345 | else \ | |
346 | if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ | |
347 | :; \ | |
348 | else \ | |
349 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ | |
350 | mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ | |
351 | fi; \ | |
352 | fi; \ | |
353 | fi; \ | |
354 | done; \ | |
355 | done | |
5bc5a89c TT |
356 | |
357 | # Define this as empty until I found a useful application. | |
358 | installcheck: | |
359 | ||
a04eba3f TT |
360 | uninstall: uninstall-exec uninstall-data |
361 | uninstall-exec: | |
362 | uninstall-data: uninstall-data-@USE_NLS@ | |
b0cacab0 TT |
363 | if test "$(PACKAGE)" = "gettext-tools"; then \ |
364 | for file in $(DISTFILES.common) Makevars.template; do \ | |
a04eba3f TT |
365 | rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ |
366 | done; \ | |
367 | else \ | |
368 | : ; \ | |
369 | fi | |
370 | uninstall-data-no: | |
371 | uninstall-data-yes: | |
5bc5a89c TT |
372 | catalogs='$(CATALOGS)'; \ |
373 | for cat in $$catalogs; do \ | |
374 | cat=`basename $$cat`; \ | |
a04eba3f TT |
375 | lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ |
376 | for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ | |
377 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ | |
378 | done; \ | |
5bc5a89c | 379 | done |
5bc5a89c | 380 | |
ba526aae | 381 | fullcheck check: all |
5bc5a89c | 382 | |
b0cacab0 | 383 | info dvi ps pdf html tags TAGS ctags CTAGS ID: |
5bc5a89c TT |
384 | |
385 | mostlyclean: | |
e598c29b | 386 | rm -f remove-potcdate.sed |
b0cacab0 | 387 | rm -f stamp-poT |
a04eba3f | 388 | rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po |
ba526aae | 389 | rm -f $(DOMAIN).po.bak |
5bc5a89c TT |
390 | rm -fr *.o |
391 | ||
e598c29b | 392 | clean: mostlyclean |
5bc5a89c TT |
393 | |
394 | distclean: clean | |
a04eba3f | 395 | rm -f Makefile Makefile.in POTFILES *.mo |
5bc5a89c TT |
396 | |
397 | maintainer-clean: distclean | |
398 | @echo "This command is intended for maintainers to use;" | |
399 | @echo "it deletes files that may require special tools to rebuild." | |
b0cacab0 | 400 | rm -f stamp-po $(GMOFILES) |
5bc5a89c | 401 | |
a04eba3f TT |
402 | distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) |
403 | dist distdir: | |
e598c29b | 404 | test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) |
a04eba3f TT |
405 | @$(MAKE) dist2 |
406 | # This is a separate target because 'update-po' must be executed before. | |
e598c29b | 407 | dist2: stamp-po $(DISTFILES) |
5bc5a89c | 408 | dists="$(DISTFILES)"; \ |
b0cacab0 TT |
409 | if test "$(PACKAGE)" = "gettext-tools"; then \ |
410 | dists="$$dists Makevars.template"; \ | |
411 | fi; \ | |
e598c29b TT |
412 | if test -f $(srcdir)/$(DOMAIN).pot; then \ |
413 | dists="$$dists $(DOMAIN).pot stamp-po"; \ | |
414 | fi; \ | |
b0cacab0 TT |
415 | if test -f $(srcdir)/ChangeLog; then \ |
416 | dists="$$dists ChangeLog"; \ | |
417 | fi; \ | |
418 | for i in 0 1 2 3 4 5 6 7 8 9; do \ | |
419 | if test -f $(srcdir)/ChangeLog.$$i; then \ | |
420 | dists="$$dists ChangeLog.$$i"; \ | |
421 | fi; \ | |
422 | done; \ | |
a04eba3f | 423 | if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ |
5bc5a89c | 424 | for file in $$dists; do \ |
a04eba3f | 425 | if test -f $$file; then \ |
e598c29b | 426 | cp -p $$file $(distdir) || exit 1; \ |
a04eba3f | 427 | else \ |
e598c29b | 428 | cp -p $(srcdir)/$$file $(distdir) || exit 1; \ |
a04eba3f | 429 | fi; \ |
5bc5a89c TT |
430 | done |
431 | ||
432 | update-po: Makefile | |
a04eba3f | 433 | $(MAKE) $(DOMAIN).pot-update |
b0cacab0 | 434 | test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) |
a04eba3f TT |
435 | $(MAKE) update-gmo |
436 | ||
b0cacab0 TT |
437 | # General rule for creating PO files. |
438 | ||
439 | .nop.po-create: | |
440 | @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ | |
441 | echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ | |
442 | exit 1 | |
443 | ||
a04eba3f TT |
444 | # General rule for updating PO files. |
445 | ||
446 | .nop.po-update: | |
447 | @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ | |
e598c29b | 448 | if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ |
a04eba3f TT |
449 | tmpdir=`pwd`; \ |
450 | echo "$$lang:"; \ | |
451 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ | |
e598c29b | 452 | echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ |
5bc5a89c | 453 | cd $(srcdir); \ |
e598c29b TT |
454 | if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ |
455 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ | |
456 | $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ | |
457 | *) \ | |
458 | $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ | |
459 | esac; \ | |
460 | }; then \ | |
a04eba3f TT |
461 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ |
462 | rm -f $$tmpdir/$$lang.new.po; \ | |
5bc5a89c | 463 | else \ |
a04eba3f TT |
464 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ |
465 | :; \ | |
466 | else \ | |
467 | echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ | |
468 | exit 1; \ | |
469 | fi; \ | |
5bc5a89c | 470 | fi; \ |
a04eba3f TT |
471 | else \ |
472 | echo "msgmerge for $$lang.po failed!" 1>&2; \ | |
473 | rm -f $$tmpdir/$$lang.new.po; \ | |
474 | fi | |
5bc5a89c | 475 | |
a04eba3f TT |
476 | $(DUMMYPOFILES): |
477 | ||
478 | update-gmo: Makefile $(GMOFILES) | |
479 | @: | |
480 | ||
e598c29b TT |
481 | # Recreate Makefile by invoking config.status. Explicitly invoke the shell, |
482 | # because execution permission bits may not work on the current file system. | |
483 | # Use @SHELL@, which is the shell determined by autoconf for the use by its | |
484 | # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. | |
485 | Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ | |
a04eba3f | 486 | cd $(top_builddir) \ |
ba526aae | 487 | && CONFIG_FILES=$(subdir)/$@.in @SHELL@ ./config.status po-directories |
5bc5a89c | 488 | |
a04eba3f TT |
489 | force: |
490 | ||
5bc5a89c TT |
491 | # Tell versions [3.59,3.63) of GNU make not to export all variables. |
492 | # Otherwise a system limit (for SysV at least) may be exceeded. | |
493 | .NOEXPORT: |