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