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@
42 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
48 YACC = @INTLBISON@ -y -d
49 YFLAGS = --name-prefix=__gettext
51 DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
52 -DLIBDIR=\"$(libdir)\" @DEFS@
57 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
59 HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h
60 COMHDRS = gettext.h gettextP.h hash-string.h
61 SOURCES = $(COMSRCS) intl-compat.c
62 COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
63 finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
64 explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
66 OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
67 finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
68 explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
69 plural.$lo localcharset.$lo
70 GETTOBJS = intl-compat.$lo
71 DISTFILES.common = Makefile.in \
72 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
73 DISTFILES.generated = plural.c
74 DISTFILES.normal = VERSION
75 DISTFILES.gettext = libintl.glibc
76 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c
78 # Libtool's library version information for libintl.
79 # Before making a gettext release, the gettext maintainer must change this
80 # according to the libtool documentation, section "Library interface versions".
81 # Maintainers of other packages that include the intl directory must *not*
82 # change these values.
88 .SUFFIXES: .c .y .o .lo .sin .sed
92 $(LIBTOOL) --mode=compile $(COMPILE) $<
95 $(YACC) $(YFLAGS) --output $@ $<
99 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
102 INCLUDES = -I.. -I. -I$(top_srcdir)/intl
104 all: all-@USE_INCLUDED_LIBINTL@
105 all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
106 all-no: all-no-@BUILD_INCLUDED_LIBINTL@
107 all-no-yes: libgnuintl.$la
110 libintl.a libgnuintl.a: $(OBJECTS)
112 $(AR) cru $@ $(OBJECTS)
115 libintl.la libgnuintl.la: $(OBJECTS)
116 $(LIBTOOL) --mode=link \
117 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
118 $(OBJECTS) @LIBICONV@
120 # -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
124 libintl.h: libgnuintl.h
125 cp $(srcdir)/libgnuintl.h libintl.h
127 charset.alias: config.charset
128 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
133 # This installation goal is only used in GNU gettext. Packages which
134 # only use the library should use install instead.
136 # We must not install the libintl.h/libintl.a files if we are on a
137 # system which has the GNU gettext() function in its C library or in a
139 # If you want to use the one which comes with this version of the
140 # package, you have to use `configure --with-included-gettext'.
141 install: install-exec install-data
143 if test "$(PACKAGE)" = "gettext" \
144 && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
145 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
146 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
147 $(LIBTOOL) --mode=install \
148 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
152 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
153 $(mkinstalldirs) $(DESTDIR)$(libdir); \
154 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
155 dest=$(DESTDIR)$(libdir)/charset.alias; \
156 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
157 orig=$(DESTDIR)$(libdir)/charset.alias; \
158 sed -f ref-add.sed $$orig > $$temp; \
159 $(INSTALL_DATA) $$temp $$dest; \
162 if test @GLIBC21@ = no; then \
163 orig=charset.alias; \
164 sed -f ref-add.sed $$orig > $$temp; \
165 $(INSTALL_DATA) $$temp $$dest; \
169 $(mkinstalldirs) $(DESTDIR)$(localedir); \
170 test -f $(DESTDIR)$(localedir)/locale.alias \
171 && orig=$(DESTDIR)$(localedir)/locale.alias \
172 || orig=$(srcdir)/locale.alias; \
173 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
174 dest=$(DESTDIR)$(localedir)/locale.alias; \
175 sed -f ref-add.sed $$orig > $$temp; \
176 $(INSTALL_DATA) $$temp $$dest; \
182 if test "$(PACKAGE)" = "gettext"; then \
183 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
184 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
185 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
186 dists="$(DISTFILES.common)"; \
187 for file in $$dists; do \
188 $(INSTALL_DATA) $(srcdir)/$$file \
189 $(DESTDIR)$(gettextsrcdir)/$$file; \
191 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
192 dists="$(DISTFILES.generated)"; \
193 for file in $$dists; do \
194 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
195 $(INSTALL_DATA) $$dir/$$file \
196 $(DESTDIR)$(gettextsrcdir)/$$file; \
198 dists="$(DISTFILES.obsolete)"; \
199 for file in $$dists; do \
200 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
206 # Define this as empty until I found a useful application.
210 if test "$(PACKAGE)" = "gettext" \
211 && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
212 rm -f $(DESTDIR)$(includedir)/libintl.h; \
213 $(LIBTOOL) --mode=uninstall \
214 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
218 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
219 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
220 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
221 dest=$(DESTDIR)$(libdir)/charset.alias; \
222 sed -f ref-del.sed $$dest > $$temp; \
223 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
226 $(INSTALL_DATA) $$temp $$dest; \
230 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
231 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
232 dest=$(DESTDIR)$(localedir)/locale.alias; \
233 sed -f ref-del.sed $$dest > $$temp; \
234 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
237 $(INSTALL_DATA) $$temp $$dest; \
244 if test "$(PACKAGE)" = "gettext"; then \
245 for file in VERSION ChangeLog $(DISTFILES.common) $(DISTFILES.generated); do \
246 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
254 $(OBJECTS): ../config.h libgnuintl.h
255 bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
256 dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
260 TAGS: $(HEADERS) $(SOURCES)
261 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
265 ID: $(HEADERS) $(SOURCES)
266 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
270 rm -f *.a *.la *.o *.lo core core.*
271 rm -f libintl.h charset.alias ref-add.sed ref-del.sed
277 rm -f Makefile ID TAGS
278 if test "$(PACKAGE)" = gettext; then \
279 rm -f ChangeLog.inst $(DISTFILES.normal); \
284 maintainer-clean: distclean
285 @echo "This command is intended for maintainers to use;"
286 @echo "it deletes files that may require special tools to rebuild."
289 # GNU gettext needs not contain the file `VERSION' but contains some
290 # other files which should not be distributed in other packages.
291 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
292 dist distdir: Makefile
293 if test "$(PACKAGE)" = gettext; then \
294 additional="$(DISTFILES.gettext)"; \
296 additional="$(DISTFILES.normal)"; \
298 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
299 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
300 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
301 ln $$dir/$$file $(distdir) 2> /dev/null \
302 || cp -p $$dir/$$file $(distdir); \
305 Makefile: Makefile.in ../config.status
307 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
309 # Tell versions [3.59,3.63) of GNU make not to export all variables.
310 # Otherwise a system limit (for SysV at least) may be exceeded.