:pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Fri Dec 14 20:46 CET 2001
[gnokii.git] / po / Makefile.in.in
1 #
2 #
3 #  Makefile for gnokii I18n,
4 #             based on the Makefile.in.in that comes with gettext
5 #
6 #  Erwin Dieterich, 20. 1. 1998 Erwin.Dieterich.ED@Bayer-AG.de
7 #
8 #
9 #
10 # Makefile for program source directory in GNU NLS utilities package.
11 # Copyright (C) 1995, 1996 Free Software Foundation, Inc.
12 #
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2, or (at your option)
16 # any later version.
17 #
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 # GNU General Public License for more details.
22 #
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 PACKAGE = @PACKAGE@
28 VERSION = @VERSION@
29
30 SHELL = @SHELL@
31 @SET_MAKE@
32
33 srcdir = @srcdir@
34 top_srcdir = @top_srcdir@
35 VPATH = @srcdir@
36
37 prefix = @prefix@
38 exec_prefix = @exec_prefix@
39 datadir = $(prefix)/@DATADIRNAME@
40 localedir = @LOCALEDIR@
41 gnulocaledir = @LOCALEDIR@
42 subdir = po
43
44 INSTALL = @INSTALL@
45 #INSTALL_DATA = @INSTALL_DATA@
46 INSTALL_DATA = @INSTALL@ -m 644
47
48 CC = @CC@
49 GMSGFMT = @GMSGFMT@
50 MSGFMT = @MSGFMT@
51 XGETTEXT = @XGETTEXT@
52 MSGMERGE = @MSGMERGE@
53
54 DEFS = @DEFS@
55 CFLAGS = @CFLAGS@
56 CPPFLAGS = @CPPFLAGS@
57
58 INCLUDES = -I..
59
60 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
61
62 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot
63
64 POTFILES = \
65
66 CATALOGS = @CATALOGS@
67 CATOBJEXT = @CATOBJEXT@
68 INSTOBJEXT = @INSTOBJEXT@
69
70 .SUFFIXES:
71 .SUFFIXES: .c .o .po .pox .gmo .mo .msg
72
73 .c.o:
74         $(COMPILE) $<
75
76 .po.pox:
77         $(MAKE) $(PACKAGE).pot
78         $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
79
80 .po.mo:
81         $(MSGFMT) -o $@ $<
82
83 .po.gmo:
84         file=`echo $* | sed 's,.*/,,'`.gmo \
85           && rm -f $$file && $(GMSGFMT) -o $$file $<
86
87
88
89 all: all-@USE_NLS@
90
91 all-yes: $(PACKAGE).pot $(CATALOGS)
92 all-no:
93         @echo "No support for NLS requested"
94
95 $(PACKAGE).pot: $(POTFILES)
96         if test -n "$(XGETTEXT)"; then \
97                 $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(srcdir)/.. \
98                        --c++ --keyword=_  --files-from=$(srcdir)/POTFILES.in; \
99                 mv $(PACKAGE).po $(PACKAGE).pot; \
100         else \
101                 echo "xgettext not available: $(PACKAGE).pot not updated" 1>&2; \
102         fi
103
104
105 install: install-exec install-data
106 install-exec:
107 install-data: install-data-@USE_NLS@
108 install-data-no: all
109 install-data-yes: all
110         ${SHELL} $(top_srcdir)/mkinstalldirs $(datadir); \
111         catalogs='$(CATALOGS)'; \
112         for cat in $$catalogs; do \
113           case "$$cat" in \
114             *.gmo) destdir=$(gnulocaledir);; \
115             *)     destdir=$(localedir);; \
116           esac; \
117           lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
118           dir=$$destdir/$$lang/LC_MESSAGES; \
119           ${SHELL} $(top_srcdir)/mkinstalldirs $$dir; \
120           if test -r $$cat; then \
121             $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
122             echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
123           else \
124             $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
125             echo "installing $(srcdir)/$$cat as" \
126                  "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
127           fi; \
128           if test -r $$cat.m; then \
129             $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
130             echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
131           else \
132             if test -r $(srcdir)/$$cat.m ; then \
133               $(INSTALL_DATA) $(srcdir)/$$cat.m \
134                 $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
135               echo "installing $(srcdir)/$$cat as" \
136                    "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
137             else \
138               true; \
139             fi; \
140           fi; \
141         done
142
143 # Define this as empty until I found a useful application.
144 installcheck:
145
146 uninstall:
147         catalogs='$(CATALOGS)'; \
148         for cat in $$catalogs; do \
149           lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
150           rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
151           rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
152           rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
153           rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
154         done
155         rm -f $(gettextsrcdir)/po-Makefile.in.in
156
157 check: all
158
159 dvi info tags TAGS ID:
160
161 mostlyclean:
162         rm -f core core.* *.pox *.old.po *.gmo
163         rm -fr *.o *~
164
165 clean: mostlyclean
166
167 distclean: clean
168         rm -f Makefile Makefile.in POTFILES *.mo *.gmo *.msg *.cat.m $(PACKAGE).pot
169
170 maintainer-clean: distclean
171         @echo "This command is intended for maintainers to use;"
172         @echo "it deletes files that may require special tools to rebuild."
173
174 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
175 dist distdir: update-po $(DISTFILES)
176         dists="$(DISTFILES)"; \
177         for file in $$dists; do \
178           ln $(srcdir)/$$file $(distdir) 2> /dev/null \
179             || cp -p $(srcdir)/$$file $(distdir); \
180         done
181
182 update-po: Makefile
183         $(MAKE) $(PACKAGE).pot
184         PATH=`pwd`/../src:$$PATH; \
185         cd $(srcdir); \
186         catalogs='$(CATALOGS)'; \
187         for cat in $$catalogs; do \
188           lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
189           mv $$lang.po $$lang.old.po; \
190           echo "$$lang:"; \
191           if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
192             rm -f $$lang.old.po; \
193           else \
194             echo "msgmerge for $$cat failed!"; \
195             rm -f $$lang.po; \
196             mv $$lang.old.po $$lang.po; \
197           fi; \
198         done
199
200 POTFILES: POTFILES.in
201         ( if test 'x$(srcdir)' != 'x.'; then \
202             posrcprefix='$(top_srcdir)/'; \
203           else \
204             posrcprefix="../"; \
205           fi; \
206           sed -e '/^#/d' -e '/^[        ]*$$/d' \
207               -e "s@.*@ $$posrcprefix& \\\\@" \
208               -e '$$s/\(.*\) \\/\1/' < $(srcdir)/POTFILES.in > POTFILES )
209
210 #Makefile: Makefile.in.in ../config.status POTFILES
211 #       cd .. \
212 #         && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
213 #              $(SHELL) ./config.status
214
215 # Tell versions [3.59,3.63) of GNU make not to export all variables.
216 # Otherwise a system limit (for SysV at least) may be exceeded.
217 .NOEXPORT: