c247a95484b6f0e548162614cf5b91fa6a10ad1f
[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         && test ! -f $(GETTEXT_PACKAGE).po \
98            || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
99                 && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
100
101 install: install-exec install-data
102 install-exec:
103 install-data: install-data-@USE_NLS@
104 install-data-no: all
105 install-data-yes: all
106         if test -r "$(MKINSTALLDIRS)"; then \
107           $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
108         else \
109           $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
110         fi
111         @catalogs='$(CATALOGS)'; \
112         for cat in $$catalogs; do \
113           cat=`basename $$cat`; \
114           case "$$cat" in \
115             *.gmo) destdir=$(gnulocaledir);; \
116             *)     destdir=$(localedir);; \
117           esac; \
118           lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
119           dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
120           if test -r "$(MKINSTALLDIRS)"; then \
121             $(MKINSTALLDIRS) $$dir; \
122           else \
123             $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
124           fi; \
125           if test -r $$cat; then \
126             $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
127             echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
128           else \
129             $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
130             echo "installing $(srcdir)/$$cat as" \
131                  "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
132           fi; \
133           if test -r $$cat.m; then \
134             $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
135             echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
136           else \
137             if test -r $(srcdir)/$$cat.m ; then \
138               $(INSTALL_DATA) $(srcdir)/$$cat.m \
139                 $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
140               echo "installing $(srcdir)/$$cat as" \
141                    "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
142             else \
143               true; \
144             fi; \
145           fi; \
146         done
147         if test "$(PACKAGE)" = "glib"; then \
148           if test -r "$(MKINSTALLDIRS)"; then \
149             $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
150           else \
151             $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
152           fi; \
153           $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
154                           $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
155         else \
156           : ; \
157         fi
158
159 # Define this as empty until I found a useful application.
160 installcheck:
161
162 uninstall:
163         catalogs='$(CATALOGS)'; \
164         for cat in $$catalogs; do \
165           cat=`basename $$cat`; \
166           lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
167           rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
168           rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
169           rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
170           rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
171         done
172         if test "$(PACKAGE)" = "glib"; then \
173           rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
174         fi
175
176 check: all
177
178 dvi info tags TAGS ID:
179
180 mostlyclean:
181         rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
182         rm -fr *.o
183
184 clean: mostlyclean
185
186 distclean: clean
187         rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
188
189 maintainer-clean: distclean
190         @echo "This command is intended for maintainers to use;"
191         @echo "it deletes files that may require special tools to rebuild."
192         rm -f $(GMOFILES)
193
194 distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
195 dist distdir: update-po $(DISTFILES)
196         dists="$(DISTFILES)"; \
197         for file in $$dists; do \
198           ln $(srcdir)/$$file $(distdir) 2> /dev/null \
199             || cp -p $(srcdir)/$$file $(distdir); \
200         done
201
202 update-po: Makefile
203         $(MAKE) $(GETTEXT_PACKAGE).pot
204         tmpdir=`pwd`; \
205         cd $(srcdir); \
206         catalogs='$(CATALOGS)'; \
207         for cat in $$catalogs; do \
208           cat=`basename $$cat`; \
209           lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
210           echo "$$lang:"; \
211           if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
212             if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
213               rm -f $$tmpdir/$$lang.new.po; \
214             else \
215               if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
216                 :; \
217               else \
218                 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
219                 rm -f $$tmpdir/$$lang.new.po; \
220                 exit 1; \
221               fi; \
222             fi; \
223           else \
224             echo "msgmerge for $$cat failed!"; \
225             rm -f $$tmpdir/$$lang.new.po; \
226           fi; \
227         done
228
229 # POTFILES is created from POTFILES.in by stripping comments, empty lines
230 # and Intltool tags (enclosed in square brackets), and appending a full
231 # relative path to them
232 POTFILES: POTFILES.in
233         ( if test 'x$(srcdir)' != 'x.'; then \
234             posrcprefix='$(top_srcdir)/'; \
235           else \
236             posrcprefix="../"; \
237           fi; \
238           rm -f $@-t $@ \
239             && (sed -e '/^#/d'                                          \
240                     -e "s/^\[.*\] +//"                                  \
241                     -e '/^[     ]*$$/d'                                 \
242                     -e "s@.*@   $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
243                 | sed -e '$$s/\\$$//') > $@-t \
244             && chmod a-w $@-t \
245             && mv $@-t $@ )
246
247 Makefile: Makefile.in.in ../config.status POTFILES
248         cd .. \
249           && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
250                $(SHELL) ./config.status
251
252 # Tell versions [3.59,3.63) of GNU make not to export all variables.
253 # Otherwise a system limit (for SysV at least) may be exceeded.
254 .NOEXPORT: