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>
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.
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/
12
# - Modified by jacob berkman <jacob@ximian.com> to install
13
# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
15
# - Modified by Rodney Dawes <dobey@novell.com> for use with intltool
17
# We have the following line for use by intltoolize:
20
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
28
top_srcdir = @top_srcdir@
33
exec_prefix = @exec_prefix@
35
datarootdir = @datarootdir@
37
localedir = $(libdir)/locale
38
gnulocaledir = $(datadir)/locale
39
gettextsrcdir = $(datadir)/glib-2.0/gettext/po
41
install_sh = @install_sh@
42
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
45
INSTALL_DATA = @INSTALL_DATA@
51
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
52
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
53
MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
54
GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
60
INCLUDES = -I.. -I$(top_srcdir)/intl
62
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
67
DISTFILES = ChangeLog Makefile.in.in POTFILES.in \
69
EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
74
CATOBJEXT = @CATOBJEXT@
77
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
83
$(MAKE) $(GETTEXT_PACKAGE).pot
84
$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
90
file=`echo $* | sed 's,.*/,,'`.gmo \
91
&& rm -f $$file && $(GMSGFMT) -o $$file $<
94
sed -f ../intl/po2msg.sed < $< > $*.msg \
95
&& rm -f $@ && gencat $@ $*.msg
103
$(GETTEXT_PACKAGE).pot: $(POTFILES)
106
install: install-exec install-data
108
install-data: install-data-@USE_NLS@
110
install-data-yes: all
111
if test -n "$(MKINSTALLDIRS)"; then \
112
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
114
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
116
@catalogs='$(CATALOGS)'; \
117
for cat in $$catalogs; do \
118
cat=`basename $$cat`; \
120
*.gmo) destdir=$(gnulocaledir);; \
121
*) destdir=$(localedir);; \
123
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
124
dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
125
if test -n "$(MKINSTALLDIRS)"; then \
126
$(MKINSTALLDIRS) $$dir; \
128
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
130
if test -r $$cat; then \
131
$(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE).mo; \
132
echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE).mo"; \
134
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE).mo; \
135
echo "installing $(srcdir)/$$cat as" \
136
"$$dir/$(GETTEXT_PACKAGE).mo"; \
138
if test -r $$cat.m; then \
139
$(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
140
echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
142
if test -r $(srcdir)/$$cat.m ; then \
143
$(INSTALL_DATA) $(srcdir)/$$cat.m \
144
$$dir/$(GETTEXT_PACKAGE).mo.m; \
145
echo "installing $(srcdir)/$$cat as" \
146
"$$dir/$(GETTEXT_PACKAGE).mo.m"; \
152
if test "$(PACKAGE)" = "glib"; then \
153
if test -n "$(MKINSTALLDIRS)"; then \
154
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
156
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
158
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
159
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
164
# Define this as empty until I found a useful application.
168
catalogs='$(CATALOGS)'; \
169
for cat in $$catalogs; do \
170
cat=`basename $$cat`; \
171
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
172
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
173
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
174
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
175
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
177
if test "$(PACKAGE)" = "glib"; then \
178
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
181
check: all $(GETTEXT_PACKAGE).pot
183
dvi info tags TAGS ID:
186
rm -f core core.* *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
188
rm -f .intltool-merge-cache
193
rm -f Makefile Makefile.in POTFILES
194
rm -f *.mo *.msg *.cat *.cat.m $(GMOFILES)
196
maintainer-clean: distclean
197
@echo "This command is intended for maintainers to use;"
198
@echo "it deletes files that may require special tools to rebuild."
201
distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
202
dist distdir: $(DISTFILES)
203
dists="$(DISTFILES)"; \
204
extra_dists="$(EXTRA_DISTFILES)"; \
205
for file in $$extra_dists; do \
206
test -f $$file && dists="$$dists $$file"; \
208
for file in $$dists; do \
209
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
210
|| cp -p $(srcdir)/$$file $(distdir); \
214
$(MAKE) $(GETTEXT_PACKAGE).pot
216
catalogs='$(CATALOGS)'; \
217
for cat in $$catalogs; do \
218
cat=`basename $$cat`; \
219
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
221
result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
223
if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
224
rm -f $$tmpdir/$$lang.new.po; \
226
if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
229
echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
230
rm -f $$tmpdir/$$lang.new.po; \
235
echo "msgmerge for $$cat failed!"; \
236
rm -f $$tmpdir/$$lang.new.po; \
240
# POTFILES is created from POTFILES.in by stripping comments, empty lines
241
# and Intltool tags (enclosed in square brackets), and appending a full
242
# relative path to them
243
POTFILES: POTFILES.in
244
( posrcprefix='$(top_srcdir)/'; \
249
-e "s@^@ $$posrcprefix@" $(srcdir)/$@.in \
250
| sed -e '$$!s/$$/ \\/') > $@-t \
254
Makefile: Makefile.in.in ../config.status POTFILES
256
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
257
$(SHELL) ./config.status
259
# Tell versions [3.59,3.63) of GNU make not to export all variables.
260
# Otherwise a system limit (for SysV at least) may be exceeded.