~ubuntu-branches/ubuntu/breezy/gettext/breezy

« back to all changes in this revision

Viewing changes to gettext-tools/examples/hello-java-awt/po/Makefile.am

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2004-03-14 17:40:02 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314174002-p1ad5ldve1hqzhye
Tags: 0.14.1-2
* Added libexpat1-dev to Build-Depends, for glade support.
* Added libc0.1-dev to Build-Depends, for GNU/kFreeBSD.
* Removed special-casing of knetbsd-gnu in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Example for use of GNU gettext.
 
2
# Copyright (C) 2003-2004 Free Software Foundation, Inc.
 
3
# This file is in the public domain.
 
4
#
 
5
# Makefile configuration - processed by automake.
 
6
 
 
7
# List of files which contain translatable strings.
 
8
POTFILES = \
 
9
  Hello.java
 
10
 
 
11
# Usually the message domain is the same as the package name.
 
12
DOMAIN = $(PACKAGE)
 
13
 
 
14
# These options get passed to xgettext.
 
15
XGETTEXT_OPTIONS =
 
16
 
 
17
# This is the copyright holder that gets inserted into the header of the
 
18
# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
 
19
# package.  (Note that the msgstr strings, extracted from the package's
 
20
# sources, belong to the copyright holder of the package.)  Translators are
 
21
# expected to transfer the copyright for their translations to this person
 
22
# or entity, or to disclaim their copyright.  The empty string stands for
 
23
# the public domain; in this case the translators are expected to disclaim
 
24
# their copyright.
 
25
COPYRIGHT_HOLDER = Yoyodyne, Inc.
 
26
 
 
27
# This is the email address or URL to which the translators shall report
 
28
# bugs in the untranslated strings:
 
29
# - Strings which are not entire sentences, see the maintainer guidelines
 
30
#   in the GNU gettext documentation, section 'Preparing Strings'.
 
31
# - Strings which use unclear terms or require additional context to be
 
32
#   understood.
 
33
# - Strings which make invalid assumptions about notation of date, time or
 
34
#   money.
 
35
# - Pluralisation problems.
 
36
# - Incorrect English spelling.
 
37
# - Incorrect formatting.
 
38
# It can be your email address, or a mailing list address where translators
 
39
# can write to without being subscribed, or the URL of a web page through
 
40
# which the translators can contact you.
 
41
MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org
 
42
 
 
43
MSGMERGE = msgmerge
 
44
MSGMERGE_UPDATE = @MSGMERGE@ --update
 
45
MSGCAT = msgcat
 
46
MSGINIT = msginit
 
47
MSGCONV = msgconv
 
48
MSGFILTER = msgfilter
 
49
 
 
50
# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
 
51
POTFILES_DEPS = @POTFILES_DEPS@
 
52
 
 
53
# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po)
 
54
POFILES = @POFILES@
 
55
# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update)
 
56
UPDATEPOFILES = @UPDATEPOFILES@
 
57
# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop)
 
58
DUMMYPOFILES = @DUMMYPOFILES@
 
59
# This is computed as $(foreach lang, $(LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
 
60
PROPERTIESFILES = @PROPERTIESFILES@
 
61
# This is computed as $(foreach lang, $(LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
 
62
CLASSFILES = @CLASSFILES@
 
63
 
 
64
# This is computed as
 
65
# $(foreach lang, user-specified subset of $(LINGUAS), $(DOMAIN)_$(lang).properties)
 
66
CATALOGS = @JAVACATALOGS@
 
67
 
 
68
SUFFIXES = .po .sed .sin .nop .po-create .po-update
 
69
 
 
70
.sin.sed:
 
71
        sed -e '/^#/d' $< > t-$@
 
72
        mv t-$@ $@
 
73
 
 
74
 
 
75
all-local: stamp-po
 
76
 
 
77
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
 
78
# been loosely updated. Its purpose is that when a developer or translator
 
79
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
 
80
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
 
81
# invocations of "make" will do nothing. This timestamp would not be necessary
 
82
# if updating the $(CATALOGS) would always touch them; however, the rule for
 
83
# $(POFILES) has been designed to not touch files that don't need to be
 
84
# changed.
 
85
stamp-po: $(srcdir)/$(DOMAIN).pot
 
86
        $(MAKE) update-properties
 
87
        @echo "touch stamp-po"
 
88
        @echo timestamp > stamp-poT
 
89
        @mv stamp-poT stamp-po
 
90
 
 
91
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
 
92
# otherwise packages like GCC can not be built if only parts of the source
 
93
# have been downloaded.
 
94
 
 
95
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
 
96
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
 
97
$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed
 
98
        $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
 
99
          --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
 
100
          --copyright-holder='$(COPYRIGHT_HOLDER)' \
 
101
          --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \
 
102
          $(POTFILES)
 
103
        test ! -f $(DOMAIN).po || { \
 
104
          if test -f $(srcdir)/$(DOMAIN).pot; then \
 
105
            sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
 
106
            sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
 
107
            if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
 
108
              rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
 
109
            else \
 
110
              rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
 
111
              mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
 
112
            fi; \
 
113
          else \
 
114
            mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
 
115
          fi; \
 
116
        }
 
117
 
 
118
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
 
119
# every "make" invocation, only create it when it is missing.
 
120
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
 
121
$(srcdir)/$(DOMAIN).pot:
 
122
        $(MAKE) $(DOMAIN).pot-update
 
123
 
 
124
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
 
125
# Note that a PO file is not touched if it doesn't need to be changed.
 
126
$(POFILES): $(srcdir)/$(DOMAIN).pot
 
127
        @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
 
128
        if test -f "$(srcdir)/$${lang}.po"; then \
 
129
          test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
130
          echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
 
131
          cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
 
132
        else \
 
133
          $(MAKE) $${lang}.po-create; \
 
134
        fi
 
135
 
 
136
 
 
137
html ID:
 
138
 
 
139
MOSTLYCLEANFILES =
 
140
MOSTLYCLEANFILES += remove-potcdate.sed
 
141
MOSTLYCLEANFILES += stamp-poT
 
142
MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
 
143
 
 
144
MAINTAINERCLEANFILES = stamp-po
 
145
 
 
146
EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES)
 
147
 
 
148
# Hidden from automake, but really activated. Works around an automake-1.5 bug.
 
149
#distdir: distdir1
 
150
distdir1:
 
151
        $(MAKE) update-po
 
152
 
 
153
update-po: Makefile
 
154
        $(MAKE) $(DOMAIN).pot-update
 
155
        test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
 
156
        $(MAKE) update-properties
 
157
 
 
158
# General rule for creating PO files.
 
159
 
 
160
.nop.po-create:
 
161
        @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
 
162
        echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
 
163
        exit 1
 
164
 
 
165
# General rule for updating PO files.
 
166
 
 
167
.nop.po-update:
 
168
        @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
 
169
        tmpdir=`pwd`; \
 
170
        echo "$$lang:"; \
 
171
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
172
        echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
 
173
        cd $(srcdir); \
 
174
        if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
 
175
          if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
 
176
            rm -f $$tmpdir/$$lang.new.po; \
 
177
          else \
 
178
            if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
 
179
              :; \
 
180
            else \
 
181
              echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
 
182
              exit 1; \
 
183
            fi; \
 
184
          fi; \
 
185
        else \
 
186
          echo "msgmerge for $$lang.po failed!" 1>&2; \
 
187
          rm -f $$tmpdir/$$lang.new.po; \
 
188
        fi
 
189
 
 
190
$(DUMMYPOFILES):
 
191
 
 
192
update-properties: Makefile $(DOMAIN).pot $(POFILES)
 
193
        @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
 
194
        $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
 
195
        @for f in $(POFILES); do \
 
196
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
 
197
          echo "$(GMSGFMT) -c --statistics -o /dev/null $(srcdir)/$${lang}.po"; \
 
198
          $(GMSGFMT) -c --statistics -o /dev/null $(srcdir)/$${lang}.po || exit 1; \
 
199
          echo "$(MSGCAT) --properties-output -o $(top_srcdir)/$(DOMAIN)_$$lang.properties $(srcdir)/$${lang}.po"; \
 
200
          $(MSGCAT) --properties-output -o $(top_srcdir)/$(DOMAIN)_$$lang.properties.tmp $(srcdir)/$${lang}.po || exit 1; \
 
201
          mv $(top_srcdir)/$(DOMAIN)_$$lang.properties.tmp $(top_srcdir)/$(DOMAIN)_$$lang.properties || exit 1; \
 
202
        done
 
203
 
 
204
# Alternatively, we could create classes instead of properties files.
 
205
update-classes: Makefile $(DOMAIN).pot $(POFILES)
 
206
        @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
 
207
        $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
 
208
        @for f in $(POFILES); do \
 
209
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
 
210
          echo "$(GMSGFMT) -c --statistics -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \
 
211
          $(GMSGFMT) -c --statistics -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po || exit 1; \
 
212
        done
 
213
 
 
214
echo-catalogs:
 
215
        @echo $(CATALOGS)