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/ptask/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/ptask/trunk/install-sh -d
42 install_sh = $(SHELL) ${SHELL} /home/jporsini/work/wpitchoune/svnpub/ptask/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)
76 ../src/glade/ptask.glade
79 # Makevars gets inserted here. (Don't remove this line!)
80 # Makefile variables for PO directory in any package using GNU gettext.
82 # Usually the message domain is the same as the package name.
85 # These two variables depend on the location of this directory.
89 # These options get passed to xgettext.
90 XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
92 # This is the copyright holder that gets inserted into the header of the
93 # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
94 # package. (Note that the msgstr strings, extracted from the package's
95 # sources, belong to the copyright holder of the package.) Translators are
96 # expected to transfer the copyright for their translations to this person
97 # or entity, or to disclaim their copyright. The empty string stands for
98 # the public domain; in this case the translators are expected to disclaim
100 COPYRIGHT_HOLDER = Free Software Foundation, Inc.
102 # This is the email address or URL to which the translators shall report
103 # bugs in the untranslated strings:
104 # - Strings which are not entire sentences, see the maintainer guidelines
105 # in the GNU gettext documentation, section 'Preparing Strings'.
106 # - Strings which use unclear terms or require additional context to be
108 # - Strings which make invalid assumptions about notation of date, time or
110 # - Pluralisation problems.
111 # - Incorrect English spelling.
112 # - Incorrect formatting.
113 # It can be your email address, or a mailing list address where translators
114 # can write to without being subscribed, or the URL of a web page through
115 # which the translators can contact you.
118 # This is the list of locale categories, beyond LC_MESSAGES, for which the
119 # message catalogs shall be used. It is usually empty.
120 EXTRA_LOCALE_CATEGORIES =
123 .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
126 @echo "$(MSGFMT) -c -o $@ $<"; \
127 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
130 @lang=`echo $* | sed -e 's,.*/,,'`; \
131 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
132 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
133 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
136 sed -e '/^#/d' $< > t-$@
145 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
146 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
147 # we don't want to bother translators with empty POT files). We assume that
148 # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
149 # In this case, stamp-po is a nop (i.e. a phony target).
151 # stamp-po is a timestamp denoting the last time at which the CATALOGS have
152 # been loosely updated. Its purpose is that when a developer or translator
153 # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
154 # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
155 # invocations of "make" will do nothing. This timestamp would not be necessary
156 # if updating the $(CATALOGS) would always touch them; however, the rule for
157 # $(POFILES) has been designed to not touch files that don't need to be
159 stamp-po: $(srcdir)/$(DOMAIN).pot
160 test ! -f $(srcdir)/$(DOMAIN).pot || \
161 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
162 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
163 echo "touch stamp-po" && \
164 echo timestamp > stamp-poT && \
165 mv stamp-poT stamp-po; \
168 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
169 # otherwise packages like GCC can not be built if only parts of the source
170 # have been downloaded.
172 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
173 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
174 $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
175 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
176 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
178 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
180 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
181 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
182 --files-from=$(srcdir)/POTFILES.in \
183 --copyright-holder='$(COPYRIGHT_HOLDER)' \
184 --msgid-bugs-address="$$msgid_bugs_address"
185 test ! -f $(DOMAIN).po || { \
186 if test -f $(srcdir)/$(DOMAIN).pot; then \
187 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
188 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
189 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
190 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
192 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
193 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
196 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
200 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
201 # every "make" invocation, only create it when it is missing.
202 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
203 $(srcdir)/$(DOMAIN).pot:
204 $(MAKE) $(DOMAIN).pot-update
206 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
207 # Note that a PO file is not touched if it doesn't need to be changed.
208 $(POFILES): $(srcdir)/$(DOMAIN).pot
209 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
210 if test -f "$(srcdir)/$${lang}.po"; then \
211 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
212 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
213 cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
215 $(MAKE) $${lang}.po-create; \
219 install: install-exec install-data
221 install-data: install-data-yes
222 if test "$(PACKAGE)" = "gettext-tools"; then \
223 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
224 for file in $(DISTFILES.common) Makevars.template; do \
225 $(INSTALL_DATA) $(srcdir)/$$file \
226 $(DESTDIR)$(gettextsrcdir)/$$file; \
228 for file in Makevars; do \
229 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
235 install-data-yes: all
236 $(mkdir_p) $(DESTDIR)$(datadir)
237 @catalogs='$(CATALOGS)'; \
238 for cat in $$catalogs; do \
239 cat=`basename $$cat`; \
240 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
241 dir=$(localedir)/$$lang/LC_MESSAGES; \
242 $(mkdir_p) $(DESTDIR)$$dir; \
243 if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
244 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
245 echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
246 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
247 if test -n "$$lc"; then \
248 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
249 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
250 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
251 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
252 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
254 if test -f $$file; then \
255 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
258 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
260 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
263 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
264 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
267 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
268 ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
269 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
270 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
271 echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
276 install-strip: install
278 installdirs: installdirs-exec installdirs-data
280 installdirs-data: installdirs-data-yes
281 if test "$(PACKAGE)" = "gettext-tools"; then \
282 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
287 installdirs-data-yes:
288 $(mkdir_p) $(DESTDIR)$(datadir)
289 @catalogs='$(CATALOGS)'; \
290 for cat in $$catalogs; do \
291 cat=`basename $$cat`; \
292 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
293 dir=$(localedir)/$$lang/LC_MESSAGES; \
294 $(mkdir_p) $(DESTDIR)$$dir; \
295 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
296 if test -n "$$lc"; then \
297 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
298 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
299 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
300 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
301 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
303 if test -f $$file; then \
304 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
307 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
309 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
312 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
313 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
320 # Define this as empty until I found a useful application.
323 uninstall: uninstall-exec uninstall-data
325 uninstall-data: uninstall-data-yes
326 if test "$(PACKAGE)" = "gettext-tools"; then \
327 for file in $(DISTFILES.common) Makevars.template; do \
328 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
335 catalogs='$(CATALOGS)'; \
336 for cat in $$catalogs; do \
337 cat=`basename $$cat`; \
338 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
339 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
340 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
346 info dvi ps pdf html tags TAGS ctags CTAGS ID:
349 rm -f remove-potcdate.sed
351 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
357 rm -f Makefile Makefile.in POTFILES *.mo
359 maintainer-clean: distclean
360 @echo "This command is intended for maintainers to use;"
361 @echo "it deletes files that may require special tools to rebuild."
362 rm -f stamp-po $(GMOFILES)
364 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
368 # This is a separate target because 'update-po' must be executed before.
369 dist2: stamp-po $(DISTFILES)
370 dists="$(DISTFILES)"; \
371 if test "$(PACKAGE)" = "gettext-tools"; then \
372 dists="$$dists Makevars.template"; \
374 if test -f $(srcdir)/$(DOMAIN).pot; then \
375 dists="$$dists $(DOMAIN).pot stamp-po"; \
377 if test -f $(srcdir)/ChangeLog; then \
378 dists="$$dists ChangeLog"; \
380 for i in 0 1 2 3 4 5 6 7 8 9; do \
381 if test -f $(srcdir)/ChangeLog.$$i; then \
382 dists="$$dists ChangeLog.$$i"; \
385 if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
386 for file in $$dists; do \
387 if test -f $$file; then \
388 cp -p $$file $(distdir) || exit 1; \
390 cp -p $(srcdir)/$$file $(distdir) || exit 1; \
395 $(MAKE) $(DOMAIN).pot-update
396 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
399 # General rule for creating PO files.
402 @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
403 echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
406 # General rule for updating PO files.
409 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
410 if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
413 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
414 echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
416 if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
417 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
418 rm -f $$tmpdir/$$lang.new.po; \
420 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
423 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
428 echo "msgmerge for $$lang.po failed!" 1>&2; \
429 rm -f $$tmpdir/$$lang.new.po; \
434 update-gmo: Makefile $(GMOFILES)
437 Makefile: Makefile.in.in Makevars $(top_builddir)/config.status POTFILES.in LINGUAS
439 && $(SHELL) ./config.status $(subdir)/$@.in po-directories
443 # Tell versions [3.59,3.63) of GNU make not to export all variables.
444 # Otherwise a system limit (for SysV at least) may be exceeded.