]> git.lyx.org Git - lyx.git/blob - po/Makefile.in.in
2802a8808c54a44e153cc1a4a45bfa3bec25273e
[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 default_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         rm -f $@-t \
201         && ( cd $(top_srcdir); \
202              grep -l "_(\".*\")" `find src -name \*.[hHC] -print` |\
203              sed -e '/xforms.forms/d' | \
204              sort | uniq ) > $@-t \
205         && mv $@-t $@
206
207
208 l10n_pots: $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/default_ui_l10n.pot
209         cat $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/default_ui_l10n.pot | \
210         msguniq -o $(PACKAGE).po
211
212 $(srcdir)/xforms_l10n.pot: $(top_srcdir)/src/frontends/xforms/forms/*.fd
213         awk ' \
214              BEGIN { \
215                      print "#, fuzzy"; \
216                      print "msgid \"\""; \
217                      print "msgstr \"\""; \
218                      print "\"Content-Type: text/plain; charset=ISO-8859-1\\n\""; \
219                      print "\"Content-Transfer-Encoding: 8bit\\n\""; \
220                      print "\n"; \
221              } \
222              /label: / { \
223                      if (NF > 1) { \
224                              line=$$0;\
225                              sub(/label: /,"",line);\
226                              printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", FILENAME, FNR, line);\
227                      }\
228              }' \
229         `find $(top_srcdir)/src/frontends/xforms/forms -name \*.fd` > $@
230
231 $(srcdir)/qt_l10n.pot: $(top_srcdir)/src/frontends/qt2/ui/*.ui
232         awk ' \
233              /<string>/ { \
234                      line=$$0; \
235                      sub(/.*<string>/, "", line); \
236                      sub(/<\/string>.*/, "", line); \
237                      gsub(/&amp;/, "\\&", line); \
238                      gsub(/&lt;/, "<", line); \
239                      gsub(/&gt;/, ">", line); \
240                      if (length(line) > 0) \
241                              printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n",\
242                      FILENAME, FNR, line); \
243              }' \
244         `find $(top_srcdir)/src/frontends/qt2/ui -name \*.ui` > $@
245
246 $(srcdir)/layouts_l10n.pot: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc
247         awk ' \
248             /^Style / { \
249                 line=$$0; \
250                 sub(/Style /, "", line); \
251                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
252                        FILENAME, FNR, line); \
253             } \
254             /GuiName/ { \
255                 line=$$0; \
256                 sub(/[[:space:]]*GuiName[[:space:]]*/, "", line); \
257                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
258                        FILENAME, FNR, line); \
259             } \
260             ' `find $(top_srcdir)/lib/layouts -regex ".*\.\(layout\|inc\)"` > $@
261
262 $(srcdir)/languages_l10n.pot: $(top_srcdir)/lib/languages
263         awk ' \
264             /^#/ { \
265                 next; \
266             } \
267             { \
268                 lang=$$3; \
269                 gsub(/\"/, "", lang); \
270                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
271                        FILENAME, FNR, lang); \
272             } \
273             '  $(top_srcdir)/lib/languages > $@
274
275 $(srcdir)/default_ui_l10n.pot: $(top_srcdir)/lib/ui/default.ui
276         awk ' \
277             /^[^#]*Submenu/ { \
278                 line=$$0; \
279                 sub(/[^"]*"/, "", line); \
280                 sub(/".*/, "", line); \
281                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
282                        FILENAME, FNR, line); \
283             } \
284             /^[^#]*Item/ { \
285                 line=$$0; \
286                 sub(/[^"]*"/, "", line); \
287                 sub(/".*/, "", line); \
288                 printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
289                        FILENAME, FNR, line); \
290             } \
291             ' $(top_srcdir)/lib/ui/default.ui > $@
292
293 # Tell versions [3.59,3.63) of GNU make not to export all variables.
294 # Otherwise a system limit (for SysV at least) may be exceeded.
295 .NOEXPORT: