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@-properties
19 XGETTEXT_KEYWORDS = --keyword --keyword=P_
25 top_srcdir = @top_srcdir@
29 exec_prefix = @exec_prefix@
32 localedir = $(libdir)/locale
33 gnulocaledir = $(datadir)/locale
34 gettextsrcdir = $(datadir)/glib-2.0/gettext/po
35 subdir = po-properties
36 install_sh = @install_sh@
37 mkdir_p = $(install_sh) -d
40 INSTALL_DATA = @INSTALL_DATA@
53 INCLUDES = -I.. -I$(top_srcdir)/intl
55 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
60 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
61 $(POFILES) $(GMOFILES) $(SOURCES)
66 CATOBJEXT = @CATOBJEXT@
67 INSTOBJEXT = @INSTOBJEXT@
70 .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
76 $(MAKE) $(GETTEXT_PACKAGE).pot
77 $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
83 file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
84 && rm -f $$file && $(GMSGFMT) -c -o $$file $<
87 sed -f ../intl/po2msg.sed < $< > $*.msg \
88 && rm -f $@ && $(GENCAT) $@ $*.msg
96 $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
97 $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
98 --add-comments --keyword --keyword=P_ \
99 --files-from=$(srcdir)/POTFILES.in \
100 && test ! -f $(GETTEXT_PACKAGE).po \
101 || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
102 && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
104 install: install-exec install-data
106 install-data: install-data-@USE_NLS@
108 install-data-yes: all
109 $(mkdir_p) $(DESTDIR)$(datadir); \
110 catalogs='$(CATALOGS)'; \
111 for cat in $$catalogs; do \
112 cat=`basename $$cat`; \
114 *.gmo) destdir=$(gnulocaledir);; \
115 *) destdir=$(localedir);; \
117 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
118 dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
120 if test -r $$cat; then \
121 $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
122 echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
124 $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
125 echo "installing $(srcdir)/$$cat as" \
126 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
128 if test -r $$cat.m; then \
129 $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
130 echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
132 if test -r $(srcdir)/$$cat.m ; then \
133 $(INSTALL_DATA) $(srcdir)/$$cat.m \
134 $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
135 echo "installing $(srcdir)/$$cat as" \
136 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
142 if test "$(PACKAGE)" = "glib"; then \
143 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
144 $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
145 $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
150 # Define this as empty until I found a useful application.
154 catalogs='$(CATALOGS)'; \
155 for cat in $$catalogs; do \
156 cat=`basename $$cat`; \
157 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
158 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
159 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
160 rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
161 rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
163 if test "$(PACKAGE)" = "glib"; then \
164 rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
169 dvi info tags TAGS ID:
172 rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
178 rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
180 maintainer-clean: distclean
181 @echo "This command is intended for maintainers to use;"
182 @echo "it deletes files that may require special tools to rebuild."
185 distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
186 dist distdir: update-po $(DISTFILES)
187 dists="$(DISTFILES)"; \
188 for file in $$dists; do \
189 ln $(srcdir)/$$file $(distdir) 2> /dev/null \
190 || cp -p $(srcdir)/$$file $(distdir); \
194 $(MAKE) $(GETTEXT_PACKAGE).pot
197 catalogs='$(CATALOGS)'; \
198 for cat in $$catalogs; do \
199 cat=`basename $$cat`; \
200 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
202 if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
203 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
204 rm -f $$tmpdir/$$lang.new.po; \
206 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
209 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
210 rm -f $$tmpdir/$$lang.new.po; \
215 echo "msgmerge for $$cat failed!"; \
216 rm -f $$tmpdir/$$lang.new.po; \
220 # POTFILES is created from POTFILES.in by stripping comments, empty lines
221 # and Intltool tags (enclosed in square brackets), and appending a full
222 # relative path to them
223 POTFILES: POTFILES.in
224 ( if test 'x$(srcdir)' != 'x.'; then \
225 posrcprefix='$(top_srcdir)/'; \
233 -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
234 | sed -e '$$s/\\$$//') > $@-t \
238 Makefile: Makefile.in.in ../config.status POTFILES
240 && $(SHELL) ./config.status $(subdir)/$@.in
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.