diff options
Diffstat (limited to 'po/Makefile.in.in')
-rw-r--r-- | po/Makefile.in.in | 221 |
1 files changed, 164 insertions, 57 deletions
diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 5022b8b..6b25f0d 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in | |||
@@ -1,19 +1,20 @@ | |||
1 | # Makefile for PO directory in any package using GNU gettext. | 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> | 2 | # Copyright (C) 1995-2000 Ulrich Drepper <drepper@gnu.ai.mit.edu> |
3 | # Copyright (C) 2000-2020 Free Software Foundation, Inc. | ||
3 | # | 4 | # |
4 | # This file can be copied and used freely without restrictions. It can | 5 | # Copying and distribution of this file, with or without modification, |
5 | # be used in projects which are not available under the GNU General Public | 6 | # are permitted in any medium without royalty provided the copyright |
6 | # License but which still want to provide support for the GNU gettext | 7 | # notice and this notice are preserved. This file is offered as-is, |
7 | # functionality. | 8 | # without any warranty. |
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 | # | 9 | # |
11 | # Origin: gettext-0.16 | 10 | # Origin: gettext-0.21 |
11 | GETTEXT_MACRO_VERSION = 0.20 | ||
12 | 12 | ||
13 | PACKAGE = @PACKAGE@ | 13 | PACKAGE = @PACKAGE@ |
14 | VERSION = @VERSION@ | 14 | VERSION = @VERSION@ |
15 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | 15 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ |
16 | 16 | ||
17 | SED = @SED@ | ||
17 | SHELL = /bin/sh | 18 | SHELL = /bin/sh |
18 | @SET_MAKE@ | 19 | @SET_MAKE@ |
19 | 20 | ||
@@ -43,20 +44,22 @@ install_sh = $(SHELL) @install_sh@ | |||
43 | MKDIR_P = @MKDIR_P@ | 44 | MKDIR_P = @MKDIR_P@ |
44 | mkdir_p = @mkdir_p@ | 45 | mkdir_p = @mkdir_p@ |
45 | 46 | ||
47 | # When building gettext-tools, we prefer to use the built programs | ||
48 | # rather than installed programs. However, we can't do that when we | ||
49 | # are cross compiling. | ||
50 | CROSS_COMPILING = @CROSS_COMPILING@ | ||
51 | |||
46 | GMSGFMT_ = @GMSGFMT@ | 52 | GMSGFMT_ = @GMSGFMT@ |
47 | GMSGFMT_no = @GMSGFMT@ | 53 | GMSGFMT_no = @GMSGFMT@ |
48 | GMSGFMT_yes = @GMSGFMT_015@ | 54 | GMSGFMT_yes = @GMSGFMT_015@ |
49 | GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) | 55 | GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) |
50 | MSGFMT_ = @MSGFMT@ | ||
51 | MSGFMT_no = @MSGFMT@ | ||
52 | MSGFMT_yes = @MSGFMT_015@ | ||
53 | MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) | ||
54 | XGETTEXT_ = @XGETTEXT@ | 56 | XGETTEXT_ = @XGETTEXT@ |
55 | XGETTEXT_no = @XGETTEXT@ | 57 | XGETTEXT_no = @XGETTEXT@ |
56 | XGETTEXT_yes = @XGETTEXT_015@ | 58 | XGETTEXT_yes = @XGETTEXT_015@ |
57 | XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) | 59 | XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) |
58 | MSGMERGE = msgmerge | 60 | MSGMERGE = @MSGMERGE@ |
59 | MSGMERGE_UPDATE = @MSGMERGE@ --update | 61 | MSGMERGE_UPDATE = @MSGMERGE@ --update |
62 | MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ | ||
60 | MSGINIT = msginit | 63 | MSGINIT = msginit |
61 | MSGCONV = msgconv | 64 | MSGCONV = msgconv |
62 | MSGFILTER = msgfilter | 65 | MSGFILTER = msgfilter |
@@ -75,52 +78,87 @@ POTFILES = \ | |||
75 | 78 | ||
76 | CATALOGS = @CATALOGS@ | 79 | CATALOGS = @CATALOGS@ |
77 | 80 | ||
81 | POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot | ||
82 | POFILESDEPS_yes = $(POFILESDEPS_) | ||
83 | POFILESDEPS_no = | ||
84 | POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) | ||
85 | |||
86 | DISTFILESDEPS_ = update-po | ||
87 | DISTFILESDEPS_yes = $(DISTFILESDEPS_) | ||
88 | DISTFILESDEPS_no = | ||
89 | DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) | ||
90 | |||
78 | # Makevars gets inserted here. (Don't remove this line!) | 91 | # Makevars gets inserted here. (Don't remove this line!) |
79 | 92 | ||
80 | .SUFFIXES: | 93 | all: all-@USE_NLS@ |
81 | .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update | ||
82 | 94 | ||
83 | .po.mo: | ||
84 | @echo "$(MSGFMT) -c -o $@ $<"; \ | ||
85 | $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ | ||
86 | 95 | ||
96 | .SUFFIXES: | ||
97 | .SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update | ||
98 | |||
99 | # The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs. | ||
100 | # The GNU Coding Standards say in | ||
101 | # <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>: | ||
102 | # "GNU distributions usually contain some files which are not source files | ||
103 | # ... . Since these files normally appear in the source directory, they | ||
104 | # should always appear in the source directory, not in the build directory. | ||
105 | # So Makefile rules to update them should put the updated files in the | ||
106 | # source directory." | ||
107 | # Therefore we put these files in the source directory, not the build directory. | ||
108 | |||
109 | # During .po -> .gmo conversion, take into account the most recent changes to | ||
110 | # the .pot file. This eliminates the need to update the .po files when the | ||
111 | # .pot file has changed, which would be troublesome if the .po files are put | ||
112 | # under version control. | ||
113 | $(GMOFILES): $(srcdir)/$(DOMAIN).pot | ||
87 | .po.gmo: | 114 | .po.gmo: |
88 | @lang=`echo $* | sed -e 's,.*/,,'`; \ | 115 | @lang=`echo $* | sed -e 's,.*/,,'`; \ |
89 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ | 116 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ |
90 | echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ | 117 | echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \ |
91 | cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo | 118 | cd $(srcdir) && \ |
119 | rm -f $${lang}.gmo && \ | ||
120 | $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \ | ||
121 | $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \ | ||
122 | mv t-$${lang}.gmo $${lang}.gmo && \ | ||
123 | rm -f $${lang}.1po | ||
92 | 124 | ||
93 | .sin.sed: | 125 | .sin.sed: |
94 | sed -e '/^#/d' $< > t-$@ | 126 | sed -e '/^#/d' $< > t-$@ |
95 | mv t-$@ $@ | 127 | mv t-$@ $@ |
96 | 128 | ||
97 | 129 | ||
98 | all: all-@USE_NLS@ | 130 | all-yes: $(srcdir)/stamp-po |
99 | |||
100 | all-yes: stamp-po | ||
101 | all-no: | 131 | all-no: |
102 | 132 | ||
133 | # Ensure that the gettext macros and this Makefile.in.in are in sync. | ||
134 | CHECK_MACRO_VERSION = \ | ||
135 | test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ | ||
136 | || { 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; \ | ||
137 | exit 1; \ | ||
138 | } | ||
139 | |||
103 | # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no | 140 | # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no |
104 | # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because | 141 | # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because |
105 | # we don't want to bother translators with empty POT files). We assume that | 142 | # 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. | 143 | # 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). | 144 | # In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). |
108 | 145 | ||
109 | # stamp-po is a timestamp denoting the last time at which the CATALOGS have | 146 | # $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS |
110 | # been loosely updated. Its purpose is that when a developer or translator | 147 | # have 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, | 148 | # checks out the package from a version control system, and the $(DOMAIN).pot |
112 | # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent | 149 | # file is not under version control, "make" will update the $(DOMAIN).pot and |
113 | # invocations of "make" will do nothing. This timestamp would not be necessary | 150 | # the $(CATALOGS), but subsequent invocations of "make" will do nothing. This |
114 | # if updating the $(CATALOGS) would always touch them; however, the rule for | 151 | # timestamp would not be necessary if updating the $(CATALOGS) would always |
115 | # $(POFILES) has been designed to not touch files that don't need to be | 152 | # touch them; however, the rule for $(POFILES) has been designed to not touch |
116 | # changed. | 153 | # files that don't need to be changed. |
117 | stamp-po: $(srcdir)/$(DOMAIN).pot | 154 | $(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot |
155 | @$(CHECK_MACRO_VERSION) | ||
118 | test ! -f $(srcdir)/$(DOMAIN).pot || \ | 156 | test ! -f $(srcdir)/$(DOMAIN).pot || \ |
119 | test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) | 157 | test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) |
120 | @test ! -f $(srcdir)/$(DOMAIN).pot || { \ | 158 | @test ! -f $(srcdir)/$(DOMAIN).pot || { \ |
121 | echo "touch stamp-po" && \ | 159 | echo "touch $(srcdir)/stamp-po" && \ |
122 | echo timestamp > stamp-poT && \ | 160 | echo timestamp > $(srcdir)/stamp-poT && \ |
123 | mv stamp-poT stamp-po; \ | 161 | mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ |
124 | } | 162 | } |
125 | 163 | ||
126 | # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', | 164 | # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', |
@@ -129,18 +167,60 @@ stamp-po: $(srcdir)/$(DOMAIN).pot | |||
129 | 167 | ||
130 | # This target rebuilds $(DOMAIN).pot; it is an expensive operation. | 168 | # 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. | 169 | # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. |
170 | # The determination of whether the package xyz is a GNU one is based on the | ||
171 | # heuristic whether some file in the top level directory mentions "GNU xyz". | ||
172 | # If GNU 'find' is available, we avoid grepping through monster files. | ||
132 | $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed | 173 | $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed |
174 | package_gnu="$(PACKAGE_GNU)"; \ | ||
175 | test -n "$$package_gnu" || { \ | ||
176 | if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ | ||
177 | LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ | ||
178 | else \ | ||
179 | LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ | ||
180 | fi; \ | ||
181 | } | grep -v 'libtool:' >/dev/null; then \ | ||
182 | package_gnu=yes; \ | ||
183 | else \ | ||
184 | package_gnu=no; \ | ||
185 | fi; \ | ||
186 | }; \ | ||
187 | if test "$$package_gnu" = "yes"; then \ | ||
188 | package_prefix='GNU '; \ | ||
189 | else \ | ||
190 | package_prefix=''; \ | ||
191 | fi; \ | ||
133 | if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ | 192 | if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ |
134 | msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ | 193 | msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ |
135 | else \ | 194 | else \ |
136 | msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ | 195 | msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ |
137 | fi; \ | 196 | fi; \ |
138 | $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ | 197 | case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ |
139 | --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ | 198 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ |
140 | --files-from=$(srcdir)/POTFILES.in \ | 199 | $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ |
141 | --copyright-holder='$(COPYRIGHT_HOLDER)' \ | 200 | --add-comments=TRANSLATORS: \ |
142 | --msgid-bugs-address="$$msgid_bugs_address" | 201 | --files-from=$(srcdir)/POTFILES.in \ |
202 | --copyright-holder='$(COPYRIGHT_HOLDER)' \ | ||
203 | --msgid-bugs-address="$$msgid_bugs_address" \ | ||
204 | $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ | ||
205 | ;; \ | ||
206 | *) \ | ||
207 | $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ | ||
208 | --add-comments=TRANSLATORS: \ | ||
209 | --files-from=$(srcdir)/POTFILES.in \ | ||
210 | --copyright-holder='$(COPYRIGHT_HOLDER)' \ | ||
211 | --package-name="$${package_prefix}@PACKAGE@" \ | ||
212 | --package-version='@VERSION@' \ | ||
213 | --msgid-bugs-address="$$msgid_bugs_address" \ | ||
214 | $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ | ||
215 | ;; \ | ||
216 | esac | ||
143 | test ! -f $(DOMAIN).po || { \ | 217 | test ! -f $(DOMAIN).po || { \ |
218 | if test -f $(srcdir)/$(DOMAIN).pot-header; then \ | ||
219 | sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ | ||
220 | cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ | ||
221 | rm -f $(DOMAIN).1po \ | ||
222 | || exit 1; \ | ||
223 | fi; \ | ||
144 | if test -f $(srcdir)/$(DOMAIN).pot; then \ | 224 | if test -f $(srcdir)/$(DOMAIN).pot; then \ |
145 | sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ | 225 | sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ |
146 | sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ | 226 | sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ |
@@ -163,12 +243,22 @@ $(srcdir)/$(DOMAIN).pot: | |||
163 | 243 | ||
164 | # This target rebuilds a PO file if $(DOMAIN).pot has changed. | 244 | # This target rebuilds a PO file if $(DOMAIN).pot has changed. |
165 | # Note that a PO file is not touched if it doesn't need to be changed. | 245 | # Note that a PO file is not touched if it doesn't need to be changed. |
166 | $(POFILES): $(srcdir)/$(DOMAIN).pot | 246 | $(POFILES): $(POFILESDEPS) |
247 | @test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot | ||
167 | @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ | 248 | @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ |
168 | if test -f "$(srcdir)/$${lang}.po"; then \ | 249 | if test -f "$(srcdir)/$${lang}.po"; then \ |
169 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ | 250 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ |
170 | echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ | 251 | echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ |
171 | cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ | 252 | cd $(srcdir) \ |
253 | && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ | ||
254 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ | ||
255 | $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ | ||
256 | 0.1[6-7] | 0.1[6-7].*) \ | ||
257 | $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ | ||
258 | *) \ | ||
259 | $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ | ||
260 | esac; \ | ||
261 | }; \ | ||
172 | else \ | 262 | else \ |
173 | $(MAKE) $${lang}.po-create; \ | 263 | $(MAKE) $${lang}.po-create; \ |
174 | fi | 264 | fi |
@@ -191,7 +281,6 @@ install-data: install-data-@USE_NLS@ | |||
191 | fi | 281 | fi |
192 | install-data-no: all | 282 | install-data-no: all |
193 | install-data-yes: all | 283 | install-data-yes: all |
194 | $(mkdir_p) $(DESTDIR)$(datadir) | ||
195 | @catalogs='$(CATALOGS)'; \ | 284 | @catalogs='$(CATALOGS)'; \ |
196 | for cat in $$catalogs; do \ | 285 | for cat in $$catalogs; do \ |
197 | cat=`basename $$cat`; \ | 286 | cat=`basename $$cat`; \ |
@@ -243,7 +332,6 @@ installdirs-data: installdirs-data-@USE_NLS@ | |||
243 | fi | 332 | fi |
244 | installdirs-data-no: | 333 | installdirs-data-no: |
245 | installdirs-data-yes: | 334 | installdirs-data-yes: |
246 | $(mkdir_p) $(DESTDIR)$(datadir) | ||
247 | @catalogs='$(CATALOGS)'; \ | 335 | @catalogs='$(CATALOGS)'; \ |
248 | for cat in $$catalogs; do \ | 336 | for cat in $$catalogs; do \ |
249 | cat=`basename $$cat`; \ | 337 | cat=`basename $$cat`; \ |
@@ -303,34 +391,41 @@ check: all | |||
303 | 391 | ||
304 | info dvi ps pdf html tags TAGS ctags CTAGS ID: | 392 | info dvi ps pdf html tags TAGS ctags CTAGS ID: |
305 | 393 | ||
394 | install-dvi install-ps install-pdf install-html: | ||
395 | |||
306 | mostlyclean: | 396 | mostlyclean: |
307 | rm -f remove-potcdate.sed | 397 | rm -f remove-potcdate.sed |
308 | rm -f stamp-poT | 398 | rm -f $(srcdir)/stamp-poT |
309 | rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po | 399 | rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po |
310 | rm -fr *.o | 400 | rm -fr *.o |
311 | 401 | ||
312 | clean: mostlyclean | 402 | clean: mostlyclean |
313 | 403 | ||
314 | distclean: clean | 404 | distclean: clean |
315 | rm -f Makefile Makefile.in POTFILES *.mo | 405 | rm -f Makefile Makefile.in POTFILES |
316 | 406 | ||
317 | maintainer-clean: distclean | 407 | maintainer-clean: distclean |
318 | @echo "This command is intended for maintainers to use;" | 408 | @echo "This command is intended for maintainers to use;" |
319 | @echo "it deletes files that may require special tools to rebuild." | 409 | @echo "it deletes files that may require special tools to rebuild." |
320 | rm -f stamp-po $(GMOFILES) | 410 | rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES) |
321 | 411 | ||
322 | distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) | 412 | distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) |
323 | dist distdir: | 413 | dist distdir: |
324 | $(MAKE) update-po | 414 | test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) |
325 | @$(MAKE) dist2 | 415 | @$(MAKE) dist2 |
326 | # This is a separate target because 'update-po' must be executed before. | 416 | # This is a separate target because 'update-po' must be executed before. |
327 | dist2: stamp-po $(DISTFILES) | 417 | dist2: $(srcdir)/stamp-po $(DISTFILES) |
328 | dists="$(DISTFILES)"; \ | 418 | @dists="$(DISTFILES)"; \ |
329 | if test "$(PACKAGE)" = "gettext-tools"; then \ | 419 | if test "$(PACKAGE)" = "gettext-tools"; then \ |
330 | dists="$$dists Makevars.template"; \ | 420 | dists="$$dists Makevars.template"; \ |
331 | fi; \ | 421 | fi; \ |
332 | if test -f $(srcdir)/$(DOMAIN).pot; then \ | 422 | if test -f $(srcdir)/$(DOMAIN).pot; then \ |
333 | dists="$$dists $(DOMAIN).pot stamp-po"; \ | 423 | dists="$$dists $(DOMAIN).pot stamp-po"; \ |
424 | else \ | ||
425 | case $(XGETTEXT) in \ | ||
426 | :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ | ||
427 | *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the contents of the POTFILES.in file and the XGETTEXT_OPTIONS in the Makevars file." 1>&2;; \ | ||
428 | esac; \ | ||
334 | fi; \ | 429 | fi; \ |
335 | if test -f $(srcdir)/ChangeLog; then \ | 430 | if test -f $(srcdir)/ChangeLog; then \ |
336 | dists="$$dists ChangeLog"; \ | 431 | dists="$$dists ChangeLog"; \ |
@@ -365,13 +460,21 @@ update-po: Makefile | |||
365 | 460 | ||
366 | .nop.po-update: | 461 | .nop.po-update: |
367 | @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ | 462 | @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ |
368 | if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ | 463 | if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ |
369 | tmpdir=`pwd`; \ | 464 | tmpdir=`pwd`; \ |
370 | echo "$$lang:"; \ | 465 | echo "$$lang:"; \ |
371 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ | 466 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ |
372 | echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ | 467 | echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ |
373 | cd $(srcdir); \ | 468 | cd $(srcdir); \ |
374 | if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ | 469 | if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ |
470 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ | ||
471 | $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ | ||
472 | 0.1[6-7] | 0.1[6-7].*) \ | ||
473 | $(MSGMERGE) $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ | ||
474 | *) \ | ||
475 | $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ | ||
476 | esac; \ | ||
477 | }; then \ | ||
375 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ | 478 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ |
376 | rm -f $$tmpdir/$$lang.new.po; \ | 479 | rm -f $$tmpdir/$$lang.new.po; \ |
377 | else \ | 480 | else \ |
@@ -392,9 +495,13 @@ $(DUMMYPOFILES): | |||
392 | update-gmo: Makefile $(GMOFILES) | 495 | update-gmo: Makefile $(GMOFILES) |
393 | @: | 496 | @: |
394 | 497 | ||
498 | # Recreate Makefile by invoking config.status. Explicitly invoke the shell, | ||
499 | # because execution permission bits may not work on the current file system. | ||
500 | # Use @SHELL@, which is the shell determined by autoconf for the use by its | ||
501 | # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. | ||
395 | Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ | 502 | Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ |
396 | cd $(top_builddir) \ | 503 | cd $(top_builddir) \ |
397 | && $(SHELL) ./config.status $(subdir)/$@.in po-directories | 504 | && @SHELL@ ./config.status $(subdir)/$@.in po-directories |
398 | 505 | ||
399 | force: | 506 | force: |
400 | 507 | ||