1
# Makefile for PO directory in any package using GNU gettext.
2
# Copyright (C) 1995-1997, 2000-2003 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
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
6
# License but which still want to provide support for the GNU gettext
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.
11
# - Modified by Intltool to use intltool instead of gettext directly.
22
top_srcdir = @top_srcdir@
27
exec_prefix = @exec_prefix@
29
localedir = $(datadir)/locale
30
gettextsrcdir = $(datadir)/gettext/po
33
INSTALL_DATA = @INSTALL_DATA@
34
MKINSTALLDIRS = @MKINSTALLDIRS@
35
mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
37
DOMAIN = $(GETTEXT_PACKAGE)
41
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
42
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
43
INTLTOOL_MERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --dist --gettext-package $(DOMAIN)
50
UPDATEPOFILES = @UPDATEPOFILES@
51
DUMMYPOFILES = @DUMMYPOFILES@
52
DISTFILES.common = Makefile.in.in remove-potcdate.sin \
53
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
54
DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
55
$(POFILES) $(GMOFILES) \
56
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
62
# Makevars gets inserted here. (Don't remove this line!)
65
.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
68
@echo "$(MSGFMT) -c -o $@ $<"; \
69
$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
72
@lang=`echo $* | sed -e 's,.*/,,'`; \
73
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
74
echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
75
cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
78
sed -e '/^#/d' $< > t-$@
87
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
88
# been loosely updated. Its purpose is that when a developer or translator
89
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
90
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
91
# invocations of "make" will do nothing. This timestamp would not be necessary
92
# if updating the $(CATALOGS) would always touch them; however, the rule for
93
# $(POFILES) has been designed to not touch files that don't need to be
95
stamp-po: $(srcdir)/$(DOMAIN).pot
96
test -z "$(CATALOGS)" || $(MAKE) $(CATALOGS)
97
@echo "touch stamp-po"
98
@echo timestamp > stamp-poT
99
@mv stamp-poT stamp-po
101
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
102
# otherwise packages like GCC can not be built if only parts of the source
103
# have been downloaded.
105
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
106
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
107
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
108
INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT); \
109
$(INTLTOOL_UPDATE) --pot --gettext-package $(DOMAIN)
111
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
112
# every "make" invocation, only create it when it is missing.
113
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
114
$(srcdir)/$(DOMAIN).pot:
115
$(MAKE) $(DOMAIN).pot-update
117
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
118
# Note that a PO file is not touched if it doesn't need to be changed.
119
$(POFILES): $(srcdir)/$(DOMAIN).pot
120
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
121
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
122
echo "$${cdcmd}$(INTLTOOL_UPDATE) $${lang}.po"; \
123
cd $(srcdir) && $(INTLTOOL_UPDATE) $${lang};
125
install: install-exec install-data
127
install-data: install-data-@USE_NLS@
128
if test "$(PACKAGE)" = "gettext-tools"; then \
129
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
130
for file in $(DISTFILES.common) Makevars.template; do \
131
$(INSTALL_DATA) $(srcdir)/$$file \
132
$(DESTDIR)$(gettextsrcdir)/$$file; \
134
for file in Makevars; do \
135
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
141
install-data-yes: all
142
$(mkinstalldirs) $(DESTDIR)$(datadir)
143
@catalogs='$(CATALOGS)'; \
144
for cat in $$catalogs; do \
145
cat=`basename $$cat`; \
146
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
147
dir=$(localedir)/$$lang/LC_MESSAGES; \
148
$(mkinstalldirs) $(DESTDIR)$$dir; \
149
if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
150
$(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
151
echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
152
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
153
if test -n "$$lc"; then \
154
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
155
link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
156
mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
157
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
158
(cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
160
if test -f $$file; then \
161
ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
164
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
166
if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
169
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
170
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
173
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
174
ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
175
ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
176
cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
177
echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
182
install-strip: install
184
installdirs: installdirs-exec installdirs-data
186
installdirs-data: installdirs-data-@USE_NLS@
187
if test "$(PACKAGE)" = "gettext-tools"; then \
188
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
193
installdirs-data-yes:
194
$(mkinstalldirs) $(DESTDIR)$(datadir)
195
@catalogs='$(CATALOGS)'; \
196
for cat in $$catalogs; do \
197
cat=`basename $$cat`; \
198
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
199
dir=$(localedir)/$$lang/LC_MESSAGES; \
200
$(mkinstalldirs) $(DESTDIR)$$dir; \
201
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
202
if test -n "$$lc"; then \
203
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
204
link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
205
mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
206
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
207
(cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
209
if test -f $$file; then \
210
ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
213
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
215
if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
218
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
219
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
226
# Define this as empty until I found a useful application.
229
uninstall: uninstall-exec uninstall-data
231
uninstall-data: uninstall-data-@USE_NLS@
232
if test "$(PACKAGE)" = "gettext-tools"; then \
233
for file in $(DISTFILES.common) Makevars.template; do \
234
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
241
catalogs='$(CATALOGS)'; \
242
for cat in $$catalogs; do \
243
cat=`basename $$cat`; \
244
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
245
for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
246
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
252
info dvi ps pdf html tags TAGS ctags CTAGS ID:
255
rm -f remove-potcdate.sed
257
rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
263
rm -f Makefile Makefile.in POTFILES *.mo
265
maintainer-clean: distclean
266
@echo "This command is intended for maintainers to use;"
267
@echo "it deletes files that may require special tools to rebuild."
268
rm -f stamp-po $(GMOFILES)
270
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
274
# This is a separate target because 'update-po' must be executed before.
276
dists="$(DISTFILES)"; \
277
if test "$(PACKAGE)" = "gettext-tools"; then \
278
dists="$$dists Makevars.template"; \
280
if test -f $(srcdir)/ChangeLog; then \
281
dists="$$dists ChangeLog"; \
283
for i in 0 1 2 3 4 5 6 7 8 9; do \
284
if test -f $(srcdir)/ChangeLog.$$i; then \
285
dists="$$dists ChangeLog.$$i"; \
288
if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
289
for file in $$dists; do \
290
if test -f $$file; then \
291
cp -p $$file $(distdir); \
293
cp -p $(srcdir)/$$file $(distdir); \
298
$(MAKE) $(DOMAIN).pot-update
299
test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
302
# General rule for updating PO files.
305
@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
306
if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
309
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
310
echo "$${cdcmd}$(INTLTOOL_MERGE) $$lang"; \
312
$(INTLTOOL_MERGE) $$lang || \
313
(echo "intltool-update for $$lang.po failed!" 1>&2; \
314
cp $$lang.old.po $$lang.po;)
318
update-gmo: Makefile $(GMOFILES)
321
Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@
323
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
324
$(SHELL) ./config.status
328
# Tell versions [3.59,3.63) of GNU make not to export all variables.
329
# Otherwise a system limit (for SysV at least) may be exceeded.