1 ## Makefile for the gettext-tools/examples/po subdirectory of GNU gettext
2 ## Copyright (C) 1995-1998, 2000-2007, 2009 Free Software Foundation, Inc.
4 ## This program is free software: you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 3 of the License, or
7 ## (at your option) any later version.
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
17 ## Process this file with automake to produce Makefile.in.
19 AUTOMAKE_OPTIONS = 1.5 gnits
21 # List of files which contain translatable strings.
24 hello-c-gnome/hello.c \
25 hello-c-gnome3/hello.c \
26 hello-c-gnome3/hello.desktop.in.in \
27 hello-c-gnome3/hello.gschema.xml \
28 hello-c-gnome3/hello.ui \
30 hello-c++-qt/hello.cc \
31 hello-c++-kde/hello.cc \
32 hello-c++-kde/hellowindow.h \
33 hello-c++-kde/hellowindow.cc \
34 hello-c++-gnome/hello.cc \
35 hello-c++-wxwidgets/hello.cc \
37 hello-objc-gnustep/main.m \
38 hello-objc-gnustep/AppController.h \
39 hello-objc-gnustep/AppController.m \
40 hello-objc-gnustep/Hello.h \
41 hello-objc-gnustep/Hello.m \
42 hello-objc-gnome/hello.m \
44 hello-python/hello.py.in \
45 hello-clisp/hello.lisp.in \
46 hello-librep/hello.jl.in \
47 hello-guile/hello.scm \
48 hello-smalltalk/hello.st.in \
49 hello-java/Hello.java \
50 hello-java-awt/Hello.java \
51 hello-java-swing/Hello.java \
52 hello-java-qtjambi/Hello.java \
53 hello-csharp/hello.cs \
54 hello-csharp-forms/hello.cs \
55 hello-gawk/hello.awk \
56 hello-pascal/hello.pas \
59 hello-tcl-tk/hello.tcl \
60 hello-perl/hello-1.pl.in \
61 hello-perl/hello-2.pl.in \
64 # List of small POT files.
73 hello-c++-wxwidgets.pot \
75 hello-objc-gnustep.pot \
76 hello-objc-gnome.pot \
85 hello-java-swing.pot \
86 hello-java-qtjambi.pot \
88 hello-csharp-forms.pot \
97 # This is a synthetic domain name.
98 DOMAIN = gettext-examples
100 # This is the copyright holder that gets inserted into the header of the
101 # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
102 # package. (Note that the msgstr strings, extracted from the package's
103 # sources, belong to the copyright holder of the package.) Translators are
104 # expected to transfer the copyright for their translations to this person
105 # or entity, or to disclaim their copyright. The empty string stands for
106 # the public domain; in this case the translators are expected to disclaim
108 COPYRIGHT_HOLDER = Yoyodyne, Inc.
110 # This is the email address or URL to which the translators shall report
111 # bugs in the untranslated strings:
112 # - Strings which are not entire sentences, see the maintainer guidelines
113 # in the GNU gettext documentation, section 'Preparing Strings'.
114 # - Strings which use unclear terms or require additional context to be
116 # - Strings which make invalid assumptions about notation of date, time or
118 # - Pluralisation problems.
119 # - Incorrect English spelling.
120 # - Incorrect formatting.
121 # It can be your email address, or a mailing list address where translators
122 # can write to without being subscribed, or the URL of a web page through
123 # which the translators can contact you.
124 MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org
126 # This is the list of locale categories, beyond LC_MESSAGES, for which the
127 # message catalogs shall be used. It is usually empty.
128 EXTRA_LOCALE_CATEGORIES =
130 # These options get passed to msgmerge.
131 # Useful options are in particular:
132 # --previous to keep previous msgids of translated messages,
133 # --quiet to reduce the verbosity.
134 MSGMERGE_OPTIONS = --quiet
137 MSGMERGE_UPDATE = @MSGMERGE@ --update
140 MSGFILTER = msgfilter
142 # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
143 POTFILES_DEPS = @POTFILES_DEPS@
145 # This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po)
147 # This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update)
148 UPDATEPOFILES = @UPDATEPOFILES@
149 # This is computed as $(foreach lang, $(LINGUAS), $(lang).nop)
150 DUMMYPOFILES = @DUMMYPOFILES@
152 SUFFIXES = .po .sed .sin .nop .po-update
155 sed -e '/^#/d' $< > t-$@
159 all-local: all-local-@USE_NLS@
161 all-local-yes: stamp-po
164 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
165 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
166 # we don't want to bother translators with empty POT files). We assume that
167 # LINGUAS is empty in this case, i.e. $(POFILES) is empty. In this case,
168 # stamp-po is a nop (i.e. a phony target).
170 # stamp-po is a timestamp denoting the last time at which the CATALOGS have
171 # been loosely updated. Its purpose is that when a developer or translator
172 # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
173 # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
174 # invocations of "make" will do nothing. This timestamp would not be necessary
175 # if updating the $(CATALOGS) would always touch them; however, the rule for
176 # $(POFILES) has been designed to not touch files that don't need to be
178 stamp-po: $(srcdir)/$(DOMAIN).pot
179 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
180 echo "touch stamp-po" && \
181 echo timestamp > stamp-poT && \
182 mv stamp-poT stamp-po; \
185 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
186 # otherwise packages like GCC can not be built if only parts of the source
187 # have been downloaded.
189 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
190 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
191 $(DOMAIN).pot-update: $(POTFILES_DEPS) $(SMALLPOTS) remove-potcdate.sed
192 if test -n '$(MSGID_BUGS_ADDRESS)'; then \
193 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
195 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
197 $(XGETTEXT) --default-domain=$(DOMAIN) \
198 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
199 --copyright-holder='$(COPYRIGHT_HOLDER)' \
200 --msgid-bugs-address="$$msgid_bugs_address" \
201 --directory='$(srcdir)' \
203 test ! -f $(DOMAIN).po || { \
204 if test -f $(srcdir)/$(DOMAIN).pot; then \
205 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
206 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
207 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
208 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
210 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
211 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
214 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
219 hello-c.pot : $(POTFILES_DEPS)
220 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c
222 hello-c-gnome.pot : $(POTFILES_DEPS)
223 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c-gnome
225 hello-c-gnome3.pot : $(POTFILES_DEPS)
226 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c-gnome3
228 hello-c++.pot : $(POTFILES_DEPS)
229 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++
231 hello-c++-qt.pot : $(POTFILES_DEPS)
232 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-qt
234 hello-c++-kde.pot : $(POTFILES_DEPS)
235 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-kde
237 hello-c++-gnome.pot : $(POTFILES_DEPS)
238 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-gnome
240 hello-c++-wxwidgets.pot : $(POTFILES_DEPS)
241 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-wxwidgets
243 hello-objc.pot : $(POTFILES_DEPS)
244 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc
246 hello-objc-gnustep.pot : $(POTFILES_DEPS)
247 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc-gnustep
249 hello-objc-gnome.pot : $(POTFILES_DEPS)
250 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc-gnome
252 hello-sh.pot : $(POTFILES_DEPS)
253 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-sh
255 hello-python.pot : $(POTFILES_DEPS)
256 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-python
258 hello-clisp.pot : $(POTFILES_DEPS)
259 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-clisp
261 hello-librep.pot : $(POTFILES_DEPS)
262 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-librep
264 hello-guile.pot : $(POTFILES_DEPS)
265 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-guile
267 hello-smalltalk.pot : $(POTFILES_DEPS)
268 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-smalltalk
270 hello-java.pot : $(POTFILES_DEPS)
271 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java
273 hello-java-awt.pot : $(POTFILES_DEPS)
274 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-awt
276 hello-java-swing.pot : $(POTFILES_DEPS)
277 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-swing
279 hello-java-qtjambi.pot : $(POTFILES_DEPS)
280 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-qtjambi
282 hello-csharp.pot : $(POTFILES_DEPS)
283 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-csharp
285 hello-csharp-forms.pot : $(POTFILES_DEPS)
286 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-csharp-forms
288 hello-gawk.pot : $(POTFILES_DEPS)
289 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-gawk
291 hello-pascal.pot : $(POTFILES_DEPS)
292 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-pascal
294 hello-ycp.pot : $(POTFILES_DEPS)
295 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-ycp
297 hello-tcl.pot : $(POTFILES_DEPS)
298 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-tcl
300 hello-tcl-tk.pot : $(POTFILES_DEPS)
301 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-tcl-tk
303 hello-perl.pot : $(POTFILES_DEPS)
304 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-perl
306 hello-php.pot : $(POTFILES_DEPS)
307 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-php
310 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
311 # every "make" invocation, only create it when it is missing.
312 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
313 $(srcdir)/$(DOMAIN).pot:
314 $(MAKE) $(DOMAIN).pot-update
316 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
317 # Note that a PO file is not touched if it doesn't need to be changed.
318 $(POFILES): $(srcdir)/$(DOMAIN).pot
319 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
320 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
321 echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot"; \
322 cd $(srcdir) && $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot
328 MOSTLYCLEANFILES += remove-potcdate.sed
329 MOSTLYCLEANFILES += stamp-poT
330 MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
331 MOSTLYCLEANFILES += *.o
333 MAINTAINERCLEANFILES = stamp-po $(SMALLPOTS)
335 EXTRA_DIST = remove-potcdate.sin xsmallpot.sh mmsmallpo.sh LINGUAS \
338 # Hidden from automake, but really activated. Works around an automake-1.5 bug.
341 if test -f $(srcdir)/$(DOMAIN).pot; then \
342 for file in $(DOMAIN).pot stamp-po $(SMALLPOTS); do \
343 if test -f $$file; then d=.; else d=$(srcdir); fi; \
344 cp -p $$d/$$file $(distdir)/$$file || exit 1; \
349 $(MAKE) $(DOMAIN).pot-update
350 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
352 # General rule for updating PO files.
355 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
358 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
359 echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
361 if $(MSGMERGE) $(MSGMERGE_OPTIONS) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
362 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
363 rm -f $$tmpdir/$$lang.new.po; \
365 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
368 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
372 $(MAKE) $(SMALLPOFILES_FOR_lang) LL=$$lang; \
374 echo "msgmerge for $$lang.po failed!" 1>&2; \
375 rm -f $$tmpdir/$$lang.new.po; \
381 # Rules for updating small PO files in the other directories.
382 # Depend on LL being set.
384 SMALLPOFILES_FOR_lang = \
385 ../hello-c/po/$$lang.po \
386 ../hello-c-gnome/po/$$lang.po \
387 ../hello-c-gnome3/po/$$lang.po \
388 ../hello-c++/po/$$lang.po \
389 ../hello-c++-qt/po/$$lang.po \
390 ../hello-c++-kde/po/$$lang.po \
391 ../hello-c++-gnome/po/$$lang.po \
392 ../hello-c++-wxwidgets/po/$$lang.po \
393 ../hello-objc/po/$$lang.po \
394 ../hello-objc-gnustep/po/$$lang.po \
395 ../hello-objc-gnome/po/$$lang.po \
396 ../hello-sh/po/$$lang.po \
397 ../hello-python/po/$$lang.po \
398 ../hello-clisp/po/$$lang.po \
399 ../hello-librep/po/$$lang.po \
400 ../hello-guile/po/$$lang.po \
401 ../hello-smalltalk/po/$$lang.po \
402 ../hello-java/po/$$lang.po \
403 ../hello-java-awt/po/$$lang.po \
404 ../hello-java-swing/po/$$lang.po \
405 ../hello-java-qtjambi/po/$$lang.po \
406 ../hello-csharp/po/$$lang.po \
407 ../hello-csharp-forms/po/$$lang.po \
408 ../hello-gawk/po/$$lang.po \
409 ../hello-pascal/po/$$lang.po \
410 ../hello-ycp/po/$$lang.po \
411 ../hello-tcl/po/$$lang.po \
412 ../hello-tcl-tk/po/$$lang.po \
413 ../hello-perl/po/$$lang.po \
414 ../hello-php/po/$$lang.po
416 ../hello-c/po/$(LL).po: hello-c.pot $(LL).po
417 $(SHELL) mmsmallpo.sh hello-c $(LL)
419 ../hello-c-gnome/po/$(LL).po: hello-c-gnome.pot $(LL).po
420 $(SHELL) mmsmallpo.sh hello-c-gnome $(LL)
422 ../hello-c-gnome3/po/$(LL).po: hello-c-gnome3.pot $(LL).po
423 $(SHELL) mmsmallpo.sh hello-c-gnome3 $(LL)
425 ../hello-c++/po/$(LL).po: hello-c++.pot $(LL).po
426 $(SHELL) mmsmallpo.sh hello-c++ $(LL)
428 ../hello-c++-qt/po/$(LL).po: hello-c++-qt.pot $(LL).po
429 $(SHELL) mmsmallpo.sh hello-c++-qt $(LL)
431 ../hello-c++-kde/po/$(LL).po: hello-c++-kde.pot $(LL).po
432 $(SHELL) mmsmallpo.sh hello-c++-kde $(LL)
434 ../hello-c++-gnome/po/$(LL).po: hello-c++-gnome.pot $(LL).po
435 $(SHELL) mmsmallpo.sh hello-c++-gnome $(LL)
437 ../hello-c++-wxwidgets/po/$(LL).po: hello-c++-wxwidgets.pot $(LL).po
438 $(SHELL) mmsmallpo.sh hello-c++-wxwidgets $(LL)
440 ../hello-objc/po/$(LL).po: hello-objc.pot $(LL).po
441 $(SHELL) mmsmallpo.sh hello-objc $(LL)
443 ../hello-objc-gnustep/po/$(LL).po: hello-objc-gnustep.pot $(LL).po
444 $(SHELL) mmsmallpo.sh hello-objc-gnustep $(LL)
446 ../hello-objc-gnome/po/$(LL).po: hello-objc-gnome.pot $(LL).po
447 $(SHELL) mmsmallpo.sh hello-objc-gnome $(LL)
449 ../hello-sh/po/$(LL).po: hello-sh.pot $(LL).po
450 $(SHELL) mmsmallpo.sh hello-sh $(LL)
452 ../hello-python/po/$(LL).po: hello-python.pot $(LL).po
453 $(SHELL) mmsmallpo.sh hello-python $(LL)
455 ../hello-clisp/po/$(LL).po: hello-clisp.pot $(LL).po
456 $(SHELL) mmsmallpo.sh hello-clisp $(LL)
458 ../hello-librep/po/$(LL).po: hello-librep.pot $(LL).po
459 $(SHELL) mmsmallpo.sh hello-librep $(LL)
461 ../hello-guile/po/$(LL).po: hello-guile.pot $(LL).po
462 $(SHELL) mmsmallpo.sh hello-guile $(LL)
464 ../hello-smalltalk/po/$(LL).po: hello-smalltalk.pot $(LL).po
465 $(SHELL) mmsmallpo.sh hello-smalltalk $(LL)
467 ../hello-java/po/$(LL).po: hello-java.pot $(LL).po
468 $(SHELL) mmsmallpo.sh hello-java $(LL)
470 ../hello-java-awt/po/$(LL).po: hello-java-awt.pot $(LL).po
471 $(SHELL) mmsmallpo.sh hello-java-awt $(LL)
473 ../hello-java-swing/po/$(LL).po: hello-java-swing.pot $(LL).po
474 $(SHELL) mmsmallpo.sh hello-java-swing $(LL)
476 ../hello-java-qtjambi/po/$(LL).po: hello-java-qtjambi.pot $(LL).po
477 $(SHELL) mmsmallpo.sh hello-java-qtjambi $(LL)
479 ../hello-csharp/po/$(LL).po: hello-csharp.pot $(LL).po
480 $(SHELL) mmsmallpo.sh hello-csharp $(LL)
482 ../hello-csharp-forms/po/$(LL).po: hello-csharp-forms.pot $(LL).po
483 $(SHELL) mmsmallpo.sh hello-csharp-forms $(LL)
485 ../hello-gawk/po/$(LL).po: hello-gawk.pot $(LL).po
486 $(SHELL) mmsmallpo.sh hello-gawk $(LL)
488 ../hello-pascal/po/$(LL).po: hello-pascal.pot $(LL).po
489 $(SHELL) mmsmallpo.sh hello-pascal $(LL)
491 ../hello-ycp/po/$(LL).po: hello-ycp.pot $(LL).po
492 $(SHELL) mmsmallpo.sh hello-ycp $(LL)
494 ../hello-tcl/po/$(LL).po: hello-tcl.pot $(LL).po
495 $(SHELL) mmsmallpo.sh hello-tcl $(LL)
497 ../hello-tcl-tk/po/$(LL).po: hello-tcl-tk.pot $(LL).po
498 $(SHELL) mmsmallpo.sh hello-tcl-tk $(LL)
500 ../hello-perl/po/$(LL).po: hello-perl.pot $(LL).po
501 $(SHELL) mmsmallpo.sh hello-perl $(LL)
503 ../hello-php/po/$(LL).po: hello-php.pot $(LL).po
504 $(SHELL) mmsmallpo.sh hello-php $(LL)