]> git.lyx.org Git - lyx.git/blob - po/Makefile.in.in
Remove unused nopos_ mamber variable.
[lyx.git] / po / Makefile.in.in
1 # Makefile for program source directory in GNU NLS utilities package.
2 # Copyright (C) 1995-1997, 2000, 2001 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 PACKAGE = @PACKAGE@
10 VERSION = @VERSION@
11
12 # These two variables depend on the location of this directory.
13 subdir = po
14 top_builddir = ..
15
16 SHELL = /bin/sh
17 @SET_MAKE@
18
19 srcdir = @srcdir@
20 top_srcdir = @top_srcdir@
21 VPATH = @srcdir@
22
23 prefix = @prefix@
24 exec_prefix = @exec_prefix@
25 datadir = @datadir@
26 localedir = $(datadir)/locale
27 gettextsrcdir = $(datadir)/gettext/po
28
29 INSTALL = @INSTALL@
30 INSTALL_DATA = @INSTALL_DATA@
31 MKINSTALLDIRS = @MKINSTALLDIRS@
32 mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
33
34 CC = @CC@
35 GMSGFMT = @GMSGFMT@
36 MSGFMT = @MSGFMT@
37 XGETTEXT = @XGETTEXT@
38 MSGMERGE = msgmerge
39
40 DEFS = @DEFS@
41 CFLAGS = @CFLAGS@
42 CPPFLAGS = @CPPFLAGS@
43
44 INCLUDES = -I.. -I$(top_srcdir)/intl
45
46 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
47
48 POFILES = @POFILES@
49 GMOFILES = @GMOFILES@
50 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
51 $(POFILES) $(GMOFILES) xforms_l10n.pot qt_l10n.pot layouts_l10n.pot \
52 languages_l10n.pot ui_l10n.pot
53
54 POTFILE_IN_DEPS = $(shell find $(top_srcdir)/src -name Makefile.am)
55
56 POTFILES = \
57
58 CATALOGS = @CATALOGS@
59
60 .SUFFIXES:
61 .SUFFIXES: .c .o .po .pox .gmo .mo
62
63 .c.o:
64         $(COMPILE) $<
65
66 .po.pox:
67         $(MAKE) $(srcdir)/$(PACKAGE).pot
68         $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
69
70 .po.mo:
71         $(MSGFMT) -o $@ $<
72
73 .po.gmo:
74         file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
75           && case "$(GMSGFMT)" in \
76                */msgfmt) rm -f $$file && $(GMSGFMT) --statistics -o $$file $<;; \
77                *) touch $$file ;; \
78              esac
79
80
81 all: all-@USE_NLS@
82
83 all-yes: $(CATALOGS)
84 all-no:
85
86 # Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
87 # otherwise packages like GCC can not be built if only parts of the source
88 # have been downloaded.
89
90 $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in l10n_pots
91         $(XGETTEXT) --join-existing --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
92           --escape --add-comments --keyword=_ --keyword=N_ \
93           --keyword=qt_ --files-from=$(srcdir)/POTFILES.in \
94         && test ! -f $(PACKAGE).po \
95            || ( rm -f $(srcdir)/$(PACKAGE).pot \
96                 && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot || true)
97
98 install: install-exec install-data
99 install-exec:
100 install-data: install-data-@USE_NLS@
101         if test "$(PACKAGE)" = "gettext"; then \
102           $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
103           $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
104                           $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
105         else \
106           : ; \
107         fi
108 install-data-no: all
109 install-data-yes: all
110         $(mkinstalldirs) $(DESTDIR)$(datadir)
111         @catalogs='$(CATALOGS)'; \
112         for cat in $$catalogs; do \
113           cat=`basename $$cat`; \
114           lang=`echo $$cat | sed 's/\.gmo$$//'`; \
115           dir=$(localedir)/$$lang/LC_MESSAGES; \
116           $(mkinstalldirs) $(DESTDIR)$$dir; \
117           if test -r $$cat; then \
118             $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
119             echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
120           else \
121             $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
122             echo "installing $(srcdir)/$$cat as" \
123                  "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
124           fi; \
125         done
126
127 # Define this as empty until I found a useful application.
128 installcheck:
129
130 uninstall:
131         catalogs='$(CATALOGS)'; \
132         for cat in $$catalogs; do \
133           cat=`basename $$cat`; \
134           lang=`echo $$cat | sed 's/\.gmo$$//'`; \
135           rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
136         done
137         if test "$(PACKAGE)" = "gettext"; then \
138           rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
139         else \
140           : ; \
141         fi
142
143 check: all
144
145 dvi info tags TAGS ID:
146
147 mostlyclean:
148         rm -f core core.* *.pox $(PACKAGE).po *.new.po
149         rm -fr *.o
150
151 clean: mostlyclean
152
153 distclean: clean
154         rm -f Makefile Makefile.in POTFILES *.mo
155
156 maintainer-clean: distclean
157         @echo "This command is intended for maintainers to use;"
158         @echo "it deletes files that may require special tools to rebuild."
159         rm -f $(GMOFILES)
160
161 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
162 dist distdir:
163         $(MAKE) update-po
164         @$(MAKE) dist2
165 # This is a separate target because 'update-po' must be executed before.
166 dist2: $(DISTFILES)
167         dists="$(DISTFILES)"; \
168         for file in $$dists; do \
169           if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
170           cp -p $$dir/$$file $(distdir); \
171         done
172
173 update-po: Makefile
174         $(MAKE) $(PACKAGE).pot
175         if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
176         cd $(srcdir); \
177         catalogs='$(GMOFILES)'; \
178         for cat in $$catalogs; do \
179           cat=`basename $$cat`; \
180           lang=`echo $$cat | sed 's/\.gmo$$//'`; \
181           echo "$$lang:"; \
182           if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
183             mv -f $$lang.new.po $$lang.po; \
184           else \
185             echo "msgmerge for $$cat failed!"; \
186             rm -f $$lang.new.po; \
187           fi; \
188         done
189         $(MAKE) update-gmo
190
191 update-gmo: Makefile $(GMOFILES)
192         @:
193
194 Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
195         cd $(top_builddir) \
196           && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
197                $(SHELL) ./config.status
198
199 ${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS)
200         LC_ALL=C ; export LC_ALL ; \
201         rm -f $@-t \
202         && ( cd $(top_srcdir); \
203              grep -l "_(\".*\")" `find src -name \*.[hHC] -print` |\
204              sed -e '/xforms.forms/d' | \
205              sort | uniq ) > $@-t \
206         && mv $@-t $@
207
208
209 l10n_pots: $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/ui_l10n.pot
210         cat $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/ui_l10n.pot | \
211         msguniq -o $(PACKAGE).po
212
213 $(srcdir)/xforms_l10n.pot: $(top_srcdir)/src/frontends/xforms/forms/*.fd
214         cd ${srcdir} ; \
215         LC_ALL=C ; export LC_ALL ; \
216         awk ' \
217              BEGIN { \
218                      print "#, fuzzy"; \
219                      print "msgid \"\""; \
220                      print "msgstr \"\""; \
221                      print "\"Content-Type: text/plain; charset=ISO-8859-1\\n\""; \
222                      print "\"Content-Transfer-Encoding: 8bit\\n\""; \
223                      print "\n"; \
224                      skip=0; \
225              } \
226              /style: 15/ { \
227                      skip=1; \
228              } \
229              /label: / { \
230                      if (NF > 1 && skip == 0) { \
231                              line=$$0;\
232                              sub(/label: /,"",line);\
233                              printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", FILENAME, FNR, line);\
234                      }\
235                      skip=0; \
236              }' \
237           ../src/frontends/xforms/forms/*.fd > xforms_l10n.pot
238
239 $(srcdir)/qt_l10n.pot: $(top_srcdir)/src/frontends/qt2/ui/*.ui
240         cd ${srcdir} ; \
241         LC_ALL=C ; export LC_ALL ; \
242         awk ' \
243              /<string>/ { \
244                      line=$$0; \
245                      sub(/.*<string>/, "", line); \
246                      sub(/<\/string>.*/, "", line); \
247                      gsub(/&amp;/, "\\&", line); \
248                      gsub(/&lt;/, "<", line); \
249                      gsub(/&gt;/, ">", line); \
250                      gsub(/\"/, "\\\"", line); \
251                      if (length(line) > 0) \
252                              printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n",\
253                      FILENAME, FNR, line); \
254              }' \
255           ../src/frontends/qt2/ui/*.ui > qt_l10n.pot
256
257 $(srcdir)/layouts_l10n.pot: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc
258         cd ${srcdir} ; \
259         LC_ALL=C ; export LC_ALL ; \
260         awk ' \
261             /^Style / { \
262                 line=$$0; \
263                 sub(/Style /, "", line); \
264                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
265                        FILENAME, FNR, line); \
266             } \
267             /GuiName/ { \
268                 line=$$0; \
269                 sub(/[[:space:]]*GuiName[[:space:]]*/, "", line); \
270                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
271                        FILENAME, FNR, line); \
272             } \
273             ' ../lib/layouts/*.layout ../lib/layouts/*.inc > layouts_l10n.pot
274
275 $(srcdir)/languages_l10n.pot: $(top_srcdir)/lib/languages
276         cd ${srcdir} ; \
277         awk ' \
278             /^#/ { \
279                 next; \
280             } \
281             { \
282                 match($$0,"\"[^\"]*\""); \
283                 lang=substr($$0,RSTART,RLENGTH); \
284                 gsub(/\"/, "", lang); \
285                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
286                        FILENAME, FNR, lang); \
287             } \
288             '  ../lib/languages > languages_l10n.pot
289
290 $(srcdir)/ui_l10n.pot: $(top_srcdir)/lib/ui/*.ui
291         cd ${srcdir} ; \
292         LC_ALL=C ; export LC_ALL ; \
293         awk ' \
294             /^[^#]*Submenu/ { \
295                 line=$$0; \
296                 sub(/[^"]*"/, "", line); \
297                 sub(/".*/, "", line); \
298                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
299                        FILENAME, FNR, line); \
300             } \
301             /^[^#]*Toolbar/ { \
302                 line=$$0; \
303                 sub(/[^"]*"/, "", line); \
304                 sub(/".*/, "", line); \
305                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
306                        FILENAME, FNR, line); \
307             } \
308             /^[^#]*Item/ { \
309                 line=$$0; \
310                 sub(/[^"]*"/, "", line); \
311                 sub(/".*/, "", line); \
312                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
313                        FILENAME, FNR, line); \
314             } \
315             ' ../lib/ui/*.ui > ui_l10n.pot
316
317 # Tell versions [3.59,3.63) of GNU make not to export all variables.
318 # Otherwise a system limit (for SysV at least) may be exceeded.
319 .NOEXPORT: