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@
27
exec_prefix = @exec_prefix@
30
localedir = @localedir@
31
gnulocaledir = @localedir@
32
gettextsrcdir = $(datadir)/glib-2.0/gettext/po
36
INSTALL_DATA = @INSTALL_DATA@
37
MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
50
INCLUDES = -I.. -I$(top_srcdir)/intl
52
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
57
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
58
$(POFILES) $(GMOFILES) $(SOURCES)
63
CATOBJEXT = @CATOBJEXT@
64
INSTOBJEXT = @INSTOBJEXT@
67
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
73
$(MAKE) $(GETTEXT_PACKAGE).pot
74
$(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
80
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
81
&& rm -f $$file && $(GMSGFMT) -o $$file $<
84
sed -f ../intl/po2msg.sed < $< > $*.msg \
85
&& rm -f $@ && $(GENCAT) $@ $*.msg
93
$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
94
$(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
95
--add-comments --keyword=_ --keyword=N_ \
96
--files-from=$(srcdir)/POTFILES.in \
97
&& test ! -f $(GETTEXT_PACKAGE).po \
98
|| ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
99
&& mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
101
install: install-exec install-data
103
install-data: install-data-@USE_NLS@
105
install-data-yes: all
106
if test -r "$(MKINSTALLDIRS)"; then \
107
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
109
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
111
@catalogs='$(CATALOGS)'; \
112
for cat in $$catalogs; do \
113
cat=`basename $$cat`; \
115
*.gmo) destdir=$(gnulocaledir);; \
116
*) destdir=$(localedir);; \
118
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
119
dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
120
if test -r "$(MKINSTALLDIRS)"; then \
121
$(MKINSTALLDIRS) $$dir; \
123
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
125
if test -r $$cat; then \
126
$(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
127
echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
129
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
130
echo "installing $(srcdir)/$$cat as" \
131
"$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
133
if test -r $$cat.m; then \
134
$(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
135
echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
137
if test -r $(srcdir)/$$cat.m ; then \
138
$(INSTALL_DATA) $(srcdir)/$$cat.m \
139
$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
140
echo "installing $(srcdir)/$$cat as" \
141
"$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
147
if test "$(PACKAGE)" = "glib"; then \
148
if test -r "$(MKINSTALLDIRS)"; then \
149
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
151
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
153
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
154
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
159
# Define this as empty until I found a useful application.
163
catalogs='$(CATALOGS)'; \
164
for cat in $$catalogs; do \
165
cat=`basename $$cat`; \
166
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
167
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
168
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
169
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
170
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
172
rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
176
dvi info tags TAGS ID:
179
rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
185
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
187
maintainer-clean: distclean
188
@echo "This command is intended for maintainers to use;"
189
@echo "it deletes files that may require special tools to rebuild."
193
distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
194
dist distdir: $(DISTFILES)
195
dists="$(DISTFILES)"; \
196
for file in $$dists; do \
197
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
198
|| cp -p $(srcdir)/$$file $(distdir); \
202
$(MAKE) $(GETTEXT_PACKAGE).pot
204
catalogs='$(CATALOGS)'; \
205
for cat in $$catalogs; do \
206
cat=`basename $$cat`; \
207
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
208
mv $$lang.po $$lang.old.po; \
210
if $(MSGMERGE) $$lang.old.po $(GETTEXT_PACKAGE).pot -o $$lang.po; then \
211
rm -f $$lang.old.po; \
213
echo "msgmerge for $$cat failed!"; \
215
mv $$lang.old.po $$lang.po; \
219
# POTFILES is created from POTFILES.in by stripping comments, empty lines
220
# and Intltool tags (enclosed in square brackets), and appending a full
221
# relative path to them
222
POTFILES: POTFILES.in
223
( if test 'x$(srcdir)' != 'x.'; then \
224
posrcprefix='$(top_srcdir)/'; \
232
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
233
| sed -e '$$s/\\$$//') > $@-t \
237
Makefile: Makefile.in.in ../config.status POTFILES
239
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
240
$(SHELL) ./config.status
242
# Tell versions [3.59,3.63) of GNU make not to export all variables.
243
# Otherwise a system limit (for SysV at least) may be exceeded.