]> git.lyx.org Git - lyx.git/blob - po/Makefile.in.in
b16596ed94e982d3776d28e5f76ad6dcd42aa03c
[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)
52
53 POTFILE_IN_DEPS = $(shell find $(top_srcdir)/src -name Makefile.am)
54
55 POTFILES = \
56
57 CATALOGS = @CATALOGS@
58
59 .SUFFIXES:
60 .SUFFIXES: .c .o .po .pox .gmo .mo
61
62 .c.o:
63         $(COMPILE) $<
64
65 .po.pox:
66         $(MAKE) $(srcdir)/$(PACKAGE).pot
67         $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
68
69 .po.mo:
70         $(MSGFMT) -o $@ $<
71
72 .po.gmo:
73         file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
74           && case "$(GMSGFMT)" in \
75                */msgfmt) rm -f $$file && $(GMSGFMT) --statistics -o $$file $<;; \
76                *) touch $$file ;; \
77              esac
78
79
80 all: all-@USE_NLS@
81
82 all-yes: $(CATALOGS)
83 all-no:
84
85 # Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
86 # otherwise packages like GCC can not be built if only parts of the source
87 # have been downloaded.
88
89 $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in l10n_pots
90         $(XGETTEXT) --join-existing --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
91           --escape --add-comments --keyword=_ --keyword=N_ \
92           --files-from=$(srcdir)/POTFILES.in \
93         && test ! -f $(PACKAGE).po \
94            || ( rm -f $(srcdir)/$(PACKAGE).pot \
95                 && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
96
97 install: install-exec install-data
98 install-exec:
99 install-data: install-data-@USE_NLS@
100         if test "$(PACKAGE)" = "gettext"; then \
101           $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
102           $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
103                           $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
104         else \
105           : ; \
106         fi
107 install-data-no: all
108 install-data-yes: all
109         $(mkinstalldirs) $(DESTDIR)$(datadir)
110         @catalogs='$(CATALOGS)'; \
111         for cat in $$catalogs; do \
112           cat=`basename $$cat`; \
113           lang=`echo $$cat | sed 's/\.gmo$$//'`; \
114           dir=$(localedir)/$$lang/LC_MESSAGES; \
115           $(mkinstalldirs) $(DESTDIR)$$dir; \
116           if test -r $$cat; then \
117             $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
118             echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
119           else \
120             $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
121             echo "installing $(srcdir)/$$cat as" \
122                  "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
123           fi; \
124         done
125
126 # Define this as empty until I found a useful application.
127 installcheck:
128
129 uninstall:
130         catalogs='$(CATALOGS)'; \
131         for cat in $$catalogs; do \
132           cat=`basename $$cat`; \
133           lang=`echo $$cat | sed 's/\.gmo$$//'`; \
134           rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
135         done
136         if test "$(PACKAGE)" = "gettext"; then \
137           rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
138         else \
139           : ; \
140         fi
141
142 check: all
143
144 dvi info tags TAGS ID:
145
146 mostlyclean:
147         rm -f core core.* *.pox $(PACKAGE).po *.new.po
148         rm -fr *.o
149
150 clean: mostlyclean
151
152 distclean: clean
153         rm -f Makefile Makefile.in POTFILES *.mo
154
155 maintainer-clean: distclean
156         @echo "This command is intended for maintainers to use;"
157         @echo "it deletes files that may require special tools to rebuild."
158         rm -f $(GMOFILES)
159
160 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
161 dist distdir:
162         $(MAKE) update-po
163         @$(MAKE) dist2
164 # This is a separate target because 'update-po' must be executed before.
165 dist2: $(DISTFILES)
166         dists="$(DISTFILES)"; \
167         for file in $$dists; do \
168           if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
169           cp -p $$dir/$$file $(distdir); \
170         done
171
172 update-po: Makefile
173         $(MAKE) $(PACKAGE).pot
174         if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
175         cd $(srcdir); \
176         catalogs='$(GMOFILES)'; \
177         for cat in $$catalogs; do \
178           cat=`basename $$cat`; \
179           lang=`echo $$cat | sed 's/\.gmo$$//'`; \
180           echo "$$lang:"; \
181           if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
182             mv -f $$lang.new.po $$lang.po; \
183           else \
184             echo "msgmerge for $$cat failed!"; \
185             rm -f $$lang.new.po; \
186           fi; \
187         done
188         $(MAKE) update-gmo
189
190 update-gmo: Makefile $(GMOFILES)
191         @:
192
193 Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
194         cd $(top_builddir) \
195           && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
196                $(SHELL) ./config.status
197
198 ${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS)
199         rm -f $@-t \
200         && ( cd $(top_srcdir); \
201              grep -l "_(\".*\")" `find src -name \*.[hHC] -print` |\
202              sed -e '/xforms.forms/d' | \
203              sort -f -n | uniq ) > $@-t \
204         && echo "src/ext_l10n.h" >> $@-t \
205         && mv $@-t $@
206
207
208 l10n_pots: xforms_l10n.pot qt_l10n.pot layouts_l10n.pot languages_l10n.pot default_ui_l10n.pot
209         cat xforms_l10n.pot qt_l10n.pot layouts_l10n.pot languages_l10n.pot default_ui_l10n.pot | \
210         msguniq -o $(PACKAGE).po
211
212 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 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 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 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 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: