~ubuntu-branches/ubuntu/maverick/texinfo/maverick

« back to all changes in this revision

Viewing changes to po/Makefile.in.in

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2005-10-28 15:10:30 UTC
  • mto: (2.1.1 dapper) (3.1.4 hardy)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051028151030-9nsf2s2k2z3fktjt
Tags: upstream-4.8
ImportĀ upstreamĀ versionĀ 4.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Makefile for PO directory in any package using GNU gettext.
2
 
# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
 
2
# Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3
3
#
4
4
# This file can be copied and used freely without restrictions.  It can
5
5
# be used in projects which are not available under the GNU General Public
7
7
# functionality.
8
8
# Please note that the actual code of GNU gettext is covered by the GNU
9
9
# General Public License and is *not* in the public domain.
 
10
#
 
11
# Origin: gettext-0.14
10
12
 
11
13
PACKAGE = @PACKAGE@
12
14
VERSION = @VERSION@
27
29
INSTALL = @INSTALL@
28
30
INSTALL_DATA = @INSTALL_DATA@
29
31
MKINSTALLDIRS = @MKINSTALLDIRS@
30
 
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
 
32
mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
31
33
 
32
34
GMSGFMT = @GMSGFMT@
33
35
MSGFMT = @MSGFMT@
42
44
GMOFILES = @GMOFILES@
43
45
UPDATEPOFILES = @UPDATEPOFILES@
44
46
DUMMYPOFILES = @DUMMYPOFILES@
45
 
DISTFILES.common = Makefile.in.in Makevars \
 
47
DISTFILES.common = Makefile.in.in remove-potcdate.sin \
46
48
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
47
 
DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \
 
49
DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
48
50
$(POFILES) $(GMOFILES) \
49
51
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
50
52
 
55
57
# Makevars gets inserted here. (Don't remove this line!)
56
58
 
57
59
.SUFFIXES:
58
 
.SUFFIXES: .po .gmo .mo .nop .po-update
 
60
.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
59
61
 
60
62
.po.mo:
61
 
        $(MSGFMT) -c -o $@ $<
 
63
        @echo "$(MSGFMT) -c -o $@ $<"; \
 
64
        $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
62
65
 
63
66
.po.gmo:
64
67
        @lang=`echo $* | sed -e 's,.*/,,'`; \
65
68
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
66
69
        echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
67
 
        cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po
 
70
        cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
 
71
 
 
72
.sin.sed:
 
73
        sed -e '/^#/d' $< > t-$@
 
74
        mv t-$@ $@
68
75
 
69
76
 
70
77
all: all-@USE_NLS@
71
78
 
72
 
all-yes: $(CATALOGS)
 
79
all-yes: stamp-po
73
80
all-no:
74
81
 
 
82
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
 
83
# been loosely updated. Its purpose is that when a developer or translator
 
84
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
 
85
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
 
86
# invocations of "make" will do nothing. This timestamp would not be necessary
 
87
# if updating the $(CATALOGS) would always touch them; however, the rule for
 
88
# $(POFILES) has been designed to not touch files that don't need to be
 
89
# changed.
 
90
stamp-po: $(srcdir)/$(DOMAIN).pot
 
91
        test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
 
92
        @echo "touch stamp-po"
 
93
        @echo timestamp > stamp-poT
 
94
        @mv stamp-poT stamp-po
 
95
 
75
96
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
76
97
# otherwise packages like GCC can not be built if only parts of the source
77
98
# have been downloaded.
78
99
 
79
 
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
 
100
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
 
101
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
 
102
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
80
103
        $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
81
104
          --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
82
105
          --files-from=$(srcdir)/POTFILES.in \
83
106
          --copyright-holder='$(COPYRIGHT_HOLDER)' \
84
 
        && test ! -f $(DOMAIN).po \
85
 
           || ( rm -f $(srcdir)/$(DOMAIN).pot \
86
 
                && mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot )
 
107
          --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
 
108
        test ! -f $(DOMAIN).po || { \
 
109
          if test -f $(srcdir)/$(DOMAIN).pot; then \
 
110
            sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
 
111
            sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
 
112
            if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
 
113
              rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
 
114
            else \
 
115
              rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
 
116
              mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
 
117
            fi; \
 
118
          else \
 
119
            mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
 
120
          fi; \
 
121
        }
87
122
 
 
123
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
 
124
# every "make" invocation, only create it when it is missing.
 
125
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
88
126
$(srcdir)/$(DOMAIN).pot:
89
127
        $(MAKE) $(DOMAIN).pot-update
90
128
 
 
129
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
 
130
# Note that a PO file is not touched if it doesn't need to be changed.
91
131
$(POFILES): $(srcdir)/$(DOMAIN).pot
92
132
        @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
93
 
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
94
 
        echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
95
 
        cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
 
133
        if test -f "$(srcdir)/$${lang}.po"; then \
 
134
          test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
 
135
          echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
 
136
          cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
 
137
        else \
 
138
          $(MAKE) $${lang}.po-create; \
 
139
        fi
96
140
 
97
141
 
98
142
install: install-exec install-data
99
143
install-exec:
100
144
install-data: install-data-@USE_NLS@
101
 
        if test "$(PACKAGE)" = "gettext"; then \
 
145
        if test "$(PACKAGE)" = "gettext-tools"; then \
102
146
          $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
103
 
          for file in $(DISTFILES.common); do \
 
147
          for file in $(DISTFILES.common) Makevars.template; do \
104
148
            $(INSTALL_DATA) $(srcdir)/$$file \
105
149
                            $(DESTDIR)$(gettextsrcdir)/$$file; \
106
150
          done; \
 
151
          for file in Makevars; do \
 
152
            rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
 
153
          done; \
107
154
        else \
108
155
          : ; \
109
156
        fi
154
201
installdirs: installdirs-exec installdirs-data
155
202
installdirs-exec:
156
203
installdirs-data: installdirs-data-@USE_NLS@
157
 
        if test "$(PACKAGE)" = "gettext"; then \
 
204
        if test "$(PACKAGE)" = "gettext-tools"; then \
158
205
          $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
159
206
        else \
160
207
          : ; \
199
246
uninstall: uninstall-exec uninstall-data
200
247
uninstall-exec:
201
248
uninstall-data: uninstall-data-@USE_NLS@
202
 
        if test "$(PACKAGE)" = "gettext"; then \
203
 
          for file in $(DISTFILES.common); do \
 
249
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
250
          for file in $(DISTFILES.common) Makevars.template; do \
204
251
            rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
205
252
          done; \
206
253
        else \
219
266
 
220
267
check: all
221
268
 
222
 
dvi info tags TAGS ID:
 
269
info dvi ps pdf html tags TAGS ctags CTAGS ID:
223
270
 
224
271
mostlyclean:
225
 
        rm -f core core.* $(DOMAIN).po *.new.po
 
272
        rm -f remove-potcdate.sed
 
273
        rm -f stamp-poT
 
274
        rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
226
275
        rm -fr *.o
227
276
 
228
277
clean: mostlyclean
233
282
maintainer-clean: distclean
234
283
        @echo "This command is intended for maintainers to use;"
235
284
        @echo "it deletes files that may require special tools to rebuild."
236
 
        rm -f $(GMOFILES)
 
285
        rm -f stamp-po $(GMOFILES)
237
286
 
238
287
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
239
288
dist distdir:
242
291
# This is a separate target because 'update-po' must be executed before.
243
292
dist2: $(DISTFILES)
244
293
        dists="$(DISTFILES)"; \
245
 
        if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \
 
294
        if test "$(PACKAGE)" = "gettext-tools"; then \
 
295
          dists="$$dists Makevars.template"; \
 
296
        fi; \
 
297
        if test -f $(srcdir)/ChangeLog; then \
 
298
          dists="$$dists ChangeLog"; \
 
299
        fi; \
 
300
        for i in 0 1 2 3 4 5 6 7 8 9; do \
 
301
          if test -f $(srcdir)/ChangeLog.$$i; then \
 
302
            dists="$$dists ChangeLog.$$i"; \
 
303
          fi; \
 
304
        done; \
246
305
        if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
247
306
        for file in $$dists; do \
248
307
          if test -f $$file; then \
254
313
 
255
314
update-po: Makefile
256
315
        $(MAKE) $(DOMAIN).pot-update
257
 
        $(MAKE) $(UPDATEPOFILES)
 
316
        test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
258
317
        $(MAKE) update-gmo
259
318
 
 
319
# General rule for creating PO files.
 
320
 
 
321
.nop.po-create:
 
322
        @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
 
323
        echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
 
324
        exit 1
 
325
 
260
326
# General rule for updating PO files.
261
327
 
262
328
.nop.po-update:
263
329
        @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
264
 
        if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
 
330
        if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
265
331
        tmpdir=`pwd`; \
266
332
        echo "$$lang:"; \
267
333
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
288
354
update-gmo: Makefile $(GMOFILES)
289
355
        @:
290
356
 
291
 
Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
 
357
Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@
292
358
        cd $(top_builddir) \
293
359
          && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
294
360
               $(SHELL) ./config.status