1 # Makefile for directory with message catalog handling library of GNU gettext
2 # Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU Library General Public License as published
6 # by 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 GNU
12 # Library General Public License for more details.
14 # You should have received a copy of the GNU Library General Public
15 # License along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 PACKAGE = @PACKAGE_NAME@
20 VERSION = @PACKAGE_VERSION@
25 top_srcdir = @top_srcdir@
26 top_builddir = @BUILD_DIR@
30 exec_prefix = @exec_prefix@
31 transform = @program_transform_name@
33 includedir = @includedir@
35 localedir = $(datadir)/locale
36 gettextsrcdir = $(datadir)/gettext/intl
37 aliaspath = $(localedir)
41 INSTALL_DATA = @INSTALL_DATA@
42 MKINSTALLDIRS = @MKINSTALLDIRS@
43 mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
45 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
51 YACC = @INTLBISON@ -y -d
52 YFLAGS = --name-prefix=__gettext
54 LOCAL_DEFS = @LOCAL_DEFS@
56 DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
57 -DLIBDIR=\"$(prefix)/libdata\" -DIN_LIBINTL \
58 -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
59 -Dset_relocation_prefix=libintl_set_relocation_prefix \
60 -Drelocate=libintl_relocate \
61 -DDEPENDS_ON_LIBICONV=1 @DEFS@ @LOCAL_DEFS@
67 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
127 DISTFILES.common = Makefile.in \
128 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
129 DISTFILES.generated = plural.c
130 DISTFILES.normal = VERSION
131 DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
132 Makefile.vms libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
133 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
134 COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
136 all: all-@USE_INCLUDED_LIBINTL@
137 all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
138 all-no: all-no-@BUILD_INCLUDED_LIBINTL@
139 all-no-yes: libgnuintl.$la
142 libintl.a libgnuintl.a: $(OBJECTS)
144 $(AR) cru $@ $(OBJECTS)
147 libintl.la libgnuintl.la: $(OBJECTS)
148 $(LIBTOOL) --mode=link \
149 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
150 $(OBJECTS) @LTLIBICONV@ $(LIBS) \
151 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
155 # Libtool's library version information for libintl.
156 # Before making a gettext release, the gettext maintainer must change this
157 # according to the libtool documentation, section "Library interface versions".
158 # Maintainers of other packages that include the intl directory must *not*
159 # change these values.
165 .SUFFIXES: .c .y .o .lo .sin .sed
171 $(YACC) $(YFLAGS) --output $@ $<
174 bindtextdom.lo: $(srcdir)/bindtextdom.c
175 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
176 dcgettext.lo: $(srcdir)/dcgettext.c
177 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
178 dgettext.lo: $(srcdir)/dgettext.c
179 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
180 gettext.lo: $(srcdir)/gettext.c
181 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
182 finddomain.lo: $(srcdir)/finddomain.c
183 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
184 loadmsgcat.lo: $(srcdir)/loadmsgcat.c
185 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
186 localealias.lo: $(srcdir)/localealias.c
187 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
188 textdomain.lo: $(srcdir)/textdomain.c
189 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
190 l10nflist.lo: $(srcdir)/l10nflist.c
191 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
192 explodename.lo: $(srcdir)/explodename.c
193 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
194 dcigettext.lo: $(srcdir)/dcigettext.c
195 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
196 dcngettext.lo: $(srcdir)/dcngettext.c
197 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
198 dngettext.lo: $(srcdir)/dngettext.c
199 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
200 ngettext.lo: $(srcdir)/ngettext.c
201 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
202 plural.lo: $(srcdir)/plural.c
203 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
204 plural-exp.lo: $(srcdir)/plural-exp.c
205 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
206 localcharset.lo: $(srcdir)/localcharset.c
207 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
208 relocatable.lo: $(srcdir)/relocatable.c
209 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
210 localename.lo: $(srcdir)/localename.c
211 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
212 log.lo: $(srcdir)/log.c
213 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
214 osdep.lo: $(srcdir)/osdep.c
215 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
216 intl-compat.lo: $(srcdir)/intl-compat.c
217 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
219 ref-add.sed: $(srcdir)/ref-add.sin
220 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
221 mv t-ref-add.sed ref-add.sed
222 ref-del.sed: $(srcdir)/ref-del.sin
223 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
224 mv t-ref-del.sed ref-del.sed
226 INCLUDES = -I. -I$(srcdir) -I${top_builddir} -I${top_srcdir}
228 libgnuintl.h: $(srcdir)/libgnuintl.h.in
229 cp $(srcdir)/libgnuintl.h.in libgnuintl.h
231 libintl.h: libgnuintl.h
232 cp libgnuintl.h libintl.h
234 charset.alias: $(srcdir)/config.charset
235 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
240 # We must not install the libintl.h/libintl.a files if we are on a
241 # system which has the GNU gettext() function in its C library or in a
243 # If you want to use the one which comes with this version of the
244 # package, you have to use `configure --with-included-gettext'.
245 install: install-exec install-data
247 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
248 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
249 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
250 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
251 $(LIBTOOL) --mode=install \
252 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
253 if test "@RELOCATABLE@" = yes; then \
254 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
255 if test -n "$dependencies"; then \
256 rm -f $(DESTDIR)$(libdir)/libintl.la; \
262 if test "$(PACKAGE)" = "gettext-tools" \
263 && test '@USE_INCLUDED_LIBINTL@' = no; then \
264 $(mkinstalldirs) $(DESTDIR)$(libdir); \
265 $(LIBTOOL) --mode=install \
266 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
267 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
268 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
269 $(LIBTOOL) --mode=uninstall \
270 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
274 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
275 $(mkinstalldirs) $(DESTDIR)$(localedir); \
276 test -f $(DESTDIR)$(localedir)/locale.alias \
277 && orig=$(DESTDIR)$(localedir)/locale.alias \
278 || orig=$(srcdir)/locale.alias; \
279 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
280 dest=$(DESTDIR)$(localedir)/locale.alias; \
281 sed -f ref-add.sed $$orig > $$temp; \
282 $(INSTALL_DATA) $$temp $$dest; \
288 if test "$(PACKAGE)" = "gettext-tools"; then \
289 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
290 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
291 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
292 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
293 for file in $$dists; do \
294 $(INSTALL_DATA) $(srcdir)/$$file \
295 $(DESTDIR)$(gettextsrcdir)/$$file; \
297 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
298 dists="$(DISTFILES.generated)"; \
299 for file in $$dists; do \
300 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
301 $(INSTALL_DATA) $$dir/$$file \
302 $(DESTDIR)$(gettextsrcdir)/$$file; \
304 dists="$(DISTFILES.obsolete)"; \
305 for file in $$dists; do \
306 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
312 install-strip: install
315 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
316 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
317 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
321 if test "$(PACKAGE)" = "gettext-tools" \
322 && test '@USE_INCLUDED_LIBINTL@' = no; then \
323 $(mkinstalldirs) $(DESTDIR)$(libdir); \
327 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
328 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
329 $(mkinstalldirs) $(DESTDIR)$(localedir); \
333 if test "$(PACKAGE)" = "gettext-tools"; then \
334 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
339 # Define this as empty until I found a useful application.
343 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
344 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
345 rm -f $(DESTDIR)$(includedir)/libintl.h; \
346 $(LIBTOOL) --mode=uninstall \
347 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
351 if test "$(PACKAGE)" = "gettext-tools" \
352 && test '@USE_INCLUDED_LIBINTL@' = no; then \
353 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
357 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
358 if test -f $(DESTDIR)$(prefix)/libdata/charset.alias; then \
359 temp=$(DESTDIR)$(prefix)/libdata/t-charset.alias; \
360 dest=$(DESTDIR)$(prefix)/libdata/charset.alias; \
361 sed -f ref-del.sed $$dest > $$temp; \
362 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
365 $(INSTALL_DATA) $$temp $$dest; \
369 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
370 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
371 dest=$(DESTDIR)$(localedir)/locale.alias; \
372 sed -f ref-del.sed $$dest > $$temp; \
373 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
376 $(INSTALL_DATA) $$temp $$dest; \
383 if test "$(PACKAGE)" = "gettext-tools"; then \
384 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
385 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
391 info dvi ps pdf html:
393 $(OBJECTS): ${top_builddir}/config.h libgnuintl.h
394 bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
395 dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
396 explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
397 dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
398 dcigettext.$lo: $(srcdir)/eval-plural.h
399 localcharset.$lo: $(srcdir)/localcharset.h
400 localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
404 TAGS: $(HEADERS) $(SOURCES)
405 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
409 CTAGS: $(HEADERS) $(SOURCES)
410 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
414 ID: $(HEADERS) $(SOURCES)
415 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
419 rm -f *.a *.la *.o *.obj *.lo core core.*
420 rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
426 rm -f Makefile ID TAGS
427 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
428 rm -f ChangeLog.inst $(DISTFILES.normal); \
433 maintainer-clean: distclean
434 @echo "This command is intended for maintainers to use;"
435 @echo "it deletes files that may require special tools to rebuild."
438 # GNU gettext needs not contain the file `VERSION' but contains some
439 # other files which should not be distributed in other packages.
440 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
441 dist distdir: Makefile
442 if test "$(PACKAGE)" = "gettext-tools"; then \
445 if test "$(PACKAGE)" = "gettext-runtime"; then \
446 additional="$(DISTFILES.gettext)"; \
448 additional="$(DISTFILES.normal)"; \
450 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
451 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
452 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
453 cp -p $$dir/$$file $(distdir); \
457 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
458 cd $(top_builddir) && $(SHELL) ./config.status
459 # This would be more efficient, but doesn't work any more with autoconf-2.57,
460 # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
461 # cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
463 # Tell versions [3.59,3.63) of GNU make not to export all variables.
464 # Otherwise a system limit (for SysV at least) may be exceeded.