22
28
exec_prefix = @exec_prefix@
29
datarootdir = @datarootdir@
23
30
datadir = @datadir@
24
localedir = $(datadir)/locale
31
localedir = @localedir@
25
32
gettextsrcdir = $(datadir)/gettext/po
27
34
INSTALL = @INSTALL@
28
35
INSTALL_DATA = @INSTALL_DATA@
29
MKINSTALLDIRS = @MKINSTALLDIRS@
30
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
38
# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
39
# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
40
# @install_sh@ does not start with $(SHELL), so we add it.
41
# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
42
# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
43
# versions, $(mkinstalldirs) and $(install_sh) are unused.
44
mkinstalldirs = $(SHELL) @install_sh@ -d
45
install_sh = $(SHELL) @install_sh@
50
GMSGFMT_no = @GMSGFMT@
51
GMSGFMT_yes = @GMSGFMT_015@
52
GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
55
MSGFMT_yes = @MSGFMT_015@
56
MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
57
XGETTEXT_ = @XGETTEXT@
58
XGETTEXT_no = @XGETTEXT@
59
XGETTEXT_yes = @XGETTEXT_015@
60
XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
35
61
MSGMERGE = msgmerge
36
62
MSGMERGE_UPDATE = @MSGMERGE@ --update
101
all: check-macro-version all-@USE_NLS@
106
# Ensure that the gettext macros and this Makefile.in.in are in sync.
108
@test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
109
|| { 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; \
113
# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
114
# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
115
# we don't want to bother translators with empty POT files). We assume that
116
# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
117
# In this case, stamp-po is a nop (i.e. a phony target).
119
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
120
# been loosely updated. Its purpose is that when a developer or translator
121
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
122
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
123
# invocations of "make" will do nothing. This timestamp would not be necessary
124
# if updating the $(CATALOGS) would always touch them; however, the rule for
125
# $(POFILES) has been designed to not touch files that don't need to be
127
stamp-po: $(srcdir)/$(DOMAIN).pot
128
test ! -f $(srcdir)/$(DOMAIN).pot || \
129
test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
130
@test ! -f $(srcdir)/$(DOMAIN).pot || { \
131
echo "touch stamp-po" && \
132
echo timestamp > stamp-poT && \
133
mv stamp-poT stamp-po; \
80
136
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
81
137
# otherwise packages like GCC can not be built if only parts of the source
82
138
# have been downloaded.
140
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
141
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
84
142
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
85
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
86
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
87
--files-from=$(srcdir)/POTFILES.in \
88
--copyright-holder='$(COPYRIGHT_HOLDER)'
143
if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
144
package_gnu='GNU '; \
148
if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
149
msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
151
msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
153
case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
154
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
155
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
156
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
157
--files-from=$(srcdir)/POTFILES.in \
158
--copyright-holder='$(COPYRIGHT_HOLDER)' \
159
--msgid-bugs-address="$$msgid_bugs_address" \
162
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
163
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
164
--files-from=$(srcdir)/POTFILES.in \
165
--copyright-holder='$(COPYRIGHT_HOLDER)' \
166
--package-name="$${package_gnu}@PACKAGE@" \
167
--package-version='@VERSION@' \
168
--msgid-bugs-address="$$msgid_bugs_address" \
89
171
test ! -f $(DOMAIN).po || { \
90
172
if test -f $(srcdir)/$(DOMAIN).pot; then \
91
173
sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
186
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
187
# every "make" invocation, only create it when it is missing.
188
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
104
189
$(srcdir)/$(DOMAIN).pot:
105
190
$(MAKE) $(DOMAIN).pot-update
192
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
193
# Note that a PO file is not touched if it doesn't need to be changed.
107
194
$(POFILES): $(srcdir)/$(DOMAIN).pot
108
195
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
109
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
110
echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
111
cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
196
if test -f "$(srcdir)/$${lang}.po"; then \
197
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
198
echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
199
cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
201
$(MAKE) $${lang}.po-create; \
114
205
install: install-exec install-data
116
207
install-data: install-data-@USE_NLS@
117
if test "$(PACKAGE)" = "gettext"; then \
118
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
119
for file in $(DISTFILES.common); do \
208
if test "$(PACKAGE)" = "gettext-tools"; then \
209
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
210
for file in $(DISTFILES.common) Makevars.template; do \
120
211
$(INSTALL_DATA) $(srcdir)/$$file \
121
212
$(DESTDIR)$(gettextsrcdir)/$$file; \
214
for file in Makevars; do \
215
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
126
220
install-data-no: all
127
221
install-data-yes: all
128
$(mkinstalldirs) $(DESTDIR)$(datadir)
222
$(mkdir_p) $(DESTDIR)$(datadir)
129
223
@catalogs='$(CATALOGS)'; \
130
224
for cat in $$catalogs; do \
131
225
cat=`basename $$cat`; \
132
226
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
133
227
dir=$(localedir)/$$lang/LC_MESSAGES; \
134
$(mkinstalldirs) $(DESTDIR)$$dir; \
228
$(mkdir_p) $(DESTDIR)$$dir; \
135
229
if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
136
230
$(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
137
231
echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
170
264
installdirs: installdirs-exec installdirs-data
171
265
installdirs-exec:
172
266
installdirs-data: installdirs-data-@USE_NLS@
173
if test "$(PACKAGE)" = "gettext"; then \
174
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
267
if test "$(PACKAGE)" = "gettext-tools"; then \
268
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
178
272
installdirs-data-no:
179
273
installdirs-data-yes:
180
$(mkinstalldirs) $(DESTDIR)$(datadir)
274
$(mkdir_p) $(DESTDIR)$(datadir)
181
275
@catalogs='$(CATALOGS)'; \
182
276
for cat in $$catalogs; do \
183
277
cat=`basename $$cat`; \
184
278
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
185
279
dir=$(localedir)/$$lang/LC_MESSAGES; \
186
$(mkinstalldirs) $(DESTDIR)$$dir; \
280
$(mkdir_p) $(DESTDIR)$$dir; \
187
281
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
188
282
if test -n "$$lc"; then \
189
283
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
250
345
maintainer-clean: distclean
251
346
@echo "This command is intended for maintainers to use;"
252
347
@echo "it deletes files that may require special tools to rebuild."
348
rm -f stamp-po $(GMOFILES)
255
350
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
257
352
$(MAKE) update-po
259
354
# This is a separate target because 'update-po' must be executed before.
355
dist2: stamp-po $(DISTFILES)
261
356
dists="$(DISTFILES)"; \
262
if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \
357
if test "$(PACKAGE)" = "gettext-tools"; then \
358
dists="$$dists Makevars.template"; \
360
if test -f $(srcdir)/$(DOMAIN).pot; then \
361
dists="$$dists $(DOMAIN).pot stamp-po"; \
363
if test -f $(srcdir)/ChangeLog; then \
364
dists="$$dists ChangeLog"; \
366
for i in 0 1 2 3 4 5 6 7 8 9; do \
367
if test -f $(srcdir)/ChangeLog.$$i; then \
368
dists="$$dists ChangeLog.$$i"; \
263
371
if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
264
372
for file in $$dists; do \
265
373
if test -f $$file; then \
266
cp -p $$file $(distdir); \
374
cp -p $$file $(distdir) || exit 1; \
268
cp -p $(srcdir)/$$file $(distdir); \
376
cp -p $(srcdir)/$$file $(distdir) || exit 1; \
272
380
update-po: Makefile
273
381
$(MAKE) $(DOMAIN).pot-update
274
$(MAKE) $(UPDATEPOFILES)
382
test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
275
383
$(MAKE) update-gmo
385
# General rule for creating PO files.
388
@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
389
echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
277
392
# General rule for updating PO files.
280
395
@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
281
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
396
if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
283
398
echo "$$lang:"; \
284
399
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \