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@
31 datarootdir = @datarootdir@
33 localedir = $(libdir)/locale
34 gnulocaledir = $(datadir)/locale
35 gettextsrcdir = $(datadir)/glib-2.0/gettext/po
36 subdir = po-properties
37 install_sh = @install_sh@
38 mkdir_p = $(install_sh) -d
41 INSTALL_DATA = @INSTALL_DATA@
54 INCLUDES = -I.. -I$(top_srcdir)/intl
56 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
61 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
62 $(POFILES) $(GMOFILES) $(SOURCES)
67 CATOBJEXT = @CATOBJEXT@
68 INSTOBJEXT = @INSTOBJEXT@
71 .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
77 $(MAKE) $(GETTEXT_PACKAGE).pot
78 $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
84 file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
85 && rm -f $$file && $(GMSGFMT) -c -o $$file $<
88 sed -f ../intl/po2msg.sed < $< > $*.msg \
89 && rm -f $@ && $(GENCAT) $@ $*.msg
97 $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
98 $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
99 --add-comments --keyword --keyword=P_ \
101 --files-from=$(srcdir)/POTFILES.in \
102 && test ! -f $(GETTEXT_PACKAGE).po \
103 || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
104 && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
106 install: install-exec install-data
108 install-data: install-data-@USE_NLS@
110 install-data-yes: all
111 $(mkdir_p) $(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; \
122 if test -r $$cat; then \
123 $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
124 echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
126 $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
127 echo "installing $(srcdir)/$$cat as" \
128 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
130 if test -r $$cat.m; then \
131 $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
132 echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
134 if test -r $(srcdir)/$$cat.m ; then \
135 $(INSTALL_DATA) $(srcdir)/$$cat.m \
136 $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
137 echo "installing $(srcdir)/$$cat as" \
138 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
144 if test "$(PACKAGE)" = "glib"; then \
145 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
146 $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
147 $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
152 # Define this as empty until I found a useful application.
156 catalogs='$(CATALOGS)'; \
157 for cat in $$catalogs; do \
158 cat=`basename $$cat`; \
159 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
160 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
161 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
162 rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
163 rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
165 if test "$(PACKAGE)" = "glib"; then \
166 rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
171 dvi info tags TAGS ID:
174 rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
180 rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
182 maintainer-clean: distclean
183 @echo "This command is intended for maintainers to use;"
184 @echo "it deletes files that may require special tools to rebuild."
187 distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
188 dist distdir: $(DISTFILES)
189 dists="$(DISTFILES)"; \
190 for file in $$dists; do \
191 ln $(srcdir)/$$file $(distdir) 2> /dev/null \
192 || cp -p $(srcdir)/$$file $(distdir); \
196 $(MAKE) $(GETTEXT_PACKAGE).pot
199 catalogs='$(CATALOGS)'; \
200 for cat in $$catalogs; do \
201 cat=`basename $$cat`; \
202 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
204 if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
205 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
206 rm -f $$tmpdir/$$lang.new.po; \
208 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
211 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
212 rm -f $$tmpdir/$$lang.new.po; \
217 echo "msgmerge for $$cat failed!"; \
218 rm -f $$tmpdir/$$lang.new.po; \
222 # POTFILES is created from POTFILES.in by stripping comments, empty lines
223 # and Intltool tags (enclosed in square brackets), and appending a full
224 # relative path to them
225 POTFILES: POTFILES.in
226 ( if test 'x$(srcdir)' != 'x.'; then \
227 posrcprefix='$(top_srcdir)/'; \
235 -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
236 | sed -e '$$s/\\$$//') > $@-t \
240 Makefile: Makefile.in.in ../config.status POTFILES
242 && $(SHELL) ./config.status $(subdir)/$@.in
244 # Tell versions [3.59,3.63) of GNU make not to export all variables.
245 # Otherwise a system limit (for SysV at least) may be exceeded.