~ubuntu-branches/ubuntu/maverick/uim/maverick

« back to all changes in this revision

Viewing changes to po/Makefile.in.in

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2004-06-18 19:32:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040618193234-hq78k7h4u7f4l35w
Tags: upstream-0.3.9
ImportĀ upstreamĀ versionĀ 0.3.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Makefile for PO directory in any package using GNU gettext.
 
2
# Copyright (C) 1995-1997, 2000-2003 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
 
3
#
 
4
# This file can be copied and used freely without restrictions.  It can
 
5
# be used in projects which are not available under the GNU General Public
 
6
# License but which still want to provide support for the GNU gettext
 
7
# functionality.
 
8
# Please note that the actual code of GNU gettext is covered by the GNU
 
9
# General Public License and is *not* in the public domain.
 
10
 
11
# - Modified by Intltool to use intltool instead of gettext directly.
 
12
#
 
13
# GENPOT
 
14
 
 
15
PACKAGE = @PACKAGE@
 
16
VERSION = @VERSION@
 
17
 
 
18
SHELL = /bin/sh
 
19
@SET_MAKE@
 
20
 
 
21
srcdir = @srcdir@
 
22
top_srcdir = @top_srcdir@
 
23
top_builddir = ..
 
24
VPATH = @srcdir@
 
25
 
 
26
prefix = @prefix@
 
27
exec_prefix = @exec_prefix@
 
28
datadir = @datadir@
 
29
localedir = $(datadir)/locale
 
30
gettextsrcdir = $(datadir)/gettext/po
 
31
 
 
32
INSTALL = @INSTALL@
 
33
INSTALL_DATA = @INSTALL_DATA@
 
34
MKINSTALLDIRS = @MKINSTALLDIRS@
 
35
mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
 
36
 
 
37
DOMAIN = $(GETTEXT_PACKAGE)
 
38
GMSGFMT = @GMSGFMT@
 
39
MSGFMT = @MSGFMT@
 
40
XGETTEXT = @XGETTEXT@
 
41
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
 
42
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
 
43
INTLTOOL_MERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --dist --gettext-package $(DOMAIN)
 
44
MSGINIT = msginit
 
45
MSGCONV = msgconv
 
46
MSGFILTER = msgfilter
 
47
 
 
48
POFILES = @POFILES@
 
49
GMOFILES = @GMOFILES@
 
50
UPDATEPOFILES = @UPDATEPOFILES@
 
51
DUMMYPOFILES = @DUMMYPOFILES@
 
52
DISTFILES.common = Makefile.in.in remove-potcdate.sin \
 
53
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
 
54
DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
 
55
$(POFILES) $(GMOFILES) \
 
56
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
 
57
 
 
58
POTFILES = \
 
59
 
 
60
CATALOGS = @CATALOGS@
 
61
 
 
62
# Makevars gets inserted here. (Don't remove this line!)
 
63
 
 
64
.SUFFIXES:
 
65
.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
 
66
 
 
67
.po.mo:
 
68
        @echo "$(MSGFMT) -c -o $@ $<"; \
 
69
        $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
 
70
 
 
71
.po.gmo:
 
72
        @lang=`echo $* | sed -e 's,.*/,,'`; \
 
73
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
74
        echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
 
75
        cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
 
76
 
 
77
.sin.sed:
 
78
        sed -e '/^#/d' $< > t-$@
 
79
        mv t-$@ $@
 
80
 
 
81
 
 
82
all: all-@USE_NLS@
 
83
 
 
84
all-yes: stamp-po
 
85
all-no:
 
86
 
 
87
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
 
88
# been loosely updated. Its purpose is that when a developer or translator
 
89
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
 
90
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
 
91
# invocations of "make" will do nothing. This timestamp would not be necessary
 
92
# if updating the $(CATALOGS) would always touch them; however, the rule for
 
93
# $(POFILES) has been designed to not touch files that don't need to be
 
94
# changed.
 
95
stamp-po: $(srcdir)/$(DOMAIN).pot
 
96
        test -z "$(CATALOGS)" || $(MAKE) $(CATALOGS)
 
97
        @echo "touch stamp-po"
 
98
        @echo timestamp > stamp-poT
 
99
        @mv stamp-poT stamp-po
 
100
 
 
101
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
 
102
# otherwise packages like GCC can not be built if only parts of the source
 
103
# have been downloaded.
 
104
 
 
105
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
 
106
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
 
107
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
 
108
        INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT); \
 
109
        $(INTLTOOL_UPDATE) --pot --gettext-package $(DOMAIN)
 
110
 
 
111
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
 
112
# every "make" invocation, only create it when it is missing.
 
113
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
 
114
$(srcdir)/$(DOMAIN).pot:
 
115
        $(MAKE) $(DOMAIN).pot-update
 
116
 
 
117
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
 
118
# Note that a PO file is not touched if it doesn't need to be changed.
 
119
$(POFILES): $(srcdir)/$(DOMAIN).pot
 
120
        @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
 
121
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
122
        echo "$${cdcmd}$(INTLTOOL_UPDATE) $${lang}.po"; \
 
123
        cd $(srcdir) && $(INTLTOOL_UPDATE) $${lang};
 
124
 
 
125
install: install-exec install-data
 
126
install-exec:
 
127
install-data: install-data-@USE_NLS@
 
128
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
129
          $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
 
130
          for file in $(DISTFILES.common) Makevars.template; do \
 
131
            $(INSTALL_DATA) $(srcdir)/$$file \
 
132
                            $(DESTDIR)$(gettextsrcdir)/$$file; \
 
133
          done; \
 
134
          for file in Makevars; do \
 
135
            rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
 
136
          done; \
 
137
        else \
 
138
          : ; \
 
139
        fi
 
140
install-data-no: all
 
141
install-data-yes: all
 
142
        $(mkinstalldirs) $(DESTDIR)$(datadir)
 
143
        @catalogs='$(CATALOGS)'; \
 
144
        for cat in $$catalogs; do \
 
145
          cat=`basename $$cat`; \
 
146
          lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 
147
          dir=$(localedir)/$$lang/LC_MESSAGES; \
 
148
          $(mkinstalldirs) $(DESTDIR)$$dir; \
 
149
          if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
 
150
          $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
 
151
          echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
 
152
          for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
 
153
            if test -n "$$lc"; then \
 
154
              if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
 
155
                link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
 
156
                mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
157
                mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
158
                (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
 
159
                 for file in *; do \
 
160
                   if test -f $$file; then \
 
161
                     ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
 
162
                   fi; \
 
163
                 done); \
 
164
                rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
165
              else \
 
166
                if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
 
167
                  :; \
 
168
                else \
 
169
                  rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
170
                  mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
171
                fi; \
 
172
              fi; \
 
173
              rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
 
174
              ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
 
175
              ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
 
176
              cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
 
177
              echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
 
178
            fi; \
 
179
          done; \
 
180
        done
 
181
 
 
182
install-strip: install
 
183
 
 
184
installdirs: installdirs-exec installdirs-data
 
185
installdirs-exec:
 
186
installdirs-data: installdirs-data-@USE_NLS@
 
187
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
188
          $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
 
189
        else \
 
190
          : ; \
 
191
        fi
 
192
installdirs-data-no:
 
193
installdirs-data-yes:
 
194
        $(mkinstalldirs) $(DESTDIR)$(datadir)
 
195
        @catalogs='$(CATALOGS)'; \
 
196
        for cat in $$catalogs; do \
 
197
          cat=`basename $$cat`; \
 
198
          lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 
199
          dir=$(localedir)/$$lang/LC_MESSAGES; \
 
200
          $(mkinstalldirs) $(DESTDIR)$$dir; \
 
201
          for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
 
202
            if test -n "$$lc"; then \
 
203
              if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
 
204
                link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
 
205
                mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
206
                mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
207
                (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
 
208
                 for file in *; do \
 
209
                   if test -f $$file; then \
 
210
                     ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
 
211
                   fi; \
 
212
                 done); \
 
213
                rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
214
              else \
 
215
                if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
 
216
                  :; \
 
217
                else \
 
218
                  rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
219
                  mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
220
                fi; \
 
221
              fi; \
 
222
            fi; \
 
223
          done; \
 
224
        done
 
225
 
 
226
# Define this as empty until I found a useful application.
 
227
installcheck:
 
228
 
 
229
uninstall: uninstall-exec uninstall-data
 
230
uninstall-exec:
 
231
uninstall-data: uninstall-data-@USE_NLS@
 
232
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
233
          for file in $(DISTFILES.common) Makevars.template; do \
 
234
            rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
 
235
          done; \
 
236
        else \
 
237
          : ; \
 
238
        fi
 
239
uninstall-data-no:
 
240
uninstall-data-yes:
 
241
        catalogs='$(CATALOGS)'; \
 
242
        for cat in $$catalogs; do \
 
243
          cat=`basename $$cat`; \
 
244
          lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 
245
          for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
 
246
            rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
 
247
          done; \
 
248
        done
 
249
 
 
250
check: all
 
251
 
 
252
info dvi ps pdf html tags TAGS ctags CTAGS ID:
 
253
 
 
254
mostlyclean:
 
255
        rm -f remove-potcdate.sed
 
256
        rm -f stamp-poT
 
257
        rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
 
258
        rm -fr *.o
 
259
 
 
260
clean: mostlyclean
 
261
 
 
262
distclean: clean
 
263
        rm -f Makefile Makefile.in POTFILES *.mo
 
264
 
 
265
maintainer-clean: distclean
 
266
        @echo "This command is intended for maintainers to use;"
 
267
        @echo "it deletes files that may require special tools to rebuild."
 
268
        rm -f stamp-po $(GMOFILES)
 
269
 
 
270
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 
271
dist distdir:
 
272
        $(MAKE) update-po
 
273
        @$(MAKE) dist2
 
274
# This is a separate target because 'update-po' must be executed before.
 
275
dist2: $(DISTFILES)
 
276
        dists="$(DISTFILES)"; \
 
277
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
278
          dists="$$dists Makevars.template"; \
 
279
        fi; \
 
280
        if test -f $(srcdir)/ChangeLog; then \
 
281
          dists="$$dists ChangeLog"; \
 
282
        fi; \
 
283
        for i in 0 1 2 3 4 5 6 7 8 9; do \
 
284
          if test -f $(srcdir)/ChangeLog.$$i; then \
 
285
            dists="$$dists ChangeLog.$$i"; \
 
286
          fi; \
 
287
        done; \
 
288
        if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
 
289
        for file in $$dists; do \
 
290
          if test -f $$file; then \
 
291
            cp -p $$file $(distdir); \
 
292
          else \
 
293
            cp -p $(srcdir)/$$file $(distdir); \
 
294
          fi; \
 
295
        done
 
296
 
 
297
update-po: Makefile
 
298
        $(MAKE) $(DOMAIN).pot-update
 
299
        test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
 
300
        $(MAKE) update-gmo
 
301
 
 
302
# General rule for updating PO files.
 
303
 
 
304
.nop.po-update:
 
305
        @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
 
306
        if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
 
307
        tmpdir=`pwd`; \
 
308
        echo "$$lang:"; \
 
309
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
310
        echo "$${cdcmd}$(INTLTOOL_MERGE) $$lang"; \
 
311
        cd $(srcdir); \
 
312
        $(INTLTOOL_MERGE) $$lang || \
 
313
          (echo "intltool-update for $$lang.po failed!" 1>&2; \
 
314
          cp $$lang.old.po $$lang.po;)
 
315
 
 
316
$(DUMMYPOFILES):
 
317
 
 
318
update-gmo: Makefile $(GMOFILES)
 
319
        @:
 
320
 
 
321
Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@
 
322
        cd $(top_builddir) \
 
323
          && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
 
324
               $(SHELL) ./config.status
 
325
 
 
326
force:
 
327
 
 
328
# Tell versions [3.59,3.63) of GNU make not to export all variables.
 
329
# Otherwise a system limit (for SysV at least) may be exceeded.
 
330
.NOEXPORT: