1
1
# Makefile for PO directory in any package using GNU gettext.
2
# Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
2
# Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
4
4
# This file can be copied and used freely without restrictions. It can
5
5
# be used in projects which are not available under the GNU General Public
24
26
exec_prefix = @exec_prefix@
27
datarootdir = @datarootdir@
25
28
datadir = @datadir@
26
localedir = $(datadir)/locale
29
localedir = @localedir@
27
30
gettextsrcdir = $(datadir)/gettext/po
29
32
INSTALL = @INSTALL@
30
33
INSTALL_DATA = @INSTALL_DATA@
31
MKINSTALLDIRS = @MKINSTALLDIRS@
32
mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
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
mkinstalldirs = $(SHELL) @install_sh@ -d
43
install_sh = $(SHELL) @install_sh@
48
GMSGFMT_no = @GMSGFMT@
49
GMSGFMT_yes = @GMSGFMT_015@
50
GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
53
MSGFMT_yes = @MSGFMT_015@
54
MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
55
XGETTEXT_ = @XGETTEXT@
56
XGETTEXT_no = @XGETTEXT@
57
XGETTEXT_yes = @XGETTEXT_015@
58
XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
37
59
MSGMERGE = msgmerge
38
60
MSGMERGE_UPDATE = @MSGMERGE@ --update
46
68
DUMMYPOFILES = @DUMMYPOFILES@
47
69
DISTFILES.common = Makefile.in.in remove-potcdate.sin \
48
70
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
49
DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
71
DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
50
72
$(POFILES) $(GMOFILES) \
51
73
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
99
all: check-macro-version all-@USE_NLS@
104
# Ensure that the gettext macros and this Makefile.in.in are in sync.
106
@test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
107
|| { 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
# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
112
# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
113
# we don't want to bother translators with empty POT files). We assume that
114
# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
115
# In this case, stamp-po is a nop (i.e. a phony target).
82
117
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
83
118
# been loosely updated. Its purpose is that when a developer or translator
84
119
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
88
123
# $(POFILES) has been designed to not touch files that don't need to be
90
125
stamp-po: $(srcdir)/$(DOMAIN).pot
91
test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
92
@echo "touch stamp-po"
93
@echo timestamp > stamp-poT
94
@mv stamp-poT stamp-po
126
test ! -f $(srcdir)/$(DOMAIN).pot || \
127
test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
128
@test ! -f $(srcdir)/$(DOMAIN).pot || { \
129
echo "touch stamp-po" && \
130
echo timestamp > stamp-poT && \
131
mv stamp-poT stamp-po; \
96
134
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
97
135
# otherwise packages like GCC can not be built if only parts of the source
100
138
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
101
139
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
102
140
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
103
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
104
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
105
--files-from=$(srcdir)/POTFILES.in \
106
--copyright-holder='$(COPYRIGHT_HOLDER)' \
107
--msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
141
if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
142
package_gnu='GNU '; \
146
if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
147
msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
149
msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
151
case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
152
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
153
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
154
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
155
--files-from=$(srcdir)/POTFILES.in \
156
--copyright-holder='$(COPYRIGHT_HOLDER)' \
157
--msgid-bugs-address="$$msgid_bugs_address" \
160
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
161
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
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" \
108
169
test ! -f $(DOMAIN).po || { \
109
170
if test -f $(srcdir)/$(DOMAIN).pot; then \
110
171
sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
144
205
install-data: install-data-@USE_NLS@
145
206
if test "$(PACKAGE)" = "gettext-tools"; then \
146
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
207
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
147
208
for file in $(DISTFILES.common) Makevars.template; do \
148
209
$(INSTALL_DATA) $(srcdir)/$$file \
149
210
$(DESTDIR)$(gettextsrcdir)/$$file; \
157
218
install-data-no: all
158
219
install-data-yes: all
159
$(mkinstalldirs) $(DESTDIR)$(datadir)
220
$(mkdir_p) $(DESTDIR)$(datadir)
160
221
@catalogs='$(CATALOGS)'; \
161
222
for cat in $$catalogs; do \
162
223
cat=`basename $$cat`; \
163
224
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
164
225
dir=$(localedir)/$$lang/LC_MESSAGES; \
165
$(mkinstalldirs) $(DESTDIR)$$dir; \
226
$(mkdir_p) $(DESTDIR)$$dir; \
166
227
if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
167
228
$(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
168
229
echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
202
263
installdirs-exec:
203
264
installdirs-data: installdirs-data-@USE_NLS@
204
265
if test "$(PACKAGE)" = "gettext-tools"; then \
205
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
266
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
209
270
installdirs-data-no:
210
271
installdirs-data-yes:
211
$(mkinstalldirs) $(DESTDIR)$(datadir)
272
$(mkdir_p) $(DESTDIR)$(datadir)
212
273
@catalogs='$(CATALOGS)'; \
213
274
for cat in $$catalogs; do \
214
275
cat=`basename $$cat`; \
215
276
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
216
277
dir=$(localedir)/$$lang/LC_MESSAGES; \
217
$(mkinstalldirs) $(DESTDIR)$$dir; \
278
$(mkdir_p) $(DESTDIR)$$dir; \
218
279
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
219
280
if test -n "$$lc"; then \
220
281
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
289
350
$(MAKE) update-po
291
352
# This is a separate target because 'update-po' must be executed before.
353
dist2: stamp-po $(DISTFILES)
293
354
dists="$(DISTFILES)"; \
294
355
if test "$(PACKAGE)" = "gettext-tools"; then \
295
356
dists="$$dists Makevars.template"; \
358
if test -f $(srcdir)/$(DOMAIN).pot; then \
359
dists="$$dists $(DOMAIN).pot stamp-po"; \
297
361
if test -f $(srcdir)/ChangeLog; then \
298
362
dists="$$dists ChangeLog"; \
305
369
if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
306
370
for file in $$dists; do \
307
371
if test -f $$file; then \
308
cp -p $$file $(distdir); \
372
cp -p $$file $(distdir) || exit 1; \
310
cp -p $(srcdir)/$$file $(distdir); \
374
cp -p $(srcdir)/$$file $(distdir) || exit 1; \
354
418
update-gmo: Makefile $(GMOFILES)
357
Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@
421
Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
358
422
cd $(top_builddir) \
359
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
360
$(SHELL) ./config.status
423
&& $(SHELL) ./config.status $(subdir)/$@.in po-directories