1 | # Makefile for program source directory in GNU NLS utilities package. |
---|
2 | # Copyright (C) 1995, 1996, 1997 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 | # - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE |
---|
10 | # instead of PACKAGE and to look for po2tbl in ./ not in intl/ |
---|
11 | # |
---|
12 | # - Modified by jacob berkman <jacob@ximian.com> to install |
---|
13 | # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize |
---|
14 | |
---|
15 | GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ |
---|
16 | PACKAGE = @PACKAGE@ |
---|
17 | VERSION = @VERSION@ |
---|
18 | |
---|
19 | SHELL = /bin/sh |
---|
20 | @SET_MAKE@ |
---|
21 | |
---|
22 | srcdir = @srcdir@ |
---|
23 | top_srcdir = @top_srcdir@ |
---|
24 | top_builddir = .. |
---|
25 | VPATH = @srcdir@ |
---|
26 | |
---|
27 | prefix = @prefix@ |
---|
28 | exec_prefix = @exec_prefix@ |
---|
29 | datadir = @datadir@ |
---|
30 | libdir = @libdir@ |
---|
31 | localedir = $(libdir)/locale |
---|
32 | gnulocaledir = $(datadir)/locale |
---|
33 | gettextsrcdir = $(datadir)/glib-2.0/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 = @GMSGFMT@ |
---|
43 | MSGFMT = @MSGFMT@ |
---|
44 | XGETTEXT = @XGETTEXT@ |
---|
45 | INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ |
---|
46 | INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ |
---|
47 | MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist |
---|
48 | GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot |
---|
49 | |
---|
50 | DEFS = @DEFS@ |
---|
51 | CFLAGS = @CFLAGS@ |
---|
52 | CPPFLAGS = @CPPFLAGS@ |
---|
53 | |
---|
54 | INCLUDES = -I.. -I$(top_srcdir)/intl |
---|
55 | |
---|
56 | COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) |
---|
57 | |
---|
58 | SOURCES = |
---|
59 | POFILES = @POFILES@ |
---|
60 | GMOFILES = @GMOFILES@ |
---|
61 | DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \ |
---|
62 | $(POFILES) $(GMOFILES) $(SOURCES) |
---|
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 .cat |
---|
72 | |
---|
73 | .c.o: |
---|
74 | $(COMPILE) $< |
---|
75 | |
---|
76 | .po.pox: |
---|
77 | $(MAKE) $(GETTEXT_PACKAGE).pot |
---|
78 | $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*pox |
---|
79 | |
---|
80 | .po.mo: |
---|
81 | $(MSGFMT) -o $@ $< |
---|
82 | |
---|
83 | .po.gmo: |
---|
84 | file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ |
---|
85 | && rm -f $$file && $(GMSGFMT) -o $$file $< |
---|
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: $(CATALOGS) |
---|
95 | all-no: |
---|
96 | |
---|
97 | $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) |
---|
98 | $(GENPOT) |
---|
99 | |
---|
100 | install: install-exec install-data |
---|
101 | install-exec: |
---|
102 | install-data: install-data-@USE_NLS@ |
---|
103 | install-data-no: all |
---|
104 | install-data-yes: all |
---|
105 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
106 | $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ |
---|
107 | else \ |
---|
108 | $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ |
---|
109 | fi |
---|
110 | @catalogs='$(CATALOGS)'; \ |
---|
111 | for cat in $$catalogs; do \ |
---|
112 | cat=`basename $$cat`; \ |
---|
113 | case "$$cat" in \ |
---|
114 | *.gmo) destdir=$(gnulocaledir);; \ |
---|
115 | *) destdir=$(localedir);; \ |
---|
116 | esac; \ |
---|
117 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
118 | dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ |
---|
119 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
120 | $(MKINSTALLDIRS) $$dir; \ |
---|
121 | else \ |
---|
122 | $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ |
---|
123 | fi; \ |
---|
124 | if test -r $$cat; then \ |
---|
125 | $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
126 | echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ |
---|
127 | else \ |
---|
128 | $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
129 | echo "installing $(srcdir)/$$cat as" \ |
---|
130 | "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ |
---|
131 | fi; \ |
---|
132 | if test -r $$cat.m; then \ |
---|
133 | $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
134 | echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ |
---|
135 | else \ |
---|
136 | if test -r $(srcdir)/$$cat.m ; then \ |
---|
137 | $(INSTALL_DATA) $(srcdir)/$$cat.m \ |
---|
138 | $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
139 | echo "installing $(srcdir)/$$cat as" \ |
---|
140 | "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ |
---|
141 | else \ |
---|
142 | true; \ |
---|
143 | fi; \ |
---|
144 | fi; \ |
---|
145 | done |
---|
146 | if test "$(PACKAGE)" = "glib"; then \ |
---|
147 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
148 | $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ |
---|
149 | else \ |
---|
150 | $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ |
---|
151 | fi; \ |
---|
152 | $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ |
---|
153 | $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ |
---|
154 | else \ |
---|
155 | : ; \ |
---|
156 | fi |
---|
157 | |
---|
158 | # Define this as empty until I found a useful application. |
---|
159 | installcheck: |
---|
160 | |
---|
161 | uninstall: |
---|
162 | catalogs='$(CATALOGS)'; \ |
---|
163 | for cat in $$catalogs; do \ |
---|
164 | cat=`basename $$cat`; \ |
---|
165 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
166 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
167 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
168 | rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
169 | rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
170 | done |
---|
171 | if test "$(PACKAGE)" = "glib"; then \ |
---|
172 | rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ |
---|
173 | fi |
---|
174 | |
---|
175 | check: all |
---|
176 | |
---|
177 | dvi info tags TAGS ID: |
---|
178 | |
---|
179 | mostlyclean: |
---|
180 | rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp |
---|
181 | rm -fr *.o |
---|
182 | rm -f .intltool-merge-cache |
---|
183 | |
---|
184 | clean: mostlyclean |
---|
185 | |
---|
186 | distclean: clean |
---|
187 | rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m |
---|
188 | |
---|
189 | maintainer-clean: distclean |
---|
190 | @echo "This command is intended for maintainers to use;" |
---|
191 | @echo "it deletes files that may require special tools to rebuild." |
---|
192 | rm -f $(GMOFILES) |
---|
193 | |
---|
194 | distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) |
---|
195 | dist distdir: update-po $(DISTFILES) |
---|
196 | dists="$(DISTFILES)"; \ |
---|
197 | for file in $$dists; do \ |
---|
198 | ln $(srcdir)/$$file $(distdir) 2> /dev/null \ |
---|
199 | || cp -p $(srcdir)/$$file $(distdir); \ |
---|
200 | done |
---|
201 | |
---|
202 | update-po: Makefile |
---|
203 | $(MAKE) $(GETTEXT_PACKAGE).pot |
---|
204 | tmpdir=`pwd`; \ |
---|
205 | cd $(srcdir); \ |
---|
206 | catalogs='$(CATALOGS)'; \ |
---|
207 | for cat in $$catalogs; do \ |
---|
208 | cat=`basename $$cat`; \ |
---|
209 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
210 | echo "$$lang:"; \ |
---|
211 | if $$tmpdir/$(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist -o $$tmpdir/$$lang.new.po $$lang; then \ |
---|
212 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ |
---|
213 | rm -f $$tmpdir/$$lang.new.po; \ |
---|
214 | else \ |
---|
215 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ |
---|
216 | :; \ |
---|
217 | else \ |
---|
218 | echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ |
---|
219 | rm -f $$tmpdir/$$lang.new.po; \ |
---|
220 | exit 1; \ |
---|
221 | fi; \ |
---|
222 | fi; \ |
---|
223 | else \ |
---|
224 | echo "msgmerge for $$cat failed!"; \ |
---|
225 | rm -f $$tmpdir/$$lang.new.po; \ |
---|
226 | fi; \ |
---|
227 | done |
---|
228 | |
---|
229 | # POTFILES is created from POTFILES.in by stripping comments, empty lines |
---|
230 | # and Intltool tags (enclosed in square brackets), and appending a full |
---|
231 | # relative path to them |
---|
232 | POTFILES: POTFILES.in |
---|
233 | ( if test 'x$(srcdir)' != 'x.'; then \ |
---|
234 | posrcprefix='$(top_srcdir)/'; \ |
---|
235 | else \ |
---|
236 | posrcprefix="../"; \ |
---|
237 | fi; \ |
---|
238 | rm -f $@-t $@ \ |
---|
239 | && (sed -e '/^#/d' \ |
---|
240 | -e "s/^\[.*\] +//" \ |
---|
241 | -e '/^[ ]*$$/d' \ |
---|
242 | -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ |
---|
243 | | sed -e '$$s/\\$$//') > $@-t \ |
---|
244 | && chmod a-w $@-t \ |
---|
245 | && mv $@-t $@ ) |
---|
246 | |
---|
247 | Makefile: Makefile.in.in ../config.status POTFILES |
---|
248 | cd .. \ |
---|
249 | && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ |
---|
250 | $(SHELL) ./config.status |
---|
251 | |
---|
252 | # Tell versions [3.59,3.63) of GNU make not to export all variables. |
---|
253 | # Otherwise a system limit (for SysV at least) may be exceeded. |
---|
254 | .NOEXPORT: |
---|