1 # Makefile for directory with message catalog handling in GNU NLS Utilities.
2 # Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 top_srcdir = @top_srcdir@
29 exec_prefix = @exec_prefix@
30 transform = @program_transform_name@
32 includedir = @includedir@
34 localedir = $(datadir)/locale
35 gettextsrcdir = $(datadir)/gettext/intl
36 aliaspath = $(localedir)
40 INSTALL_DATA = @INSTALL_DATA@
41 MKINSTALLDIRS = @MKINSTALLDIRS@
42 mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
44 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
50 YACC = @INTLBISON@ -y -d
51 YFLAGS = --name-prefix=__gettext
53 DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
54 -DLIBDIR=\"$(libdir)\" @DEFS@
59 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
61 HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h
62 COMHDRS = gettext.h gettextP.h hash-string.h
63 SOURCES = $(COMSRCS) intl-compat.c
64 COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
65 finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
66 explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
68 OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
69 finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
70 explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
71 plural.$lo localcharset.$lo
72 GETTOBJS = intl-compat.$lo
73 DISTFILES.common = Makefile.in \
74 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
75 DISTFILES.generated = plural.c
76 DISTFILES.normal = VERSION
77 DISTFILES.gettext = libintl.glibc
78 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c
80 # Libtool's library version information for libintl.
81 # Before making a gettext release, the gettext maintainer must change this
82 # according to the libtool documentation, section "Library interface versions".
83 # Maintainers of other packages that include the intl directory must *not*
84 # change these values.
90 .SUFFIXES: .c .y .o .lo .sin .sed
94 $(LIBTOOL) --mode=compile $(COMPILE) $<
97 $(YACC) $(YFLAGS) --output $@ $<
101 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
104 INCLUDES = -I.. -I. -I$(top_srcdir)/intl
106 all: all-@USE_INCLUDED_LIBINTL@
107 all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
108 all-no: all-no-@BUILD_INCLUDED_LIBINTL@
109 all-no-yes: libgnuintl.$la
112 libintl.a libgnuintl.a: $(OBJECTS)
114 $(AR) cru $@ $(OBJECTS)
117 libintl.la libgnuintl.la: $(OBJECTS)
118 $(LIBTOOL) --mode=link \
119 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
120 $(OBJECTS) @LIBICONV@ \
121 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
125 libintl.h: libgnuintl.h
126 cp $(srcdir)/libgnuintl.h libintl.h
128 charset.alias: config.charset
129 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
134 # This installation goal is only used in GNU gettext. Packages which
135 # only use the library should use install instead.
137 # We must not install the libintl.h/libintl.a files if we are on a
138 # system which has the GNU gettext() function in its C library or in a
140 # If you want to use the one which comes with this version of the
141 # package, you have to use `configure --with-included-gettext'.
142 install: install-exec install-data
144 if test "$(PACKAGE)" = "gettext" \
145 && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
146 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
147 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
148 $(LIBTOOL) --mode=install \
149 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
153 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
154 $(mkinstalldirs) $(DESTDIR)$(libdir); \
155 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
156 dest=$(DESTDIR)$(libdir)/charset.alias; \
157 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
158 orig=$(DESTDIR)$(libdir)/charset.alias; \
159 sed -f ref-add.sed $$orig > $$temp; \
160 $(INSTALL_DATA) $$temp $$dest; \
163 if test @GLIBC21@ = no; then \
164 orig=charset.alias; \
165 sed -f ref-add.sed $$orig > $$temp; \
166 $(INSTALL_DATA) $$temp $$dest; \
170 $(mkinstalldirs) $(DESTDIR)$(localedir); \
171 test -f $(DESTDIR)$(localedir)/locale.alias \
172 && orig=$(DESTDIR)$(localedir)/locale.alias \
173 || orig=$(srcdir)/locale.alias; \
174 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
175 dest=$(DESTDIR)$(localedir)/locale.alias; \
176 sed -f ref-add.sed $$orig > $$temp; \
177 $(INSTALL_DATA) $$temp $$dest; \
183 if test "$(PACKAGE)" = "gettext"; then \
184 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
185 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
186 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
187 dists="$(DISTFILES.common)"; \
188 for file in $$dists; do \
189 $(INSTALL_DATA) $(srcdir)/$$file \
190 $(DESTDIR)$(gettextsrcdir)/$$file; \
192 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
193 dists="$(DISTFILES.generated)"; \
194 for file in $$dists; do \
195 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
196 $(INSTALL_DATA) $$dir/$$file \
197 $(DESTDIR)$(gettextsrcdir)/$$file; \
199 dists="$(DISTFILES.obsolete)"; \
200 for file in $$dists; do \
201 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
207 # Define this as empty until I found a useful application.
211 if test "$(PACKAGE)" = "gettext" \
212 && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
213 rm -f $(DESTDIR)$(includedir)/libintl.h; \
214 $(LIBTOOL) --mode=uninstall \
215 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
219 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
220 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
221 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
222 dest=$(DESTDIR)$(libdir)/charset.alias; \
223 sed -f ref-del.sed $$dest > $$temp; \
224 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
227 $(INSTALL_DATA) $$temp $$dest; \
231 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
232 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
233 dest=$(DESTDIR)$(localedir)/locale.alias; \
234 sed -f ref-del.sed $$dest > $$temp; \
235 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
238 $(INSTALL_DATA) $$temp $$dest; \
245 if test "$(PACKAGE)" = "gettext"; then \
246 for file in VERSION ChangeLog $(DISTFILES.common) $(DISTFILES.generated); do \
247 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
255 $(OBJECTS): ../config.h libgnuintl.h
256 bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
257 dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
261 TAGS: $(HEADERS) $(SOURCES)
262 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
266 ID: $(HEADERS) $(SOURCES)
267 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
271 rm -f *.a *.la *.o *.lo core core.*
272 rm -f libintl.h charset.alias ref-add.sed ref-del.sed
278 rm -f Makefile ID TAGS
279 if test "$(PACKAGE)" = gettext; then \
280 rm -f ChangeLog.inst $(DISTFILES.normal); \
285 maintainer-clean: distclean
286 @echo "This command is intended for maintainers to use;"
287 @echo "it deletes files that may require special tools to rebuild."
290 # GNU gettext needs not contain the file `VERSION' but contains some
291 # other files which should not be distributed in other packages.
292 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
293 dist distdir: Makefile
294 if test "$(PACKAGE)" = gettext; then \
295 additional="$(DISTFILES.gettext)"; \
297 additional="$(DISTFILES.normal)"; \
299 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
300 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
301 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
302 ln $$dir/$$file $(distdir) 2> /dev/null \
303 || cp -p $$dir/$$file $(distdir); \
306 Makefile: Makefile.in ../config.status
308 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
310 # Tell versions [3.59,3.63) of GNU make not to export all variables.
311 # Otherwise a system limit (for SysV at least) may be exceeded.