Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / po / Makefile.in
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
12 # Modified to handle translations with xml2po by Nicolas François - 2007
13
14 PACKAGE = @PACKAGE@
15 VERSION = @VERSION@
16 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
17
18 SHELL = /bin/sh
19 @SET_MAKE@
20
21 srcdir = @srcdir@
22 top_srcdir = @top_srcdir@
23 VPATH = @srcdir@
24
25 MSGFMT_ = @MSGFMT@
26 MSGFMT_no = @MSGFMT@
27 MSGFMT_yes = @MSGFMT_015@
28 MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
29 XGETTEXT_ = @XGETTEXT@
30 XGETTEXT_no = @XGETTEXT@
31 XGETTEXT_yes = @XGETTEXT_015@
32 XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
33 MSGMERGE = @MSGMERGE@ --previous
34 MSGMERGE_UPDATE = @MSGMERGE@ --update --previous
35 MSGINIT = msginit
36 MSGCONV = msgconv
37 MSGFILTER = msgfilter
38
39 include $(srcdir)/LINGUAS
40 DISTFILES = $(srcdir)/Makevars $(srcdir)/XMLFILES $(srcdir)/LINGUAS $(POFILES)
41
42 include $(srcdir)/XMLFILES
43
44 include $(srcdir)/Makevars
45
46 .SUFFIXES:
47 .SUFFIXES: .po .sed .sin .nop .po-create .po-update
48
49 remove-potcdate.sin: $(top_srcdir)/po/remove-potcdate.sin
50         cp $? $@
51
52 .sin.sed:
53         sed -e '/^#/d' $< > t-$@
54         mv t-$@ $@
55
56 all: all-yes
57
58 all-yes: stamp-po
59 all-no:
60
61 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
62 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
63 # we don't want to bother translators with empty POT files). We assume that
64 # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
65 # In this case, stamp-po is a nop (i.e. a phony target).
66
67 # stamp-po is a timestamp denoting the last time at which the CATALOGS have
68 # been loosely updated. Its purpose is that when a developer or translator
69 # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
70 # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
71 # invocations of "make" will do nothing. This timestamp would not be necessary
72 # if updating the $(CATALOGS) would always touch them; however, the rule for
73 # $(POFILES) has been designed to not touch files that don't need to be
74 # changed.
75 stamp-po: $(srcdir)/$(DOMAIN).pot
76         echo "TOTO 0"
77         @test ! -f $(srcdir)/$(DOMAIN).pot || { \
78           echo "touch stamp-po" && \
79           echo timestamp > stamp-poT && \
80           mv stamp-poT stamp-po; \
81         }
82
83 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
84 # otherwise packages like GCC can not be built if only parts of the source
85 # have been downloaded.
86
87 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
88 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
89 # TODO: set MSGID_BUGS_ADDRESS, COPYRIGHT_HOLDER
90 $(DOMAIN).pot-update: $(XMLFILES) $(srcdir)/XMLFILES remove-potcdate.sed
91         @set -e; tmpdir=`pwd`; \
92         echo "cd $(top_srcdir)/man"; \
93         cd $(top_srcdir)/man; \
94         echo "xml2po --expand-all-entities -o $$tmpdir/$(DOMAIN).po $(notdir $(XMLFILES))"; \
95         xml2po --expand-all-entities -o $$tmpdir/$(DOMAIN).po $(notdir $(XMLFILES)); \
96         cd $$tmpdir
97         test ! -f $(DOMAIN).po || { \
98           if test -f $(srcdir)/$(DOMAIN).pot; then \
99             sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
100             sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
101             if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
102               rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
103             else \
104               rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
105               mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
106             fi; \
107           else \
108             mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
109           fi; \
110         }
111
112 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
113 # every "make" invocation, only create it when it is missing.
114 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
115 $(srcdir)/$(DOMAIN).pot:
116         $(MAKE) $(DOMAIN).pot-update
117
118 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
119 # Note that a PO file is not touched if it doesn't need to be changed.
120 $(POFILES): $(srcdir)/$(DOMAIN).pot
121         @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
122         if test -f "$(srcdir)/$${lang}.po"; then \
123           test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
124           echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
125           cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
126         else \
127           $(MAKE) $${lang}.po-create; \
128         fi
129
130
131 install: install-exec install-data
132 install-exec:
133 install-data:
134
135 install-strip: install
136
137 installdirs: installdirs-exec installdirs-data
138 installdirs-exec:
139 installdirs-data:
140
141 # Define this as empty until I found a useful application.
142 installcheck:
143
144 uninstall: uninstall-exec uninstall-data
145 uninstall-exec:
146 uninstall-data:
147
148 check: all
149
150 info dvi ps pdf html tags TAGS ctags CTAGS ID:
151
152 mostlyclean:
153         rm -f remove-potcdate.sed remove-potcdate.sin
154         rm -f stamp-poT
155         rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
156
157 clean: mostlyclean
158
159 distclean: clean
160         rm -f Makefile
161
162 maintainer-clean: distclean
163         @echo "This command is intended for maintainers to use;"
164         @echo "it deletes files that may require special tools to rebuild."
165         rm -f stamp-po
166
167 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
168 dist distdir:
169         $(MAKE) update-po
170         @$(MAKE) dist2
171 # This is a separate target because 'update-po' must be executed before.
172 dist2: stamp-po $(DISTFILES)
173         dists="$(DISTFILES)"; \
174         if test -f $(srcdir)/$(DOMAIN).pot; then \
175           dists="$$dists $(DOMAIN).pot stamp-po"; \
176         fi; \
177         if test -f $(srcdir)/ChangeLog; then \
178           dists="$$dists ChangeLog"; \
179         fi; \
180         for i in 0 1 2 3 4 5 6 7 8 9; do \
181           if test -f $(srcdir)/ChangeLog.$$i; then \
182             dists="$$dists ChangeLog.$$i"; \
183           fi; \
184         done; \
185         for file in $$dists; do \
186           if test -f $$file; then \
187             cp -p $$file $(distdir) || exit 1; \
188           else \
189             cp -p $(srcdir)/$$file $(distdir) || exit 1; \
190           fi; \
191         done
192
193 update-po: Makefile
194         $(MAKE) $(DOMAIN).pot-update
195         test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
196
197 # General rule for creating PO files.
198
199 .nop.po-create:
200         @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
201         echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
202         exit 1
203
204 # General rule for updating PO files.
205
206 .nop.po-update:
207         @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
208         tmpdir=`pwd`; \
209         echo "$$lang:"; \
210         test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
211         echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
212         cd $(srcdir); \
213         if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
214           if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
215             rm -f $$tmpdir/$$lang.new.po; \
216           else \
217             if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
218               :; \
219             else \
220               echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
221               exit 1; \
222             fi; \
223           fi; \
224         else \
225           echo "msgmerge for $$lang.po failed!" 1>&2; \
226           rm -f $$tmpdir/$$lang.new.po; \
227         fi
228
229 $(DUMMYPOFILES):
230
231 .PRECIOUS: Makefile
232 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
233         @case '$?' in \
234           *config.status*) \
235             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
236           *) \
237             echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
238             cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
239         esac;
240
241 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
242         cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
243
244 # Tell versions [3.59,3.63) of GNU make not to export all variables.
245 # Otherwise a system limit (for SysV at least) may be exceeded.
246 .NOEXPORT: