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