2005-10-31 [mones] 1.9.15cvs128
[claws.git] / po / Makefile.in.in
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 #
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.
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 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
16 PACKAGE = @PACKAGE@
17 VERSION = @VERSION@
18
19 SHELL = /bin/sh
20 @SET_MAKE@
21
22 srcdir = @srcdir@
23 top_srcdir = @top_srcdir@
24 VPATH = @srcdir@
25
26 prefix = @prefix@
27 exec_prefix = @exec_prefix@
28 datadir = @datadir@
29 libdir = @libdir@
30 localedir = $(libdir)/locale
31 gnulocaledir = $(datadir)/locale
32 gettextsrcdir = $(datadir)/glib-2.0/gettext/po
33 subdir = po
34
35 INSTALL = @INSTALL@
36 INSTALL_DATA = @INSTALL_DATA@
37 MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
38
39 CC = @CC@
40 GENCAT = @GENCAT@
41 GMSGFMT = @GMSGFMT@
42 MSGFMT = @MSGFMT@
43 XGETTEXT = @XGETTEXT@
44 MSGMERGE = msgmerge
45
46 DEFS = @DEFS@
47 CFLAGS = @CFLAGS@
48 CPPFLAGS = @CPPFLAGS@
49
50 INCLUDES = -I.. -I$(top_srcdir)/intl
51
52 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
53
54 SOURCES = 
55 POFILES = @POFILES@
56 GMOFILES = @GMOFILES@
57 DISTFILES = Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
58 $(POFILES) $(GMOFILES) $(SOURCES)
59
60 POTFILES = \
61
62 CATALOGS = @CATALOGS@
63 CATOBJEXT = @CATOBJEXT@
64 INSTOBJEXT = @INSTOBJEXT@
65
66 .SUFFIXES:
67 .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
68
69 .c.o:
70         $(COMPILE) $<
71
72 .po.pox:
73         $(MAKE) $(GETTEXT_PACKAGE).pot
74         $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
75
76 .po.mo:
77         $(MSGFMT) -c -o $@ $<
78
79 .po.gmo:
80         file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
81           && rm -f $$file && $(GMSGFMT) -c --statistics -o $$file $<
82
83 .po.cat:
84         sed -f ../intl/po2msg.sed < $< > $*.msg \
85           && rm -f $@ && $(GENCAT) $@ $*.msg
86
87
88 all: all-@USE_NLS@
89
90 all-yes: $(CATALOGS)
91 all-no:
92
93 $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
94         $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
95           --add-comments --keyword=_ --keyword=N_ \
96           --files-from=$(srcdir)/POTFILES.in \
97           --msgid-bugs-address='twb@users.sourceforge.net' \
98         && test ! -f $(GETTEXT_PACKAGE).po \
99            || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
100                 && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
101
102 install: install-exec install-data
103 install-exec:
104 install-data: install-data-@USE_NLS@
105 install-data-no: all
106 install-data-yes: all
107         if test -r "$(MKINSTALLDIRS)"; then \
108           $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
109         else \
110           $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
111         fi
112         @catalogs='$(CATALOGS)'; \
113         for cat in $$catalogs; do \
114           cat=`basename $$cat`; \
115           case "$$cat" in \
116             *.gmo) destdir=$(gnulocaledir);; \
117             *)     destdir=$(localedir);; \
118           esac; \
119           lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
120           dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
121           if test -r "$(MKINSTALLDIRS)"; then \
122             $(MKINSTALLDIRS) $$dir; \
123           else \
124             $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
125           fi; \
126           if test -r $$cat; then \
127             $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
128             echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
129           else \
130             $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
131             echo "installing $(srcdir)/$$cat as" \
132                  "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
133           fi; \
134           if test -r $$cat.m; then \
135             $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
136             echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
137           else \
138             if test -r $(srcdir)/$$cat.m ; then \
139               $(INSTALL_DATA) $(srcdir)/$$cat.m \
140                 $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
141               echo "installing $(srcdir)/$$cat as" \
142                    "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
143             else \
144               true; \
145             fi; \
146           fi; \
147         done
148         if test "$(PACKAGE)" = "glib"; then \
149           if test -r "$(MKINSTALLDIRS)"; then \
150             $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
151           else \
152             $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
153           fi; \
154           $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
155                           $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
156         else \
157           : ; \
158         fi
159
160 # Define this as empty until I found a useful application.
161 installcheck:
162
163 uninstall:
164         catalogs='$(CATALOGS)'; \
165         for cat in $$catalogs; do \
166           cat=`basename $$cat`; \
167           lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
168           rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
169           rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
170           rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
171           rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
172         done
173         if test "$(PACKAGE)" = "glib"; then \
174           rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
175         fi
176
177 check: all
178
179 dvi info tags TAGS ID:
180
181 mostlyclean:
182         rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
183         rm -fr *.o
184
185 clean: mostlyclean
186
187 distclean: clean
188         rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
189
190 maintainer-clean: distclean
191         @echo "This command is intended for maintainers to use;"
192         @echo "it deletes files that may require special tools to rebuild."
193         rm -f $(GMOFILES)
194
195 distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
196 dist distdir: update-po $(DISTFILES)
197         dists="$(DISTFILES)"; \
198         for file in $$dists; do \
199           ln $(srcdir)/$$file $(distdir) 2> /dev/null \
200             || cp -p $(srcdir)/$$file $(distdir); \
201         done
202
203 update-po: Makefile
204         $(MAKE) $(GETTEXT_PACKAGE).pot
205         tmpdir=`pwd`; \
206         cd $(srcdir); \
207         catalogs='$(CATALOGS)'; \
208         for cat in $$catalogs; do \
209           cat=`basename $$cat`; \
210           lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
211           echo "$$lang:"; \
212           if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
213             if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
214               rm -f $$tmpdir/$$lang.new.po; \
215             else \
216               if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
217                 :; \
218               else \
219                 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
220                 rm -f $$tmpdir/$$lang.new.po; \
221                 exit 1; \
222               fi; \
223             fi; \
224           else \
225             echo "msgmerge for $$cat failed!"; \
226             rm -f $$tmpdir/$$lang.new.po; \
227           fi; \
228         done
229
230 # POTFILES is created from POTFILES.in by stripping comments, empty lines
231 # and Intltool tags (enclosed in square brackets), and appending a full
232 # relative path to them
233 POTFILES: POTFILES.in
234         ( if test 'x$(srcdir)' != 'x.'; then \
235             posrcprefix='$(top_srcdir)/'; \
236           else \
237             posrcprefix="../"; \
238           fi; \
239           rm -f $@-t $@ \
240             && (sed -e '/^#/d'                                          \
241                     -e "s/^\[.*\] +//"                                  \
242                     -e '/^[     ]*$$/d'                                 \
243                     -e "s@.*@   $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
244                 | sed -e '$$s/\\$$//') > $@-t \
245             && chmod a-w $@-t \
246             && mv $@-t $@ )
247
248 Makefile: Makefile.in.in ../config.status POTFILES
249         cd .. \
250           && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
251                $(SHELL) ./config.status
252
253 # Tell versions [3.59,3.63) of GNU make not to export all variables.
254 # Otherwise a system limit (for SysV at least) may be exceeded.
255 .NOEXPORT: