1 # Makefile for directory with message catalog handling in GNU NLS Utilities.
2 # Copyright (C) 1995 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@
28 exec_prefix = @exec_prefix@
29 transform = @program_transform_name@
30 libdir = $(prefix)/lib
31 includedir = $(prefix)/include
32 datadir = $(prefix)/@DATADIRNAME@
33 localedir = $(datadir)/locale
34 gnulocaledir = $(prefix)/share/locale
35 gettextsrcdir = $(prefix)/share/gettext
36 aliaspath = $(localedir):.
40 INSTALL_DATA = @INSTALL_DATA@
46 DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
47 -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@
50 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
52 HEADERS = $(COMHDRS) libgettext.h
53 COMHDRS = gettext.h gettextP.h hash-string.h
54 SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
55 COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
56 finddomain.c loadmsgcat.c localealias.c textdomain.c
57 OBJECTS = @INTLOBJS@ bindtextdom.o dcgettext.o dgettext.o gettext.o \
58 finddomain.o loadmsgcat.o localealias.o textdomain.o
59 CATOBJS = cat-compat.o ../po/cat-id-tbl.o
60 GETTOBJS = intl-compat.o
61 DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \
62 xopen-msg.sed $(HEADERS) $(SOURCES)
63 DISTFILES = $(DISTFILES.common) VERSION
64 DISTFILES.gettext = $(DISTFILES.common) libintl.glibc libintl.inst
71 INCLUDEs = -i.. -i. -i$(top_srcdir)/intl -i$(top_srcdir)/lib
78 $(AR) cru $@ $(OBJECTS)
81 ../po/cat-id-tbl.o: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
82 cd ../po && $(MAKE) cat-id-tbl.o
86 # This installation goal is only used in GNU gettext. Packages which
87 # only use the library should use install instead.
89 # We must not install the libintl.h/libintl.a files if we are on a system
90 # which has the gettext() function in its C library or in a separate
91 # library. A special case is where configure found a previously installed
92 # GNU gettext library. If you want to use the one which comes with this
93 # version of the package, you have to use `configure --with-gnu-gettext'.
95 $(top_srcdir)/mkinstalldirs $(libdir) $(includedir) $(gettextsrcdir)
96 if test -f libintl.h; then \
97 $(INSTALL_DATA) $(srcdir)/libintl.inst \
98 $(includedir)/libintl.h; \
99 $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
102 for file in $(DISTFILES.common); do \
103 $(INSTALL_DATA) $$file $(gettextsrcdir)/intl-$$file; \
105 $(INSTALL_DATA) VERSION $(gettextsrcdir)/intl-VERSION
108 for file in $(DISTFILES); do \
109 rm -f $(gettextsrcdir)/intl-$$file; \
114 $(OBJECTS): ../config.h libgettext.h
115 bindtextdom.o finddomain.o loadmsgcat.o: gettextP.h gettext.h
116 dcgettext.o: gettextP.h gettext.h hash-string.h
120 TAGS: $(HEADERS) $(SOURCES)
121 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
125 ID: $(HEADERS) $(SOURCES)
126 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
130 rm -f *.a *.o core core.*
135 rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h
137 maintainer-clean: distclean
138 @echo "This command is intended for maintainers to use;"
139 @echo "it deletes files that may require special tools to rebuild."
142 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
143 dist: Makefile $(DISTFILES)
144 for file in $(DISTFILES); do \
145 ln $(srcdir)/$$file $(distdir) 2> /dev/null \
146 || cp -p $(srcdir)/$$file $(distdir); \
149 # This dist goal is only used in GNU gettext. GNU gettext needs not contain
150 # the file `VERSION' but contains some other files which should not be
151 # distributed in other packages.
152 dist-gettext: Makefile $(DISTFILES.gettext)
153 for file in $(DISTFILES.gettext); do \
154 ln $(srcdir)/$$file $(distdir) 2> /dev/null \
155 || cp -p $(srcdir)/$$file $(distdir); \
159 tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
161 Makefile: Makefile.in ../config.status
162 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
164 # Tell versions [3.59,3.63) of GNU make not to export all variables.
165 # Otherwise a system limit (for SysV at least) may be exceeded.