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

« back to all changes in this revision

Viewing changes to gettext-tools/examples/hello-python/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.py.in
 
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
# This is the list of locale categories, beyond LC_MESSAGES, for which the
 
44
# message catalogs shall be used.  It is usually empty.
 
45
EXTRA_LOCALE_CATEGORIES =
 
46
 
 
47
localedir = $(datadir)/locale
 
48
 
 
49
MSGMERGE = msgmerge
 
50
MSGMERGE_UPDATE = @MSGMERGE@ --update
 
51
MSGINIT = msginit
 
52
MSGCONV = msgconv
 
53
MSGFILTER = msgfilter
 
54
 
 
55
# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
 
56
POTFILES_DEPS = @POTFILES_DEPS@
 
57
 
 
58
# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po)
 
59
POFILES = @POFILES@
 
60
# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo)
 
61
GMOFILES = @GMOFILES@
 
62
# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update)
 
63
UPDATEPOFILES = @UPDATEPOFILES@
 
64
# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop)
 
65
DUMMYPOFILES = @DUMMYPOFILES@
 
66
 
 
67
# This is computed as
 
68
# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo)
 
69
CATALOGS = @CATALOGS@
 
70
 
 
71
SUFFIXES = .po .gmo .mo .sed .sin .nop .po-create .po-update
 
72
 
 
73
.po.mo:
 
74
        @echo "$(MSGFMT) -c -o $@ $<"; \
 
75
        $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
 
76
 
 
77
.po.gmo:
 
78
        @lang=`echo $* | sed -e 's,.*/,,'`; \
 
79
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
80
        echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
 
81
        cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
 
82
 
 
83
.sin.sed:
 
84
        sed -e '/^#/d' $< > t-$@
 
85
        mv t-$@ $@
 
86
 
 
87
 
 
88
all-local: all-local-@USE_NLS@
 
89
 
 
90
all-local-yes: stamp-po
 
91
all-local-no:
 
92
 
 
93
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
 
94
# been loosely updated. Its purpose is that when a developer or translator
 
95
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
 
96
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
 
97
# invocations of "make" will do nothing. This timestamp would not be necessary
 
98
# if updating the $(CATALOGS) would always touch them; however, the rule for
 
99
# $(POFILES) has been designed to not touch files that don't need to be
 
100
# changed.
 
101
stamp-po: $(srcdir)/$(DOMAIN).pot
 
102
        test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
 
103
        @echo "touch stamp-po"
 
104
        @echo timestamp > stamp-poT
 
105
        @mv stamp-poT stamp-po
 
106
 
 
107
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
 
108
# otherwise packages like GCC can not be built if only parts of the source
 
109
# have been downloaded.
 
110
 
 
111
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
 
112
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
 
113
$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed
 
114
        $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
 
115
          --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
 
116
          --copyright-holder='$(COPYRIGHT_HOLDER)' \
 
117
          --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \
 
118
          $(POTFILES)
 
119
        test ! -f $(DOMAIN).po || { \
 
120
          if test -f $(srcdir)/$(DOMAIN).pot; then \
 
121
            sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
 
122
            sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
 
123
            if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
 
124
              rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
 
125
            else \
 
126
              rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
 
127
              mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
 
128
            fi; \
 
129
          else \
 
130
            mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
 
131
          fi; \
 
132
        }
 
133
 
 
134
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
 
135
# every "make" invocation, only create it when it is missing.
 
136
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
 
137
$(srcdir)/$(DOMAIN).pot:
 
138
        $(MAKE) $(DOMAIN).pot-update
 
139
 
 
140
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
 
141
# Note that a PO file is not touched if it doesn't need to be changed.
 
142
$(POFILES): $(srcdir)/$(DOMAIN).pot
 
143
        @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
 
144
        if test -f "$(srcdir)/$${lang}.po"; then \
 
145
          test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
146
          echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
 
147
          cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
 
148
        else \
 
149
          $(MAKE) $${lang}.po-create; \
 
150
        fi
 
151
 
 
152
 
 
153
install-data-local: install-data-local-@USE_NLS@
 
154
install-data-local-no: all-local
 
155
install-data-local-yes: all-local
 
156
        $(mkinstalldirs) $(DESTDIR)$(datadir)
 
157
        @catalogs='$(CATALOGS)'; \
 
158
        for cat in $$catalogs; do \
 
159
          cat=`basename $$cat`; \
 
160
          lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 
161
          dir=$(localedir)/$$lang/LC_MESSAGES; \
 
162
          $(mkinstalldirs) $(DESTDIR)$$dir; \
 
163
          if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
 
164
          $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
 
165
          echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
 
166
          for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
 
167
            if test -n "$$lc"; then \
 
168
              if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
 
169
                link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
 
170
                mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
171
                mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
172
                (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
 
173
                 for file in *; do \
 
174
                   if test -f $$file; then \
 
175
                     ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
 
176
                   fi; \
 
177
                 done); \
 
178
                rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
179
              else \
 
180
                if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
 
181
                  :; \
 
182
                else \
 
183
                  rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
184
                  mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
185
                fi; \
 
186
              fi; \
 
187
              rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
 
188
              ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
 
189
              ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
 
190
              cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
 
191
              echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
 
192
            fi; \
 
193
          done; \
 
194
        done
 
195
 
 
196
installdirs-local: installdirs-local-@USE_NLS@
 
197
installdirs-local-no:
 
198
installdirs-local-yes:
 
199
        $(mkinstalldirs) $(DESTDIR)$(datadir)
 
200
        @catalogs='$(CATALOGS)'; \
 
201
        for cat in $$catalogs; do \
 
202
          cat=`basename $$cat`; \
 
203
          lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 
204
          dir=$(localedir)/$$lang/LC_MESSAGES; \
 
205
          $(mkinstalldirs) $(DESTDIR)$$dir; \
 
206
          for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
 
207
            if test -n "$$lc"; then \
 
208
              if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
 
209
                link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
 
210
                mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
211
                mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
212
                (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
 
213
                 for file in *; do \
 
214
                   if test -f $$file; then \
 
215
                     ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
 
216
                   fi; \
 
217
                 done); \
 
218
                rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
219
              else \
 
220
                if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
 
221
                  :; \
 
222
                else \
 
223
                  rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
224
                  mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
225
                fi; \
 
226
              fi; \
 
227
            fi; \
 
228
          done; \
 
229
        done
 
230
 
 
231
uninstall-local: uninstall-local-@USE_NLS@
 
232
uninstall-local-no:
 
233
uninstall-local-yes:
 
234
        catalogs='$(CATALOGS)'; \
 
235
        for cat in $$catalogs; do \
 
236
          cat=`basename $$cat`; \
 
237
          lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 
238
          for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
 
239
            rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
 
240
          done; \
 
241
        done
 
242
 
 
243
html ID:
 
244
 
 
245
MOSTLYCLEANFILES =
 
246
MOSTLYCLEANFILES += remove-potcdate.sed
 
247
MOSTLYCLEANFILES += stamp-poT
 
248
MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
 
249
MOSTLYCLEANFILES += *.o
 
250
 
 
251
DISTCLEANFILES = *.mo
 
252
 
 
253
MAINTAINERCLEANFILES = stamp-po $(GMOFILES)
 
254
 
 
255
EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES)
 
256
 
 
257
# Hidden from automake, but really activated. Works around an automake-1.5 bug.
 
258
#distdir: distdir1
 
259
distdir1:
 
260
        $(MAKE) update-po
 
261
 
 
262
update-po: Makefile
 
263
        $(MAKE) $(DOMAIN).pot-update
 
264
        test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
 
265
        $(MAKE) update-gmo
 
266
 
 
267
# General rule for creating PO files.
 
268
 
 
269
.nop.po-create:
 
270
        @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
 
271
        echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
 
272
        exit 1
 
273
 
 
274
# General rule for updating PO files.
 
275
 
 
276
.nop.po-update:
 
277
        @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
 
278
        tmpdir=`pwd`; \
 
279
        echo "$$lang:"; \
 
280
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
281
        echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
 
282
        cd $(srcdir); \
 
283
        if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
 
284
          if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
 
285
            rm -f $$tmpdir/$$lang.new.po; \
 
286
          else \
 
287
            if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
 
288
              :; \
 
289
            else \
 
290
              echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
 
291
              exit 1; \
 
292
            fi; \
 
293
          fi; \
 
294
        else \
 
295
          echo "msgmerge for $$lang.po failed!" 1>&2; \
 
296
          rm -f $$tmpdir/$$lang.new.po; \
 
297
        fi
 
298
 
 
299
$(DUMMYPOFILES):
 
300
 
 
301
update-gmo: Makefile $(GMOFILES)
 
302
        @: