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