~ubuntu-branches/ubuntu/hardy/libnss-db/hardy-security

« back to all changes in this revision

Viewing changes to po/Makefile.in.in

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-07-31 18:37:38 UTC
  • Revision ID: james.westby@ubuntu.com-20070731183738-f4u1l3m69i05473u
Tags: 2.2.3pre1-2ubuntu1
debian/rules: explicitely use bash for the install.

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