OLD | NEW |
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-1997, 2000-2007 by Ulrich Drepper <drepper@gnu.ai.mit.edu> |
3 # | 3 # |
4 # This file can be copied and used freely without restrictions. It can | 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 | 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 | 6 # License but which still want to provide support for the GNU gettext |
7 # functionality. | 7 # functionality. |
8 # Please note that the actual code of GNU gettext is covered by the GNU | 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. | 9 # General Public License and is *not* in the public domain. |
10 # | 10 # |
11 # Origin: gettext-0.16 | 11 # Origin: gettext-0.17 |
| 12 GETTEXT_MACRO_VERSION = 0.17 |
12 | 13 |
13 PACKAGE = @PACKAGE@ | 14 PACKAGE = @PACKAGE@ |
14 VERSION = @VERSION@ | 15 VERSION = @VERSION@ |
15 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | 16 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ |
16 | 17 |
17 SHELL = /bin/sh | 18 SHELL = /bin/sh |
18 @SET_MAKE@ | 19 @SET_MAKE@ |
19 | 20 |
20 srcdir = @srcdir@ | 21 srcdir = @srcdir@ |
21 top_srcdir = @top_srcdir@ | 22 top_srcdir = @top_srcdir@ |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 @lang=`echo $* | sed -e 's,.*/,,'`; \ | 89 @lang=`echo $* | sed -e 's,.*/,,'`; \ |
89 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ | 90 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ |
90 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${la
ng}.gmo $${lang}.po"; \ | 91 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${la
ng}.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 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$$
{lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo |
92 | 93 |
93 .sin.sed: | 94 .sin.sed: |
94 sed -e '/^#/d' $< > t-$@ | 95 sed -e '/^#/d' $< > t-$@ |
95 mv t-$@ $@ | 96 mv t-$@ $@ |
96 | 97 |
97 | 98 |
98 all: all-@USE_NLS@ | 99 all: check-macro-version all-@USE_NLS@ |
99 | 100 |
100 all-yes: stamp-po | 101 all-yes: stamp-po |
101 all-no: | 102 all-no: |
102 | 103 |
| 104 # Ensure that the gettext macros and this Makefile.in.in are in sync. |
| 105 check-macro-version: |
| 106 @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ |
| 107 || { echo "*** error: gettext infrastructure mismatch: using a Makefil
e.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros ar
e from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ |
| 108 exit 1; \ |
| 109 } |
| 110 |
103 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no | 111 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no |
104 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because | 112 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because |
105 # we don't want to bother translators with empty POT files). We assume that | 113 # 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. | 114 # 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). | 115 # In this case, stamp-po is a nop (i.e. a phony target). |
108 | 116 |
109 # stamp-po is a timestamp denoting the last time at which the CATALOGS have | 117 # 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 | 118 # 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, | 119 # 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 | 120 # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent |
(...skipping 10 matching lines...) Expand all Loading... |
123 mv stamp-poT stamp-po; \ | 131 mv stamp-poT stamp-po; \ |
124 } | 132 } |
125 | 133 |
126 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', | 134 # 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 | 135 # otherwise packages like GCC can not be built if only parts of the source |
128 # have been downloaded. | 136 # have been downloaded. |
129 | 137 |
130 # This target rebuilds $(DOMAIN).pot; it is an expensive operation. | 138 # 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. | 139 # 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 | 140 $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed |
| 141 if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v '
libtool:' >/dev/null; then \ |
| 142 package_gnu='GNU '; \ |
| 143 else \ |
| 144 package_gnu=''; \ |
| 145 fi; \ |
133 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'P
ACKAGE_BUGREPORT'@'; then \ | 146 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'P
ACKAGE_BUGREPORT'@'; then \ |
134 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ | 147 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ |
135 else \ | 148 else \ |
136 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ | 149 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ |
137 fi; \ | 150 fi; \ |
138 » $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ | 151 » case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ |
139 » --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ | 152 » '' | 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 \ | 153 » $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ |
141 » --copyright-holder='$(COPYRIGHT_HOLDER)' \ | 154 » --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OP
TIONS@ \ |
142 » --msgid-bugs-address="$$msgid_bugs_address" | 155 » --files-from=$(srcdir)/POTFILES.in \ |
| 156 » --copyright-holder='$(COPYRIGHT_HOLDER)' \ |
| 157 » --msgid-bugs-address="$$msgid_bugs_address" \ |
| 158 » ;; \ |
| 159 » *) \ |
| 160 » $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ |
| 161 » --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OP
TIONS@ \ |
| 162 » --files-from=$(srcdir)/POTFILES.in \ |
| 163 » --copyright-holder='$(COPYRIGHT_HOLDER)' \ |
| 164 » --package-name="$${package_gnu}@PACKAGE@" \ |
| 165 » --package-version='@VERSION@' \ |
| 166 » --msgid-bugs-address="$$msgid_bugs_address" \ |
| 167 » ;; \ |
| 168 » esac |
143 test ! -f $(DOMAIN).po || { \ | 169 test ! -f $(DOMAIN).po || { \ |
144 if test -f $(srcdir)/$(DOMAIN).pot; then \ | 170 if test -f $(srcdir)/$(DOMAIN).pot; then \ |
145 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po
&& \ | 171 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po
&& \ |
146 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ | 172 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ |
147 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ | 173 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ |
148 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ | 174 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ |
149 else \ | 175 else \ |
150 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ | 176 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ |
151 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ | 177 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ |
152 fi; \ | 178 fi; \ |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 420 |
395 Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ | 421 Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ |
396 cd $(top_builddir) \ | 422 cd $(top_builddir) \ |
397 && $(SHELL) ./config.status $(subdir)/$@.in po-directories | 423 && $(SHELL) ./config.status $(subdir)/$@.in po-directories |
398 | 424 |
399 force: | 425 force: |
400 | 426 |
401 # Tell versions [3.59,3.63) of GNU make not to export all variables. | 427 # Tell versions [3.59,3.63) of GNU make not to export all variables. |
402 # Otherwise a system limit (for SysV at least) may be exceeded. | 428 # Otherwise a system limit (for SysV at least) may be exceeded. |
403 .NOEXPORT: | 429 .NOEXPORT: |
OLD | NEW |