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
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
23
top_srcdir = @top_srcdir@
28
exec_prefix = @exec_prefix@
31
localedir = $(libdir)/locale
32
gnulocaledir = $(datadir)/locale
33
gettextsrcdir = $(datadir)/glib-2.0/gettext/po
35
install_sh = @install_sh@
37
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
40
INSTALL_DATA = @INSTALL_DATA@
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
56
INCLUDES = -I.. -I$(top_srcdir)/intl
58
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
63
DISTFILES = ChangeLog Makefile.in.in POTFILES.in \
64
$(POFILES) $(GMOFILES) $(SOURCES)
69
CATOBJEXT = @CATOBJEXT@
70
INSTOBJEXT = @INSTOBJEXT@
73
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
79
$(MAKE) $(GETTEXT_PACKAGE).pot
80
$(MSGMERGE) $< $(top_builddir)/po/$(GETTEXT_PACKAGE).pot -o $*pox
86
file=`echo $* | sed 's,.*/,,'`.gmo \
87
&& rm -f $$file && $(GMSGFMT) -o $$file $<
90
sed -f ../intl/po2msg.sed < $< > $*.msg \
91
&& rm -f $@ && $(GENCAT) $@ $*.msg
99
$(GETTEXT_PACKAGE).pot: $(POTFILES)
102
install: install-exec install-data
104
install-data: install-data-@USE_NLS@
106
install-data-yes: all
107
if test -n "$(MKINSTALLDIRS)"; then \
108
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
110
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
112
@catalogs='$(CATALOGS)'; \
113
for cat in $$catalogs; do \
114
cat=`basename $$cat`; \
116
*.gmo) destdir=$(gnulocaledir);; \
117
*) destdir=$(localedir);; \
119
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
120
dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
121
if test -n "$(MKINSTALLDIRS)"; then \
122
$(MKINSTALLDIRS) $$dir; \
124
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
126
if test -r $$cat; then \
127
$(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
128
echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
130
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
131
echo "installing $(srcdir)/$$cat as" \
132
"$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
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"; \
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"; \
148
if test "$(PACKAGE)" = "glib"; then \
149
if test -n "$(MKINSTALLDIRS)"; then \
150
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
152
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
154
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
155
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
160
# Define this as empty until I found a useful application.
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; \
173
if test "$(PACKAGE)" = "glib"; then \
174
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
179
dvi info tags TAGS ID:
182
rm -f core core.* *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
184
rm -f .intltool-merge-cache
189
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
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."
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); \
205
$(MAKE) $(GETTEXT_PACKAGE).pot
207
catalogs='$(CATALOGS)'; \
208
for cat in $$catalogs; do \
209
cat=`basename $$cat`; \
210
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
212
result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
214
if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
215
rm -f $$tmpdir/$$lang.new.po; \
217
if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
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; \
226
echo "msgmerge for $$cat failed!"; \
227
rm -f $$tmpdir/$$lang.new.po; \
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)/'; \
244
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
245
| sed -e '$$s/\\$$//') > $@-t \
249
Makefile: Makefile.in.in ../config.status POTFILES
251
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
252
$(SHELL) ./config.status
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.