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 \
26 hello-c++-qt/hello.cc \
27 hello-c++-kde/hello.cc \
28 hello-c++-kde/hellowindow.h \
29 hello-c++-kde/hellowindow.cc \
30 hello-c++-gnome/hello.cc \
31 hello-c++-wxwidgets/hello.cc \
33 hello-objc-gnustep/main.m \
34 hello-objc-gnustep/AppController.h \
35 hello-objc-gnustep/AppController.m \
36 hello-objc-gnustep/Hello.h \
37 hello-objc-gnustep/Hello.m \
38 hello-objc-gnome/hello.m \
40 hello-python/hello.py.in \
41 hello-clisp/hello.lisp.in \
42 hello-librep/hello.jl.in \
43 hello-guile/hello.scm \
44 hello-smalltalk/hello.st.in \
45 hello-java/Hello.java \
46 hello-java-awt/Hello.java \
47 hello-java-swing/Hello.java \
48 hello-java-qtjambi/Hello.java \
49 hello-csharp/hello.cs \
50 hello-csharp-forms/hello.cs \
51 hello-gawk/hello.awk \
52 hello-pascal/hello.pas \
55 hello-tcl-tk/hello.tcl \
56 hello-perl/hello-1.pl.in \
57 hello-perl/hello-2.pl.in \
60 # List of small POT files.
68 hello-c++-wxwidgets.pot \
70 hello-objc-gnustep.pot \
71 hello-objc-gnome.pot \
80 hello-java-swing.pot \
81 hello-java-qtjambi.pot \
83 hello-csharp-forms.pot \
92 # This is a synthetic domain name.
93 DOMAIN = gettext-examples
95 # This is the copyright holder that gets inserted into the header of the
96 # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
97 # package. (Note that the msgstr strings, extracted from the package's
98 # sources, belong to the copyright holder of the package.) Translators are
99 # expected to transfer the copyright for their translations to this person
100 # or entity, or to disclaim their copyright. The empty string stands for
101 # the public domain; in this case the translators are expected to disclaim
103 COPYRIGHT_HOLDER = Yoyodyne, Inc.
105 # This is the email address or URL to which the translators shall report
106 # bugs in the untranslated strings:
107 # - Strings which are not entire sentences, see the maintainer guidelines
108 # in the GNU gettext documentation, section 'Preparing Strings'.
109 # - Strings which use unclear terms or require additional context to be
111 # - Strings which make invalid assumptions about notation of date, time or
113 # - Pluralisation problems.
114 # - Incorrect English spelling.
115 # - Incorrect formatting.
116 # It can be your email address, or a mailing list address where translators
117 # can write to without being subscribed, or the URL of a web page through
118 # which the translators can contact you.
119 MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org
121 # This is the list of locale categories, beyond LC_MESSAGES, for which the
122 # message catalogs shall be used. It is usually empty.
123 EXTRA_LOCALE_CATEGORIES =
125 # These options get passed to msgmerge.
126 # Useful options are in particular:
127 # --previous to keep previous msgids of translated messages,
128 # --quiet to reduce the verbosity.
129 MSGMERGE_OPTIONS = --quiet
132 MSGMERGE_UPDATE = @MSGMERGE@ --update
135 MSGFILTER = msgfilter
137 # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
138 POTFILES_DEPS = @POTFILES_DEPS@
140 # This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po)
142 # This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update)
143 UPDATEPOFILES = @UPDATEPOFILES@
144 # This is computed as $(foreach lang, $(LINGUAS), $(lang).nop)
145 DUMMYPOFILES = @DUMMYPOFILES@
147 SUFFIXES = .po .sed .sin .nop .po-update
150 sed -e '/^#/d' $< > t-$@
154 all-local: all-local-@USE_NLS@
156 all-local-yes: stamp-po
159 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
160 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
161 # we don't want to bother translators with empty POT files). We assume that
162 # LINGUAS is empty in this case, i.e. $(POFILES) is empty. In this case,
163 # stamp-po is a nop (i.e. a phony target).
165 # stamp-po is a timestamp denoting the last time at which the CATALOGS have
166 # been loosely updated. Its purpose is that when a developer or translator
167 # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
168 # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
169 # invocations of "make" will do nothing. This timestamp would not be necessary
170 # if updating the $(CATALOGS) would always touch them; however, the rule for
171 # $(POFILES) has been designed to not touch files that don't need to be
173 stamp-po: $(srcdir)/$(DOMAIN).pot
174 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
175 echo "touch stamp-po" && \
176 echo timestamp > stamp-poT && \
177 mv stamp-poT stamp-po; \
180 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
181 # otherwise packages like GCC can not be built if only parts of the source
182 # have been downloaded.
184 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
185 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
186 $(DOMAIN).pot-update: $(POTFILES_DEPS) $(SMALLPOTS) remove-potcdate.sed
187 if test -n '$(MSGID_BUGS_ADDRESS)'; then \
188 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
190 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
192 $(XGETTEXT) --default-domain=$(DOMAIN) \
193 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
194 --copyright-holder='$(COPYRIGHT_HOLDER)' \
195 --msgid-bugs-address="$$msgid_bugs_address" \
197 test ! -f $(DOMAIN).po || { \
198 if test -f $(srcdir)/$(DOMAIN).pot; then \
199 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
200 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
201 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
202 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
204 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
205 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
208 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
213 hello-c.pot : $(POTFILES_DEPS)
214 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c
216 hello-c-gnome.pot : $(POTFILES_DEPS)
217 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c-gnome
219 hello-c++.pot : $(POTFILES_DEPS)
220 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++
222 hello-c++-qt.pot : $(POTFILES_DEPS)
223 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-qt
225 hello-c++-kde.pot : $(POTFILES_DEPS)
226 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-kde
228 hello-c++-gnome.pot : $(POTFILES_DEPS)
229 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-gnome
231 hello-c++-wxwidgets.pot : $(POTFILES_DEPS)
232 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-wxwidgets
234 hello-objc.pot : $(POTFILES_DEPS)
235 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc
237 hello-objc-gnustep.pot : $(POTFILES_DEPS)
238 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc-gnustep
240 hello-objc-gnome.pot : $(POTFILES_DEPS)
241 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc-gnome
243 hello-sh.pot : $(POTFILES_DEPS)
244 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-sh
246 hello-python.pot : $(POTFILES_DEPS)
247 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-python
249 hello-clisp.pot : $(POTFILES_DEPS)
250 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-clisp
252 hello-librep.pot : $(POTFILES_DEPS)
253 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-librep
255 hello-guile.pot : $(POTFILES_DEPS)
256 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-guile
258 hello-smalltalk.pot : $(POTFILES_DEPS)
259 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-smalltalk
261 hello-java.pot : $(POTFILES_DEPS)
262 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java
264 hello-java-awt.pot : $(POTFILES_DEPS)
265 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-awt
267 hello-java-swing.pot : $(POTFILES_DEPS)
268 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-swing
270 hello-java-qtjambi.pot : $(POTFILES_DEPS)
271 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-qtjambi
273 hello-csharp.pot : $(POTFILES_DEPS)
274 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-csharp
276 hello-csharp-forms.pot : $(POTFILES_DEPS)
277 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-csharp-forms
279 hello-gawk.pot : $(POTFILES_DEPS)
280 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-gawk
282 hello-pascal.pot : $(POTFILES_DEPS)
283 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-pascal
285 hello-ycp.pot : $(POTFILES_DEPS)
286 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-ycp
288 hello-tcl.pot : $(POTFILES_DEPS)
289 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-tcl
291 hello-tcl-tk.pot : $(POTFILES_DEPS)
292 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-tcl-tk
294 hello-perl.pot : $(POTFILES_DEPS)
295 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-perl
297 hello-php.pot : $(POTFILES_DEPS)
298 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-php
301 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
302 # every "make" invocation, only create it when it is missing.
303 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
304 $(srcdir)/$(DOMAIN).pot:
305 $(MAKE) $(DOMAIN).pot-update
307 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
308 # Note that a PO file is not touched if it doesn't need to be changed.
309 $(POFILES): $(srcdir)/$(DOMAIN).pot
310 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
311 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
312 echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot"; \
313 cd $(srcdir) && $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot
319 MOSTLYCLEANFILES += remove-potcdate.sed
320 MOSTLYCLEANFILES += stamp-poT
321 MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
322 MOSTLYCLEANFILES += *.o
324 DISTCLEANFILES = $(SMALLPOTS)
326 MAINTAINERCLEANFILES = stamp-po
328 EXTRA_DIST = remove-potcdate.sin xsmallpot.sh mmsmallpo.sh LINGUAS \
331 # Hidden from automake, but really activated. Works around an automake-1.5 bug.
335 if test -f $(srcdir)/$(DOMAIN).pot; then \
336 for file in $(DOMAIN).pot stamp-po; do \
337 if test -f $$file; then d=.; else d=$(srcdir); fi; \
338 cp -p $$d/$$file $(distdir)/$$file || exit 1; \
343 $(MAKE) $(DOMAIN).pot-update
344 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
346 # General rule for updating PO files.
349 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
352 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
353 echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
355 if $(MSGMERGE) $(MSGMERGE_OPTIONS) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
356 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
357 rm -f $$tmpdir/$$lang.new.po; \
359 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
362 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
366 $(MAKE) $(SMALLPOFILES_FOR_lang) LL=$$lang; \
368 echo "msgmerge for $$lang.po failed!" 1>&2; \
369 rm -f $$tmpdir/$$lang.new.po; \
375 # Rules for updating small PO files in the other directories.
376 # Depend on LL being set.
378 SMALLPOFILES_FOR_lang = \
379 ../hello-c/po/$$lang.po \
380 ../hello-c-gnome/po/$$lang.po \
381 ../hello-c++/po/$$lang.po \
382 ../hello-c++-qt/po/$$lang.po \
383 ../hello-c++-kde/po/$$lang.po \
384 ../hello-c++-gnome/po/$$lang.po \
385 ../hello-c++-wxwidgets/po/$$lang.po \
386 ../hello-objc/po/$$lang.po \
387 ../hello-objc-gnustep/po/$$lang.po \
388 ../hello-objc-gnome/po/$$lang.po \
389 ../hello-sh/po/$$lang.po \
390 ../hello-python/po/$$lang.po \
391 ../hello-clisp/po/$$lang.po \
392 ../hello-librep/po/$$lang.po \
393 ../hello-guile/po/$$lang.po \
394 ../hello-smalltalk/po/$$lang.po \
395 ../hello-java/po/$$lang.po \
396 ../hello-java-awt/po/$$lang.po \
397 ../hello-java-swing/po/$$lang.po \
398 ../hello-java-qtjambi/po/$$lang.po \
399 ../hello-csharp/po/$$lang.po \
400 ../hello-csharp-forms/po/$$lang.po \
401 ../hello-gawk/po/$$lang.po \
402 ../hello-pascal/po/$$lang.po \
403 ../hello-ycp/po/$$lang.po \
404 ../hello-tcl/po/$$lang.po \
405 ../hello-tcl-tk/po/$$lang.po \
406 ../hello-perl/po/$$lang.po \
407 ../hello-php/po/$$lang.po
409 ../hello-c/po/$(LL).po: hello-c.pot $(LL).po
410 $(SHELL) mmsmallpo.sh hello-c $(LL)
412 ../hello-c-gnome/po/$(LL).po: hello-c-gnome.pot $(LL).po
413 $(SHELL) mmsmallpo.sh hello-c-gnome $(LL)
415 ../hello-c++/po/$(LL).po: hello-c++.pot $(LL).po
416 $(SHELL) mmsmallpo.sh hello-c++ $(LL)
418 ../hello-c++-qt/po/$(LL).po: hello-c++-qt.pot $(LL).po
419 $(SHELL) mmsmallpo.sh hello-c++-qt $(LL)
421 ../hello-c++-kde/po/$(LL).po: hello-c++-kde.pot $(LL).po
422 $(SHELL) mmsmallpo.sh hello-c++-kde $(LL)
424 ../hello-c++-gnome/po/$(LL).po: hello-c++-gnome.pot $(LL).po
425 $(SHELL) mmsmallpo.sh hello-c++-gnome $(LL)
427 ../hello-c++-wxwidgets/po/$(LL).po: hello-c++-wxwidgets.pot $(LL).po
428 $(SHELL) mmsmallpo.sh hello-c++-wxwidgets $(LL)
430 ../hello-objc/po/$(LL).po: hello-objc.pot $(LL).po
431 $(SHELL) mmsmallpo.sh hello-objc $(LL)
433 ../hello-objc-gnustep/po/$(LL).po: hello-objc-gnustep.pot $(LL).po
434 $(SHELL) mmsmallpo.sh hello-objc-gnustep $(LL)
436 ../hello-objc-gnome/po/$(LL).po: hello-objc-gnome.pot $(LL).po
437 $(SHELL) mmsmallpo.sh hello-objc-gnome $(LL)
439 ../hello-sh/po/$(LL).po: hello-sh.pot $(LL).po
440 $(SHELL) mmsmallpo.sh hello-sh $(LL)
442 ../hello-python/po/$(LL).po: hello-python.pot $(LL).po
443 $(SHELL) mmsmallpo.sh hello-python $(LL)
445 ../hello-clisp/po/$(LL).po: hello-clisp.pot $(LL).po
446 $(SHELL) mmsmallpo.sh hello-clisp $(LL)
448 ../hello-librep/po/$(LL).po: hello-librep.pot $(LL).po
449 $(SHELL) mmsmallpo.sh hello-librep $(LL)
451 ../hello-guile/po/$(LL).po: hello-guile.pot $(LL).po
452 $(SHELL) mmsmallpo.sh hello-guile $(LL)
454 ../hello-smalltalk/po/$(LL).po: hello-smalltalk.pot $(LL).po
455 $(SHELL) mmsmallpo.sh hello-smalltalk $(LL)
457 ../hello-java/po/$(LL).po: hello-java.pot $(LL).po
458 $(SHELL) mmsmallpo.sh hello-java $(LL)
460 ../hello-java-awt/po/$(LL).po: hello-java-awt.pot $(LL).po
461 $(SHELL) mmsmallpo.sh hello-java-awt $(LL)
463 ../hello-java-swing/po/$(LL).po: hello-java-swing.pot $(LL).po
464 $(SHELL) mmsmallpo.sh hello-java-swing $(LL)
466 ../hello-java-qtjambi/po/$(LL).po: hello-java-qtjambi.pot $(LL).po
467 $(SHELL) mmsmallpo.sh hello-java-qtjambi $(LL)
469 ../hello-csharp/po/$(LL).po: hello-csharp.pot $(LL).po
470 $(SHELL) mmsmallpo.sh hello-csharp $(LL)
472 ../hello-csharp-forms/po/$(LL).po: hello-csharp-forms.pot $(LL).po
473 $(SHELL) mmsmallpo.sh hello-csharp-forms $(LL)
475 ../hello-gawk/po/$(LL).po: hello-gawk.pot $(LL).po
476 $(SHELL) mmsmallpo.sh hello-gawk $(LL)
478 ../hello-pascal/po/$(LL).po: hello-pascal.pot $(LL).po
479 $(SHELL) mmsmallpo.sh hello-pascal $(LL)
481 ../hello-ycp/po/$(LL).po: hello-ycp.pot $(LL).po
482 $(SHELL) mmsmallpo.sh hello-ycp $(LL)
484 ../hello-tcl/po/$(LL).po: hello-tcl.pot $(LL).po
485 $(SHELL) mmsmallpo.sh hello-tcl $(LL)
487 ../hello-tcl-tk/po/$(LL).po: hello-tcl-tk.pot $(LL).po
488 $(SHELL) mmsmallpo.sh hello-tcl-tk $(LL)
490 ../hello-perl/po/$(LL).po: hello-perl.pot $(LL).po
491 $(SHELL) mmsmallpo.sh hello-perl $(LL)
493 ../hello-php/po/$(LL).po: hello-php.pot $(LL).po
494 $(SHELL) mmsmallpo.sh hello-php $(LL)