~drizzle-trunk/drizzle/7.2

« back to all changes in this revision

Viewing changes to po/Makefile.in.in

  • Committer: Continuous Integration
  • Date: 2013-04-27 20:03:58 UTC
  • mfrom: (2633.1.11 drizzle-7.2)
  • Revision ID: ci@drizzle.org-20130427200358-77r6140iqb0orc1o
Merge lp:~brianaker/drizzle/update-bootstrap-april-20113/ Build: jenkins-Drizzle-Builder-192

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Makefile for program source directory in GNU NLS utilities package.
2
 
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3
 
# Copyright (C) 2004-2008 Rodney Dawes <dobey.pwns@gmail.com>
4
 
#
5
 
# This file may be copied and used freely without restrictions.  It may
6
 
# be used in projects which are not available under a GNU Public License,
7
 
# but which still want to provide support for the GNU gettext functionality.
8
 
#
9
 
# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
10
 
#   instead of PACKAGE and to look for po2tbl in ./ not in intl/
11
 
#
12
 
# - Modified by jacob berkman <jacob@ximian.com> to install
13
 
#   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
14
 
#
15
 
# - Modified by Rodney Dawes <dobey.pwns@gmail.com> for use with intltool
16
 
#
17
 
# We have the following line for use by intltoolize:
18
 
# INTLTOOL_MAKEFILE
 
1
# Makefile for PO directory in any package using GNU gettext.
 
2
# Copyright (C) 1995-1997, 2000-2007, 2009-2010 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
# Origin: gettext-0.18
 
12
GETTEXT_MACRO_VERSION = 0.18
19
13
 
20
 
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
21
14
PACKAGE = @PACKAGE@
22
15
VERSION = @VERSION@
 
16
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
23
17
 
24
 
SHELL = @SHELL@
 
18
SHELL = /bin/sh
 
19
@SET_MAKE@
25
20
 
26
21
srcdir = @srcdir@
27
22
top_srcdir = @top_srcdir@
28
 
top_builddir = @top_builddir@
29
23
VPATH = @srcdir@
30
24
 
31
25
prefix = @prefix@
32
26
exec_prefix = @exec_prefix@
 
27
datarootdir = @datarootdir@
33
28
datadir = @datadir@
34
 
datarootdir = @datarootdir@
35
 
libdir = @libdir@
36
 
DATADIRNAME = @DATADIRNAME@
37
 
itlocaledir = $(prefix)/$(DATADIRNAME)/locale
38
 
subdir = po
39
 
install_sh = @install_sh@
40
 
# Automake >= 1.8 provides @mkdir_p@.
41
 
# Until it can be supposed, use the safe fallback:
42
 
mkdir_p = $(install_sh) -d
 
29
localedir = @localedir@
 
30
gettextsrcdir = $(datadir)/gettext/po
43
31
 
44
32
INSTALL = @INSTALL@
45
33
INSTALL_DATA = @INSTALL_DATA@
46
34
 
47
 
GMSGFMT = @GMSGFMT@
48
 
MSGFMT = @MSGFMT@
49
 
XGETTEXT = @XGETTEXT@
50
 
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
51
 
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
52
 
INTLTOOL_WARNINGS = @INTLTOOL_WARNINGS@
53
 
MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) XGETTEXT=$(XGETTEXT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
54
 
GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) XGETTEXT=$(XGETTEXT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
55
 
 
56
 
ALL_LINGUAS = @ALL_LINGUAS@
57
 
 
58
 
PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
59
 
 
60
 
USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
61
 
 
62
 
USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
63
 
 
64
 
POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
65
 
 
66
 
DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
67
 
EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
 
35
# We use $(mkdir_p).
 
36
# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
 
37
# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
 
38
# @install_sh@ does not start with $(SHELL), so we add it.
 
39
# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
 
40
# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
 
41
# versions, $(mkinstalldirs) and $(install_sh) are unused.
 
42
mkinstalldirs = $(SHELL) @install_sh@ -d
 
43
install_sh = $(SHELL) @install_sh@
 
44
MKDIR_P = @MKDIR_P@
 
45
mkdir_p = @mkdir_p@
 
46
 
 
47
GMSGFMT_ = @GMSGFMT@
 
48
GMSGFMT_no = @GMSGFMT@
 
49
GMSGFMT_yes = @GMSGFMT_015@
 
50
GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
 
51
MSGFMT_ = @MSGFMT@
 
52
MSGFMT_no = @MSGFMT@
 
53
MSGFMT_yes = @MSGFMT_015@
 
54
MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
 
55
XGETTEXT_ = @XGETTEXT@
 
56
XGETTEXT_no = @XGETTEXT@
 
57
XGETTEXT_yes = @XGETTEXT_015@
 
58
XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
 
59
MSGMERGE = msgmerge
 
60
MSGMERGE_UPDATE = @MSGMERGE@ --update
 
61
MSGINIT = msginit
 
62
MSGCONV = msgconv
 
63
MSGFILTER = msgfilter
 
64
 
 
65
POFILES = @POFILES@
 
66
GMOFILES = @GMOFILES@
 
67
UPDATEPOFILES = @UPDATEPOFILES@
 
68
DUMMYPOFILES = @DUMMYPOFILES@
 
69
DISTFILES.common = Makefile.in.in remove-potcdate.sin \
 
70
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
 
71
DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
 
72
$(POFILES) $(GMOFILES) \
 
73
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
68
74
 
69
75
POTFILES = \
70
 
# This comment gets stripped out
71
 
 
72
 
CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
 
76
 
 
77
CATALOGS = @CATALOGS@
 
78
 
 
79
# Makevars gets inserted here. (Don't remove this line!)
73
80
 
74
81
.SUFFIXES:
75
 
.SUFFIXES: .po .pox .gmo .mo .msg .cat
76
 
 
77
 
.po.pox:
78
 
        $(MAKE) $(GETTEXT_PACKAGE).pot
79
 
        $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
 
82
.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
80
83
 
81
84
.po.mo:
82
 
        $(MSGFMT) -o $@ $<
 
85
        @echo "$(MSGFMT) -c -o $@ $<"; \
 
86
        $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
83
87
 
84
88
.po.gmo:
85
 
        file=`echo $* | sed 's,.*/,,'`.gmo \
86
 
          && rm -f $$file && $(GMSGFMT) -o $$file $<
87
 
 
88
 
.po.cat:
89
 
        sed -f ../intl/po2msg.sed < $< > $*.msg \
90
 
          && rm -f $@ && gencat $@ $*.msg
91
 
 
92
 
 
93
 
all: all-@USE_NLS@
94
 
 
95
 
all-yes: $(CATALOGS)
 
89
        @lang=`echo $* | sed -e 's,.*/,,'`; \
 
90
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
91
        echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
 
92
        cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
 
93
 
 
94
.sin.sed:
 
95
        sed -e '/^#/d' $< > t-$@
 
96
        mv t-$@ $@
 
97
 
 
98
 
 
99
all: check-macro-version all-@USE_NLS@
 
100
 
 
101
all-yes: stamp-po
96
102
all-no:
97
103
 
98
 
$(GETTEXT_PACKAGE).pot: $(POTFILES)
99
 
        $(GENPOT)
100
 
 
101
 
install: install-data
 
104
# Ensure that the gettext macros and this Makefile.in.in are in sync.
 
105
check-macro-version:
 
106
        @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
 
107
          || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
 
108
               exit 1; \
 
109
             }
 
110
 
 
111
# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
 
112
# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
 
113
# we don't want to bother translators with empty POT files). We assume that
 
114
# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
 
115
# In this case, stamp-po is a nop (i.e. a phony target).
 
116
 
 
117
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
 
118
# been loosely updated. Its purpose is that when a developer or translator
 
119
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
 
120
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
 
121
# invocations of "make" will do nothing. This timestamp would not be necessary
 
122
# if updating the $(CATALOGS) would always touch them; however, the rule for
 
123
# $(POFILES) has been designed to not touch files that don't need to be
 
124
# changed.
 
125
stamp-po: $(srcdir)/$(DOMAIN).pot
 
126
        test ! -f $(srcdir)/$(DOMAIN).pot || \
 
127
          test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
 
128
        @test ! -f $(srcdir)/$(DOMAIN).pot || { \
 
129
          echo "touch stamp-po" && \
 
130
          echo timestamp > stamp-poT && \
 
131
          mv stamp-poT stamp-po; \
 
132
        }
 
133
 
 
134
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
 
135
# otherwise packages like GCC can not be built if only parts of the source
 
136
# have been downloaded.
 
137
 
 
138
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
 
139
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
 
140
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
 
141
        if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
 
142
          package_gnu='GNU '; \
 
143
        else \
 
144
          package_gnu=''; \
 
145
        fi; \
 
146
        if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
 
147
          msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
 
148
        else \
 
149
          msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
 
150
        fi; \
 
151
        case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
 
152
          '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
 
153
            $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
 
154
              --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
 
155
              --files-from=$(srcdir)/POTFILES.in \
 
156
              --copyright-holder='$(COPYRIGHT_HOLDER)' \
 
157
              --msgid-bugs-address="$$msgid_bugs_address" \
 
158
            ;; \
 
159
          *) \
 
160
            $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
 
161
              --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
 
162
              --files-from=$(srcdir)/POTFILES.in \
 
163
              --copyright-holder='$(COPYRIGHT_HOLDER)' \
 
164
              --package-name="$${package_gnu}@PACKAGE@" \
 
165
              --package-version='@VERSION@' \
 
166
              --msgid-bugs-address="$$msgid_bugs_address" \
 
167
            ;; \
 
168
        esac
 
169
        test ! -f $(DOMAIN).po || { \
 
170
          if test -f $(srcdir)/$(DOMAIN).pot; then \
 
171
            sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
 
172
            sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
 
173
            if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
 
174
              rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
 
175
            else \
 
176
              rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
 
177
              mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
 
178
            fi; \
 
179
          else \
 
180
            mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
 
181
          fi; \
 
182
        }
 
183
 
 
184
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
 
185
# every "make" invocation, only create it when it is missing.
 
186
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
 
187
$(srcdir)/$(DOMAIN).pot:
 
188
        $(MAKE) $(DOMAIN).pot-update
 
189
 
 
190
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
 
191
# Note that a PO file is not touched if it doesn't need to be changed.
 
192
$(POFILES): $(srcdir)/$(DOMAIN).pot
 
193
        @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
 
194
        if test -f "$(srcdir)/$${lang}.po"; then \
 
195
          test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
196
          echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
 
197
          cd $(srcdir) \
 
198
            && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
 
199
                   '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
 
200
                     $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
 
201
                   *) \
 
202
                     $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
 
203
                 esac; \
 
204
               }; \
 
205
        else \
 
206
          $(MAKE) $${lang}.po-create; \
 
207
        fi
 
208
 
 
209
 
 
210
install: install-exec install-data
 
211
install-exec:
102
212
install-data: install-data-@USE_NLS@
 
213
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
214
          $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
 
215
          for file in $(DISTFILES.common) Makevars.template; do \
 
216
            $(INSTALL_DATA) $(srcdir)/$$file \
 
217
                            $(DESTDIR)$(gettextsrcdir)/$$file; \
 
218
          done; \
 
219
          for file in Makevars; do \
 
220
            rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
 
221
          done; \
 
222
        else \
 
223
          : ; \
 
224
        fi
103
225
install-data-no: all
104
226
install-data-yes: all
105
 
        linguas="$(USE_LINGUAS)"; \
106
 
        for lang in $$linguas; do \
107
 
          dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
108
 
          $(mkdir_p) $$dir; \
109
 
          if test -r $$lang.gmo; then \
110
 
            $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
111
 
            echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
112
 
          else \
113
 
            $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
114
 
            echo "installing $(srcdir)/$$lang.gmo as" \
115
 
                 "$$dir/$(GETTEXT_PACKAGE).mo"; \
116
 
          fi; \
117
 
          if test -r $$lang.gmo.m; then \
118
 
            $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
119
 
            echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
120
 
          else \
121
 
            if test -r $(srcdir)/$$lang.gmo.m ; then \
122
 
              $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
123
 
                $$dir/$(GETTEXT_PACKAGE).mo.m; \
124
 
              echo "installing $(srcdir)/$$lang.gmo.m as" \
125
 
                   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
126
 
            else \
127
 
              true; \
128
 
            fi; \
129
 
          fi; \
130
 
        done
131
 
 
132
 
# Empty stubs to satisfy archaic automake needs
133
 
dvi info ctags tags CTAGS TAGS ID:
 
227
        @catalogs='$(CATALOGS)'; \
 
228
        for cat in $$catalogs; do \
 
229
          cat=`basename $$cat`; \
 
230
          lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 
231
          dir=$(localedir)/$$lang/LC_MESSAGES; \
 
232
          $(mkdir_p) $(DESTDIR)$$dir; \
 
233
          if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
 
234
          $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
 
235
          echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
 
236
          for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
 
237
            if test -n "$$lc"; then \
 
238
              if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
 
239
                link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
 
240
                mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
241
                mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
242
                (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
 
243
                 for file in *; do \
 
244
                   if test -f $$file; then \
 
245
                     ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
 
246
                   fi; \
 
247
                 done); \
 
248
                rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
249
              else \
 
250
                if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
 
251
                  :; \
 
252
                else \
 
253
                  rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
254
                  mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
255
                fi; \
 
256
              fi; \
 
257
              rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
 
258
              ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
 
259
              ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
 
260
              cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
 
261
              echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
 
262
            fi; \
 
263
          done; \
 
264
        done
 
265
 
 
266
install-strip: install
 
267
 
 
268
installdirs: installdirs-exec installdirs-data
 
269
installdirs-exec:
 
270
installdirs-data: installdirs-data-@USE_NLS@
 
271
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
272
          $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
 
273
        else \
 
274
          : ; \
 
275
        fi
 
276
installdirs-data-no:
 
277
installdirs-data-yes:
 
278
        @catalogs='$(CATALOGS)'; \
 
279
        for cat in $$catalogs; do \
 
280
          cat=`basename $$cat`; \
 
281
          lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 
282
          dir=$(localedir)/$$lang/LC_MESSAGES; \
 
283
          $(mkdir_p) $(DESTDIR)$$dir; \
 
284
          for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
 
285
            if test -n "$$lc"; then \
 
286
              if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
 
287
                link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
 
288
                mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
289
                mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
290
                (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
 
291
                 for file in *; do \
 
292
                   if test -f $$file; then \
 
293
                     ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
 
294
                   fi; \
 
295
                 done); \
 
296
                rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
 
297
              else \
 
298
                if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
 
299
                  :; \
 
300
                else \
 
301
                  rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
302
                  mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
 
303
                fi; \
 
304
              fi; \
 
305
            fi; \
 
306
          done; \
 
307
        done
134
308
 
135
309
# Define this as empty until I found a useful application.
136
 
install-exec installcheck:
 
310
installcheck:
137
311
 
138
 
uninstall:
139
 
        linguas="$(USE_LINGUAS)"; \
140
 
        for lang in $$linguas; do \
141
 
          rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
142
 
          rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
 
312
uninstall: uninstall-exec uninstall-data
 
313
uninstall-exec:
 
314
uninstall-data: uninstall-data-@USE_NLS@
 
315
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
316
          for file in $(DISTFILES.common) Makevars.template; do \
 
317
            rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
 
318
          done; \
 
319
        else \
 
320
          : ; \
 
321
        fi
 
322
uninstall-data-no:
 
323
uninstall-data-yes:
 
324
        catalogs='$(CATALOGS)'; \
 
325
        for cat in $$catalogs; do \
 
326
          cat=`basename $$cat`; \
 
327
          lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 
328
          for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
 
329
            rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
 
330
          done; \
143
331
        done
144
332
 
145
 
check: all $(GETTEXT_PACKAGE).pot
146
 
        rm -f missing notexist
147
 
        srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
148
 
        if [ -r missing -o -r notexist -a "x${INTLTOOL_WARNINGS}" = "xyes" ]; then \
149
 
          exit 1; \
150
 
        fi
 
333
check: all
 
334
 
 
335
info dvi ps pdf html tags TAGS ctags CTAGS ID:
151
336
 
152
337
mostlyclean:
153
 
        rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
154
 
        rm -f .intltool-merge-cache
 
338
        rm -f remove-potcdate.sed
 
339
        rm -f stamp-poT
 
340
        rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
 
341
        rm -fr *.o
155
342
 
156
343
clean: mostlyclean
157
344
 
158
345
distclean: clean
159
 
        rm -f Makefile Makefile.in POTFILES stamp-it
160
 
        rm -f *.mo *.msg *.cat *.cat.m *.gmo
 
346
        rm -f Makefile Makefile.in POTFILES *.mo
161
347
 
162
348
maintainer-clean: distclean
163
349
        @echo "This command is intended for maintainers to use;"
164
350
        @echo "it deletes files that may require special tools to rebuild."
 
351
        rm -f stamp-po $(GMOFILES)
165
352
 
166
 
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
167
 
dist distdir: $(DISTFILES)
 
353
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 
354
dist distdir:
 
355
        $(MAKE) update-po
 
356
        @$(MAKE) dist2
 
357
# This is a separate target because 'update-po' must be executed before.
 
358
dist2: stamp-po $(DISTFILES)
168
359
        dists="$(DISTFILES)"; \
169
 
        extra_dists="$(EXTRA_DISTFILES)"; \
170
 
        for file in $$extra_dists; do \
171
 
          test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
 
360
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
361
          dists="$$dists Makevars.template"; \
 
362
        fi; \
 
363
        if test -f $(srcdir)/$(DOMAIN).pot; then \
 
364
          dists="$$dists $(DOMAIN).pot stamp-po"; \
 
365
        fi; \
 
366
        if test -f $(srcdir)/ChangeLog; then \
 
367
          dists="$$dists ChangeLog"; \
 
368
        fi; \
 
369
        for i in 0 1 2 3 4 5 6 7 8 9; do \
 
370
          if test -f $(srcdir)/ChangeLog.$$i; then \
 
371
            dists="$$dists ChangeLog.$$i"; \
 
372
          fi; \
172
373
        done; \
 
374
        if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
173
375
        for file in $$dists; do \
174
 
          test -f $$file || file="$(srcdir)/$$file"; \
175
 
          ln $$file $(distdir) 2> /dev/null \
176
 
            || cp -p $$file $(distdir); \
 
376
          if test -f $$file; then \
 
377
            cp -p $$file $(distdir) || exit 1; \
 
378
          else \
 
379
            cp -p $(srcdir)/$$file $(distdir) || exit 1; \
 
380
          fi; \
177
381
        done
178
382
 
179
383
update-po: Makefile
180
 
        $(MAKE) $(GETTEXT_PACKAGE).pot
 
384
        $(MAKE) $(DOMAIN).pot-update
 
385
        test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
 
386
        $(MAKE) update-gmo
 
387
 
 
388
# General rule for creating PO files.
 
389
 
 
390
.nop.po-create:
 
391
        @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
 
392
        echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
 
393
        exit 1
 
394
 
 
395
# General rule for updating PO files.
 
396
 
 
397
.nop.po-update:
 
398
        @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
 
399
        if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
181
400
        tmpdir=`pwd`; \
182
 
        linguas="$(USE_LINGUAS)"; \
183
 
        for lang in $$linguas; do \
184
 
          echo "$$lang:"; \
185
 
          result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
186
 
          if $$result; then \
187
 
            if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
188
 
              rm -f $$tmpdir/$$lang.new.po; \
189
 
            else \
190
 
              if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
191
 
                :; \
192
 
              else \
193
 
                echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
194
 
                rm -f $$tmpdir/$$lang.new.po; \
195
 
                exit 1; \
196
 
              fi; \
197
 
            fi; \
198
 
          else \
199
 
            echo "msgmerge for $$lang.gmo failed!"; \
 
401
        echo "$$lang:"; \
 
402
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
403
        echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
 
404
        cd $(srcdir); \
 
405
        if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
 
406
               '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
 
407
                 $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
 
408
               *) \
 
409
                 $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
 
410
             esac; \
 
411
           }; then \
 
412
          if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
200
413
            rm -f $$tmpdir/$$lang.new.po; \
 
414
          else \
 
415
            if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
 
416
              :; \
 
417
            else \
 
418
              echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
 
419
              exit 1; \
 
420
            fi; \
201
421
          fi; \
202
 
        done
203
 
 
204
 
Makefile POTFILES: stamp-it
205
 
        @if test ! -f $@; then \
206
 
          rm -f stamp-it; \
207
 
          $(MAKE) stamp-it; \
 
422
        else \
 
423
          echo "msgmerge for $$lang.po failed!" 1>&2; \
 
424
          rm -f $$tmpdir/$$lang.new.po; \
208
425
        fi
209
426
 
210
 
stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
 
427
$(DUMMYPOFILES):
 
428
 
 
429
update-gmo: Makefile $(GMOFILES)
 
430
        @:
 
431
 
 
432
# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
 
433
# because execution permission bits may not work on the current file system.
 
434
# Use @SHELL@, which is the shell determined by autoconf for the use by its
 
435
# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
 
436
Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
211
437
        cd $(top_builddir) \
212
 
          && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
213
 
               $(SHELL) ./config.status
214
 
 
215
 
# We need one of these so we don't break if the html rule is used.
216
 
html:
217
 
 
218
 
install-html:
 
438
          && @SHELL@ ./config.status $(subdir)/$@.in po-directories
 
439
 
 
440
force:
219
441
 
220
442
# Tell versions [3.59,3.63) of GNU make not to export all variables.
221
443
# Otherwise a system limit (for SysV at least) may be exceeded.