1 ## Makefile for the gettext-tools/examples/po subdirectory of GNU gettext
2 ## Copyright (C) 1995-1998, 2000-2005 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 2, or (at your option)
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, write to the Free Software
16 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 ## Process this file with automake to produce Makefile.in.
20 AUTOMAKE_OPTIONS = 1.5 gnits
22 # List of files which contain translatable strings.
24 examples/hello-c/hello.c \
25 examples/hello-c-gnome/hello.c \
26 examples/hello-c++/hello.cc \
27 examples/hello-c++-qt/hello.cc \
28 examples/hello-c++-kde/hello.cc \
29 examples/hello-c++-kde/hellowindow.h \
30 examples/hello-c++-kde/hellowindow.cc \
31 examples/hello-c++-gnome/hello.cc \
32 examples/hello-objc/hello.m \
33 examples/hello-objc-gnustep/main.m \
34 examples/hello-objc-gnustep/AppController.h \
35 examples/hello-objc-gnustep/AppController.m \
36 examples/hello-objc-gnustep/Hello.h \
37 examples/hello-objc-gnustep/Hello.m \
38 examples/hello-objc-gnome/hello.m \
39 examples/hello-sh/hello.sh \
40 examples/hello-python/hello.py.in \
41 examples/hello-clisp/hello.lisp.in \
42 examples/hello-librep/hello.jl.in \
43 examples/hello-guile/hello.scm \
44 examples/hello-smalltalk/hello.st.in \
45 examples/hello-java/Hello.java \
46 examples/hello-java-awt/Hello.java \
47 examples/hello-java-swing/Hello.java \
48 examples/hello-csharp/hello.cs \
49 examples/hello-csharp-forms/hello.cs \
50 examples/hello-gawk/hello.awk \
51 examples/hello-pascal/hello.pas \
52 examples/hello-ycp/hello.ycp \
53 examples/hello-tcl/hello.tcl \
54 examples/hello-tcl-tk/hello.tcl \
55 examples/hello-perl/hello-1.pl.in \
56 examples/hello-perl/hello-2.pl.in \
57 examples/hello-php/hello.php
59 # List of small POT files.
68 hello-objc-gnustep.pot \
69 hello-objc-gnome.pot \
78 hello-java-swing.pot \
80 hello-csharp-forms.pot \
89 # This is a synthetic domain name.
90 DOMAIN = gettext-examples
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 = Yoyodyne, 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.
116 MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org
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 =
122 localedir = $(datadir)/locale
125 MSGMERGE_UPDATE = @MSGMERGE@ --update
128 MSGFILTER = msgfilter
130 # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
131 POTFILES_DEPS = @POTFILES_DEPS@
133 # This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po)
135 # This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update)
136 UPDATEPOFILES = @UPDATEPOFILES@
137 # This is computed as $(foreach lang, $(LINGUAS), $(lang).nop)
138 DUMMYPOFILES = @DUMMYPOFILES@
140 SUFFIXES = .po .sed .sin .nop .po-update
143 sed -e '/^#/d' $< > t-$@
147 all-local: all-local-@USE_NLS@
149 all-local-yes: stamp-po
152 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
153 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
154 # we don't want to bother translators with empty POT files). We assume that
155 # LINGUAS is empty in this case, i.e. $(POFILES) is empty. In this case,
156 # stamp-po is a nop (i.e. a phony target).
158 # stamp-po is a timestamp denoting the last time at which the CATALOGS have
159 # been loosely updated. Its purpose is that when a developer or translator
160 # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
161 # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
162 # invocations of "make" will do nothing. This timestamp would not be necessary
163 # if updating the $(CATALOGS) would always touch them; however, the rule for
164 # $(POFILES) has been designed to not touch files that don't need to be
166 stamp-po: $(srcdir)/$(DOMAIN).pot
167 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
168 echo "touch stamp-po" && \
169 echo timestamp > stamp-poT && \
170 mv stamp-poT stamp-po; \
173 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
174 # otherwise packages like GCC can not be built if only parts of the source
175 # have been downloaded.
177 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
178 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
179 $(DOMAIN).pot-update: $(POTFILES_DEPS) $(SMALLPOTS) remove-potcdate.sed
180 if test -n '$(MSGID_BUGS_ADDRESS)'; then \
181 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
183 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
185 $(XGETTEXT) --default-domain=$(DOMAIN) \
186 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
187 --copyright-holder='$(COPYRIGHT_HOLDER)' \
188 --msgid-bugs-address="$$msgid_bugs_address" \
190 test ! -f $(DOMAIN).po || { \
191 if test -f $(srcdir)/$(DOMAIN).pot; then \
192 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
193 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
194 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
195 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
197 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
198 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
201 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
206 hello-c.pot : $(POTFILES_DEPS)
207 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c
209 hello-c-gnome.pot : $(POTFILES_DEPS)
210 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c-gnome
212 hello-c++.pot : $(POTFILES_DEPS)
213 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++
215 hello-c++-qt.pot : $(POTFILES_DEPS)
216 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-qt
218 hello-c++-kde.pot : $(POTFILES_DEPS)
219 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-kde
221 hello-c++-gnome.pot : $(POTFILES_DEPS)
222 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-gnome
224 hello-objc.pot : $(POTFILES_DEPS)
225 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc
227 hello-objc-gnustep.pot : $(POTFILES_DEPS)
228 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc-gnustep
230 hello-objc-gnome.pot : $(POTFILES_DEPS)
231 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc-gnome
233 hello-sh.pot : $(POTFILES_DEPS)
234 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-sh
236 hello-python.pot : $(POTFILES_DEPS)
237 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-python
239 hello-clisp.pot : $(POTFILES_DEPS)
240 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-clisp
242 hello-librep.pot : $(POTFILES_DEPS)
243 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-librep
245 hello-guile.pot : $(POTFILES_DEPS)
246 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-guile
248 hello-smalltalk.pot : $(POTFILES_DEPS)
249 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-smalltalk
251 hello-java.pot : $(POTFILES_DEPS)
252 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java
254 hello-java-awt.pot : $(POTFILES_DEPS)
255 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-awt
257 hello-java-swing.pot : $(POTFILES_DEPS)
258 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-swing
260 hello-csharp.pot : $(POTFILES_DEPS)
261 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-csharp
263 hello-csharp-forms.pot : $(POTFILES_DEPS)
264 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-csharp-forms
266 hello-gawk.pot : $(POTFILES_DEPS)
267 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-gawk
269 hello-pascal.pot : $(POTFILES_DEPS)
270 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-pascal
272 hello-ycp.pot : $(POTFILES_DEPS)
273 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-ycp
275 hello-tcl.pot : $(POTFILES_DEPS)
276 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-tcl
278 hello-tcl-tk.pot : $(POTFILES_DEPS)
279 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-tcl-tk
281 hello-perl.pot : $(POTFILES_DEPS)
282 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-perl
284 hello-php.pot : $(POTFILES_DEPS)
285 $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-php
288 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
289 # every "make" invocation, only create it when it is missing.
290 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
291 $(srcdir)/$(DOMAIN).pot:
292 $(MAKE) $(DOMAIN).pot-update
294 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
295 # Note that a PO file is not touched if it doesn't need to be changed.
296 $(POFILES): $(srcdir)/$(DOMAIN).pot
297 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
298 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
299 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
300 cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
306 MOSTLYCLEANFILES += remove-potcdate.sed
307 MOSTLYCLEANFILES += stamp-poT
308 MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
309 MOSTLYCLEANFILES += *.o
311 DISTCLEANFILES = $(SMALLPOTS)
313 MAINTAINERCLEANFILES = stamp-po
315 EXTRA_DIST = remove-potcdate.sin xsmallpot.sh mmsmallpo.sh LINGUAS \
318 # Hidden from automake, but really activated. Works around an automake-1.5 bug.
322 if test -f $(srcdir)/$(DOMAIN).pot; then \
323 for file in $(DOMAIN).pot stamp-po; do \
324 if test -f $$file; then d=.; else d=$(srcdir); fi; \
325 cp -p $$d/$$file $(distdir)/$$file || exit 1; \
330 $(MAKE) $(DOMAIN).pot-update
331 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
333 # General rule for updating PO files.
336 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
339 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
340 echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
342 if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
343 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
344 rm -f $$tmpdir/$$lang.new.po; \
346 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
349 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
353 $(MAKE) $(SMALLPOFILES_FOR_lang) LL=$$lang; \
355 echo "msgmerge for $$lang.po failed!" 1>&2; \
356 rm -f $$tmpdir/$$lang.new.po; \
362 # Rules for updating small PO files in the other directories.
363 # Depend on LL being set.
365 SMALLPOFILES_FOR_lang = \
366 ../hello-c/po/$$lang.po \
367 ../hello-c-gnome/po/$$lang.po \
368 ../hello-c++/po/$$lang.po \
369 ../hello-c++-qt/po/$$lang.po \
370 ../hello-c++-kde/po/$$lang.po \
371 ../hello-c++-gnome/po/$$lang.po \
372 ../hello-objc/po/$$lang.po \
373 ../hello-objc-gnustep/po/$$lang.po \
374 ../hello-objc-gnome/po/$$lang.po \
375 ../hello-sh/po/$$lang.po \
376 ../hello-python/po/$$lang.po \
377 ../hello-clisp/po/$$lang.po \
378 ../hello-librep/po/$$lang.po \
379 ../hello-guile/po/$$lang.po \
380 ../hello-smalltalk/po/$$lang.po \
381 ../hello-java/po/$$lang.po \
382 ../hello-java-awt/po/$$lang.po \
383 ../hello-java-swing/po/$$lang.po \
384 ../hello-csharp/po/$$lang.po \
385 ../hello-csharp-forms/po/$$lang.po \
386 ../hello-gawk/po/$$lang.po \
387 ../hello-pascal/po/$$lang.po \
388 ../hello-ycp/po/$$lang.po \
389 ../hello-tcl/po/$$lang.po \
390 ../hello-tcl-tk/po/$$lang.po \
391 ../hello-perl/po/$$lang.po \
392 ../hello-php/po/$$lang.po
394 ../hello-c/po/$(LL).po: hello-c.pot $(LL).po
395 $(SHELL) mmsmallpo.sh hello-c $(LL)
397 ../hello-c-gnome/po/$(LL).po: hello-c-gnome.pot $(LL).po
398 $(SHELL) mmsmallpo.sh hello-c-gnome $(LL)
400 ../hello-c++/po/$(LL).po: hello-c++.pot $(LL).po
401 $(SHELL) mmsmallpo.sh hello-c++ $(LL)
403 ../hello-c++-qt/po/$(LL).po: hello-c++-qt.pot $(LL).po
404 $(SHELL) mmsmallpo.sh hello-c++-qt $(LL)
406 ../hello-c++-kde/po/$(LL).po: hello-c++-kde.pot $(LL).po
407 $(SHELL) mmsmallpo.sh hello-c++-kde $(LL)
409 ../hello-c++-gnome/po/$(LL).po: hello-c++-gnome.pot $(LL).po
410 $(SHELL) mmsmallpo.sh hello-c++-gnome $(LL)
412 ../hello-objc/po/$(LL).po: hello-objc.pot $(LL).po
413 $(SHELL) mmsmallpo.sh hello-objc $(LL)
415 ../hello-objc-gnustep/po/$(LL).po: hello-objc-gnustep.pot $(LL).po
416 $(SHELL) mmsmallpo.sh hello-objc-gnustep $(LL)
418 ../hello-objc-gnome/po/$(LL).po: hello-objc-gnome.pot $(LL).po
419 $(SHELL) mmsmallpo.sh hello-objc-gnome $(LL)
421 ../hello-sh/po/$(LL).po: hello-sh.pot $(LL).po
422 $(SHELL) mmsmallpo.sh hello-sh $(LL)
424 ../hello-python/po/$(LL).po: hello-python.pot $(LL).po
425 $(SHELL) mmsmallpo.sh hello-python $(LL)
427 ../hello-clisp/po/$(LL).po: hello-clisp.pot $(LL).po
428 $(SHELL) mmsmallpo.sh hello-clisp $(LL)
430 ../hello-librep/po/$(LL).po: hello-librep.pot $(LL).po
431 $(SHELL) mmsmallpo.sh hello-librep $(LL)
433 ../hello-guile/po/$(LL).po: hello-guile.pot $(LL).po
434 $(SHELL) mmsmallpo.sh hello-guile $(LL)
436 ../hello-smalltalk/po/$(LL).po: hello-smalltalk.pot $(LL).po
437 $(SHELL) mmsmallpo.sh hello-smalltalk $(LL)
439 ../hello-java/po/$(LL).po: hello-java.pot $(LL).po
440 $(SHELL) mmsmallpo.sh hello-java $(LL)
442 ../hello-java-awt/po/$(LL).po: hello-java-awt.pot $(LL).po
443 $(SHELL) mmsmallpo.sh hello-java-awt $(LL)
445 ../hello-java-swing/po/$(LL).po: hello-java-swing.pot $(LL).po
446 $(SHELL) mmsmallpo.sh hello-java-swing $(LL)
448 ../hello-csharp/po/$(LL).po: hello-csharp.pot $(LL).po
449 $(SHELL) mmsmallpo.sh hello-csharp $(LL)
451 ../hello-csharp-forms/po/$(LL).po: hello-csharp-forms.pot $(LL).po
452 $(SHELL) mmsmallpo.sh hello-csharp-forms $(LL)
454 ../hello-gawk/po/$(LL).po: hello-gawk.pot $(LL).po
455 $(SHELL) mmsmallpo.sh hello-gawk $(LL)
457 ../hello-pascal/po/$(LL).po: hello-pascal.pot $(LL).po
458 $(SHELL) mmsmallpo.sh hello-pascal $(LL)
460 ../hello-ycp/po/$(LL).po: hello-ycp.pot $(LL).po
461 $(SHELL) mmsmallpo.sh hello-ycp $(LL)
463 ../hello-tcl/po/$(LL).po: hello-tcl.pot $(LL).po
464 $(SHELL) mmsmallpo.sh hello-tcl $(LL)
466 ../hello-tcl-tk/po/$(LL).po: hello-tcl-tk.pot $(LL).po
467 $(SHELL) mmsmallpo.sh hello-tcl-tk $(LL)
469 ../hello-perl/po/$(LL).po: hello-perl.pot $(LL).po
470 $(SHELL) mmsmallpo.sh hello-perl $(LL)
472 ../hello-php/po/$(LL).po: hello-php.pot $(LL).po
473 $(SHELL) mmsmallpo.sh hello-php $(LL)