1 # -*- buffer-read-only: t -*- vi: set ro:
2 # DO NOT EDIT! GENERATED AUTOMATICALLY!
3 # Makefile for PO directory in any package using GNU gettext.
4 # Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
6 # This file can be copied and used freely without restrictions. It can
7 # be used in projects which are not available under the GNU General Public
8 # License but which still want to provide support for the GNU gettext
10 # Please note that the actual code of GNU gettext is covered by the GNU
11 # General Public License and is *not* in the public domain.
13 # Origin: gettext-0.15
17 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
23 top_srcdir = @top_srcdir@
27 exec_prefix = @exec_prefix@
28 datarootdir = @datarootdir@
30 localedir = @localedir@
31 gettextsrcdir = $(datadir)/gettext/po
34 INSTALL_DATA = @INSTALL_DATA@
35 mkinstalldirs = $(SHELL) @install_sh@ -d
39 GMSGFMT_no = @GMSGFMT@
40 GMSGFMT_yes = @GMSGFMT_015@
41 GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
44 MSGFMT_yes = @MSGFMT_015@
45 MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
46 XGETTEXT_ = @XGETTEXT@
47 XGETTEXT_no = @XGETTEXT@
48 XGETTEXT_yes = @XGETTEXT_015@
49 XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
51 MSGMERGE_UPDATE = @MSGMERGE@ --update
58 UPDATEPOFILES = @UPDATEPOFILES@
59 DUMMYPOFILES = @DUMMYPOFILES@
60 DISTFILES.common = Makefile.in.in remove-potcdate.sin \
61 $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
62 DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
63 $(POFILES) $(GMOFILES) \
64 $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
70 # Makevars gets inserted here. (Don't remove this line!)
73 .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
76 @echo "$(MSGFMT) -c -o $@ $<"; \
77 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
80 @lang=`echo $* | sed -e 's,.*/,,'`; \
81 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
82 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
83 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
86 sed -e '/^#/d' $< > t-$@
95 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
96 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
97 # we don't want to bother translators with empty POT files). We assume that
98 # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
99 # In this case, stamp-po is a nop (i.e. a phony target).
101 # stamp-po is a timestamp denoting the last time at which the CATALOGS have
102 # been loosely updated. Its purpose is that when a developer or translator
103 # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
104 # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
105 # invocations of "make" will do nothing. This timestamp would not be necessary
106 # if updating the $(CATALOGS) would always touch them; however, the rule for
107 # $(POFILES) has been designed to not touch files that don't need to be
109 stamp-po: $(srcdir)/$(DOMAIN).pot
110 test ! -f $(srcdir)/$(DOMAIN).pot || \
111 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
112 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
113 echo "touch stamp-po" && \
114 echo timestamp > stamp-poT && \
115 mv stamp-poT stamp-po; \
118 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
119 # otherwise packages like GCC can not be built if only parts of the source
120 # have been downloaded.
122 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
123 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
124 $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
125 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
126 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
128 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
130 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
131 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
132 --files-from=$(srcdir)/POTFILES.in \
133 --copyright-holder='$(COPYRIGHT_HOLDER)' \
134 --msgid-bugs-address="$$msgid_bugs_address"
135 test ! -f $(DOMAIN).po || { \
136 if test -f $(srcdir)/$(DOMAIN).pot; then \
137 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
138 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
139 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
140 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
142 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
143 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
146 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
150 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
151 # every "make" invocation, only create it when it is missing.
152 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
153 $(srcdir)/$(DOMAIN).pot:
154 $(MAKE) $(DOMAIN).pot-update
156 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
157 # Note that a PO file is not touched if it doesn't need to be changed.
158 $(POFILES): $(srcdir)/$(DOMAIN).pot
159 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
160 if test -f "$(srcdir)/$${lang}.po"; then \
161 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
162 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
163 cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
165 $(MAKE) $${lang}.po-create; \
169 install: install-exec install-data
171 install-data: install-data-@USE_NLS@
172 if test "$(PACKAGE)" = "gettext-tools"; then \
173 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
174 for file in $(DISTFILES.common) Makevars.template; do \
175 $(INSTALL_DATA) $(srcdir)/$$file \
176 $(DESTDIR)$(gettextsrcdir)/$$file; \
178 for file in Makevars; do \
179 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
185 install-data-yes: all
186 $(mkdir_p) $(DESTDIR)$(datadir)
187 @catalogs='$(CATALOGS)'; \
188 for cat in $$catalogs; do \
189 cat=`basename $$cat`; \
190 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
191 dir=$(localedir)/$$lang/LC_MESSAGES; \
192 $(mkdir_p) $(DESTDIR)$$dir; \
193 if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
194 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
195 echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
196 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
197 if test -n "$$lc"; then \
198 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
199 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
200 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
201 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
202 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
204 if test -f $$file; then \
205 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
208 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
210 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
213 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
214 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
217 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
218 ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
219 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
220 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
221 echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
226 install-strip: install
228 installdirs: installdirs-exec installdirs-data
230 installdirs-data: installdirs-data-@USE_NLS@
231 if test "$(PACKAGE)" = "gettext-tools"; then \
232 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
237 installdirs-data-yes:
238 $(mkdir_p) $(DESTDIR)$(datadir)
239 @catalogs='$(CATALOGS)'; \
240 for cat in $$catalogs; do \
241 cat=`basename $$cat`; \
242 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
243 dir=$(localedir)/$$lang/LC_MESSAGES; \
244 $(mkdir_p) $(DESTDIR)$$dir; \
245 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
246 if test -n "$$lc"; then \
247 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
248 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
249 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
250 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
251 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
253 if test -f $$file; then \
254 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
257 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
259 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
262 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
263 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
270 # Define this as empty until I found a useful application.
273 uninstall: uninstall-exec uninstall-data
275 uninstall-data: uninstall-data-@USE_NLS@
276 if test "$(PACKAGE)" = "gettext-tools"; then \
277 for file in $(DISTFILES.common) Makevars.template; do \
278 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
285 catalogs='$(CATALOGS)'; \
286 for cat in $$catalogs; do \
287 cat=`basename $$cat`; \
288 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
289 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
290 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
296 info dvi ps pdf html tags TAGS ctags CTAGS ID:
299 rm -f remove-potcdate.sed
301 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
307 rm -f Makefile Makefile.in POTFILES *.mo
309 maintainer-clean: distclean
310 @echo "This command is intended for maintainers to use;"
311 @echo "it deletes files that may require special tools to rebuild."
312 rm -f stamp-po $(GMOFILES)
314 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
318 # This is a separate target because 'update-po' must be executed before.
319 dist2: stamp-po $(DISTFILES)
320 dists="$(DISTFILES)"; \
321 if test "$(PACKAGE)" = "gettext-tools"; then \
322 dists="$$dists Makevars.template"; \
324 if test -f $(srcdir)/$(DOMAIN).pot; then \
325 dists="$$dists $(DOMAIN).pot stamp-po"; \
327 if test -f $(srcdir)/ChangeLog; then \
328 dists="$$dists ChangeLog"; \
330 for i in 0 1 2 3 4 5 6 7 8 9; do \
331 if test -f $(srcdir)/ChangeLog.$$i; then \
332 dists="$$dists ChangeLog.$$i"; \
335 if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
336 for file in $$dists; do \
337 if test -f $$file; then \
338 cp -p $$file $(distdir) || exit 1; \
340 cp -p $(srcdir)/$$file $(distdir) || exit 1; \
345 $(MAKE) $(DOMAIN).pot-update
346 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
349 # General rule for creating PO files.
352 @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
353 echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
356 # General rule for updating PO files.
359 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
360 if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
363 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
364 echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
366 if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
367 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
368 rm -f $$tmpdir/$$lang.new.po; \
370 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
373 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
378 echo "msgmerge for $$lang.po failed!" 1>&2; \
379 rm -f $$tmpdir/$$lang.new.po; \
384 update-gmo: Makefile $(GMOFILES)
387 Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
389 && $(SHELL) ./config.status $(subdir)/$@.in po-directories
393 # Tell versions [3.59,3.63) of GNU make not to export all variables.
394 # Otherwise a system limit (for SysV at least) may be exceeded.