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>
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 # Origin: gettext-0.16
15 PACKAGE_BUGREPORT = jeanfi@gmail.com
25 exec_prefix = ${prefix}
26 datarootdir = ${prefix}/share
27 datadir = ${datarootdir}
28 localedir = ${datarootdir}/locale
29 gettextsrcdir = $(datadir)/gettext/po
31 INSTALL = /usr/bin/install -c
32 INSTALL_DATA = ${INSTALL} -m 644
35 # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
36 # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
37 # ${SHELL} /home/jporsini/work/wpitchoune/svnpub/prss/trunk/install-sh does not start with $(SHELL), so we add it.
38 # In automake >= 1.10, /bin/mkdir -p is derived from ${MKDIR_P}, which is defined
39 # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
40 # versions, $(mkinstalldirs) and $(install_sh) are unused.
41 mkinstalldirs = $(SHELL) ${SHELL} /home/jporsini/work/wpitchoune/svnpub/prss/trunk/install-sh -d
42 install_sh = $(SHELL) ${SHELL} /home/jporsini/work/wpitchoune/svnpub/prss/trunk/install-sh
43 MKDIR_P = /bin/mkdir -p
44 mkdir_p = /bin/mkdir -p
46 GMSGFMT_ = /usr/bin/msgfmt
47 GMSGFMT_no = /usr/bin/msgfmt
48 GMSGFMT_yes = /usr/bin/msgfmt
49 GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
50 MSGFMT_ = /usr/bin/msgfmt
51 MSGFMT_no = /usr/bin/msgfmt
52 MSGFMT_yes = /usr/bin/msgfmt
53 MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
54 XGETTEXT_ = /usr/bin/xgettext
55 XGETTEXT_no = /usr/bin/xgettext
56 XGETTEXT_yes = /usr/bin/xgettext
57 XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
59 MSGMERGE_UPDATE = /usr/bin/msgmerge --update
66 UPDATEPOFILES = fr.po-update
68 DISTFILES.common = Makefile.in.in remove-potcdate.sin \
69 $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
70 DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
71 $(POFILES) $(GMOFILES) \
72 $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
77 ../src/glade/prss.glade
81 # Makevars gets inserted here. (Don't remove this line!)
82 # Makefile variables for PO directory in any package using GNU gettext.
84 # Usually the message domain is the same as the package name.
87 # These two variables depend on the location of this directory.
91 # These options get passed to xgettext.
92 XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
94 # This is the copyright holder that gets inserted into the header of the
95 # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
96 # package. (Note that the msgstr strings, extracted from the package's
97 # sources, belong to the copyright holder of the package.) Translators are
98 # expected to transfer the copyright for their translations to this person
99 # or entity, or to disclaim their copyright. The empty string stands for
100 # the public domain; in this case the translators are expected to disclaim
102 COPYRIGHT_HOLDER = Free Software Foundation, Inc.
104 # This is the email address or URL to which the translators shall report
105 # bugs in the untranslated strings:
106 # - Strings which are not entire sentences, see the maintainer guidelines
107 # in the GNU gettext documentation, section 'Preparing Strings'.
108 # - Strings which use unclear terms or require additional context to be
110 # - Strings which make invalid assumptions about notation of date, time or
112 # - Pluralisation problems.
113 # - Incorrect English spelling.
114 # - Incorrect formatting.
115 # It can be your email address, or a mailing list address where translators
116 # can write to without being subscribed, or the URL of a web page through
117 # which the translators can contact you.
120 # This is the list of locale categories, beyond LC_MESSAGES, for which the
121 # message catalogs shall be used. It is usually empty.
122 EXTRA_LOCALE_CATEGORIES =
125 .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
128 @echo "$(MSGFMT) -c -o $@ $<"; \
129 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
132 @lang=`echo $* | sed -e 's,.*/,,'`; \
133 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
134 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
135 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
138 sed -e '/^#/d' $< > t-$@
147 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
148 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
149 # we don't want to bother translators with empty POT files). We assume that
150 # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
151 # In this case, stamp-po is a nop (i.e. a phony target).
153 # stamp-po is a timestamp denoting the last time at which the CATALOGS have
154 # been loosely updated. Its purpose is that when a developer or translator
155 # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
156 # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
157 # invocations of "make" will do nothing. This timestamp would not be necessary
158 # if updating the $(CATALOGS) would always touch them; however, the rule for
159 # $(POFILES) has been designed to not touch files that don't need to be
161 stamp-po: $(srcdir)/$(DOMAIN).pot
162 test ! -f $(srcdir)/$(DOMAIN).pot || \
163 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
164 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
165 echo "touch stamp-po" && \
166 echo timestamp > stamp-poT && \
167 mv stamp-poT stamp-po; \
170 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
171 # otherwise packages like GCC can not be built if only parts of the source
172 # have been downloaded.
174 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
175 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
176 $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
177 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
178 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
180 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
182 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
183 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
184 --files-from=$(srcdir)/POTFILES.in \
185 --copyright-holder='$(COPYRIGHT_HOLDER)' \
186 --msgid-bugs-address="$$msgid_bugs_address"
187 test ! -f $(DOMAIN).po || { \
188 if test -f $(srcdir)/$(DOMAIN).pot; then \
189 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
190 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
191 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
192 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
194 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
195 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
198 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
202 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
203 # every "make" invocation, only create it when it is missing.
204 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
205 $(srcdir)/$(DOMAIN).pot:
206 $(MAKE) $(DOMAIN).pot-update
208 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
209 # Note that a PO file is not touched if it doesn't need to be changed.
210 $(POFILES): $(srcdir)/$(DOMAIN).pot
211 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
212 if test -f "$(srcdir)/$${lang}.po"; then \
213 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
214 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
215 cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
217 $(MAKE) $${lang}.po-create; \
221 install: install-exec install-data
223 install-data: install-data-yes
224 if test "$(PACKAGE)" = "gettext-tools"; then \
225 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
226 for file in $(DISTFILES.common) Makevars.template; do \
227 $(INSTALL_DATA) $(srcdir)/$$file \
228 $(DESTDIR)$(gettextsrcdir)/$$file; \
230 for file in Makevars; do \
231 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
237 install-data-yes: all
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 if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
246 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
247 echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
248 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
249 if test -n "$$lc"; then \
250 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
251 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
252 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
253 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
254 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
256 if test -f $$file; then \
257 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
260 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
262 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
265 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
266 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
269 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
270 ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
271 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
272 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
273 echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
278 install-strip: install
280 installdirs: installdirs-exec installdirs-data
282 installdirs-data: installdirs-data-yes
283 if test "$(PACKAGE)" = "gettext-tools"; then \
284 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
289 installdirs-data-yes:
290 $(mkdir_p) $(DESTDIR)$(datadir)
291 @catalogs='$(CATALOGS)'; \
292 for cat in $$catalogs; do \
293 cat=`basename $$cat`; \
294 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
295 dir=$(localedir)/$$lang/LC_MESSAGES; \
296 $(mkdir_p) $(DESTDIR)$$dir; \
297 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
298 if test -n "$$lc"; then \
299 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
300 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
301 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
302 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
303 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
305 if test -f $$file; then \
306 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
309 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
311 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
314 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
315 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
322 # Define this as empty until I found a useful application.
325 uninstall: uninstall-exec uninstall-data
327 uninstall-data: uninstall-data-yes
328 if test "$(PACKAGE)" = "gettext-tools"; then \
329 for file in $(DISTFILES.common) Makevars.template; do \
330 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
337 catalogs='$(CATALOGS)'; \
338 for cat in $$catalogs; do \
339 cat=`basename $$cat`; \
340 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
341 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
342 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
348 info dvi ps pdf html tags TAGS ctags CTAGS ID:
351 rm -f remove-potcdate.sed
353 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
359 rm -f Makefile Makefile.in POTFILES *.mo
361 maintainer-clean: distclean
362 @echo "This command is intended for maintainers to use;"
363 @echo "it deletes files that may require special tools to rebuild."
364 rm -f stamp-po $(GMOFILES)
366 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
370 # This is a separate target because 'update-po' must be executed before.
371 dist2: stamp-po $(DISTFILES)
372 dists="$(DISTFILES)"; \
373 if test "$(PACKAGE)" = "gettext-tools"; then \
374 dists="$$dists Makevars.template"; \
376 if test -f $(srcdir)/$(DOMAIN).pot; then \
377 dists="$$dists $(DOMAIN).pot stamp-po"; \
379 if test -f $(srcdir)/ChangeLog; then \
380 dists="$$dists ChangeLog"; \
382 for i in 0 1 2 3 4 5 6 7 8 9; do \
383 if test -f $(srcdir)/ChangeLog.$$i; then \
384 dists="$$dists ChangeLog.$$i"; \
387 if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
388 for file in $$dists; do \
389 if test -f $$file; then \
390 cp -p $$file $(distdir) || exit 1; \
392 cp -p $(srcdir)/$$file $(distdir) || exit 1; \
397 $(MAKE) $(DOMAIN).pot-update
398 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
401 # General rule for creating PO files.
404 @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
405 echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
408 # General rule for updating PO files.
411 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
412 if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
415 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
416 echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
418 if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
419 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
420 rm -f $$tmpdir/$$lang.new.po; \
422 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
425 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
430 echo "msgmerge for $$lang.po failed!" 1>&2; \
431 rm -f $$tmpdir/$$lang.new.po; \
436 update-gmo: Makefile $(GMOFILES)
439 Makefile: Makefile.in.in Makevars $(top_builddir)/config.status POTFILES.in LINGUAS
441 && $(SHELL) ./config.status $(subdir)/$@.in po-directories
445 # Tell versions [3.59,3.63) of GNU make not to export all variables.
446 # Otherwise a system limit (for SysV at least) may be exceeded.
448 # Special Makefile rules for English message catalogs with quotation marks.
450 DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
452 .SUFFIXES: .insert-header .po-update-en
455 $(MAKE) en@quot.po-update
456 en@boldquot.po-create:
457 $(MAKE) en@boldquot.po-update
459 en@quot.po-update: en@quot.po-update-en
460 en@boldquot.po-update: en@boldquot.po-update-en
462 .insert-header.po-update-en:
463 @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
464 if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
467 ll=`echo $$lang | sed -e 's/@.*//'`; \
468 LC_ALL=C; export LC_ALL; \
470 if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
471 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
472 rm -f $$tmpdir/$$lang.new.po; \
474 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
477 echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
482 echo "creation of $$lang.po failed!" 1>&2; \
483 rm -f $$tmpdir/$$lang.new.po; \
486 en@quot.insert-header: insert-header.sin
487 sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
489 en@boldquot.insert-header: insert-header.sin
490 sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
492 mostlyclean: mostlyclean-quot
494 rm -f *.insert-header