Update.
[glibc.git] / intl / Makefile
blobf1ba8c2d95ae91be1fa4e1f325f9b5ae6ef158e7
1 # Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Library General Public License
6 # as published by the Free Software Foundation; either version 2 of
7 # the License, or (at your option) any later version.
9 # The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not,
16 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
19 # Makefile for intl subdirectory: message handling code from GNU gettext.
21 subdir = intl
22 headers = libintl.h
23 routines = bindtextdom dcgettext dgettext gettext \
24 dcigettext dcngettext dngettext ngettext \
25 finddomain loadmsgcat localealias textdomain \
26 l10nflist explodename plural
27 distribute = gettext.h gettextP.h hash-string.h loadinfo.h locale.alias \
28 plural.y po2test.sed tst-gettext.sh tst-translit.sh \
29 translit.po
31 test-srcs := tst-gettext tst-translit
33 before-compile = $(objpfx)msgs.h
35 install-others = $(inst_msgcatdir)/locale.alias
37 generated = msgs.h
38 generated-dirs := domaindir
40 plural.c: plural.y
41 $(YACC) $(YFLAGS) $@ $^
42 ifeq ($(with-cvs),yes)
43 test ! -d CVS || cvs $(CVSOPTS) commit -m'$(YACC) $(YFLAGS) $@ $^' $@
44 endif
45 $(objpfx)plural.o: plural.c
47 include ../Rules
49 ifeq (no,$(cross-compiling))
50 ifeq (yes,$(build-shared))
51 ifneq ($(strip $(MSGFMT)),:)
52 .PHONY: do-gettext-test do-translit-test
53 tests: do-gettext-test do-translit-test
54 do-gettext-test: $(objpfx)tst-gettext.out
55 $(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext
56 $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/
57 do-translit-test: $(objpfx)tst-translit.out
58 $(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit
59 $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/
60 endif
61 endif
62 endif
64 $(objpfx)msgs.h: po2test.sed ../po/de.po
65 $(make-target-directory)
66 sed -f $^ > $@
68 CFLAGS-tst-gettext.c = -DTESTSTRS_H=\"$(objpfx)msgs.h\"
69 CFLAGS-tst-translit.c = -DOBJPFX=\"$(objpfx)\"
71 $(objpfx)tst-translit.out: $(objpfx)tst-gettext.out
73 CPPFLAGS += -D'GNULOCALEDIR="$(msgcatdir)"' \
74 -D'LOCALE_ALIAS_PATH="$(msgcatdir):$(i18ndir)"'
75 YFLAGS = --name-prefix=__gettext --output
77 $(inst_msgcatdir)/locale.alias: locale.alias $(+force)
78 $(do-install)
80 ifdef gettext-srcdir
82 %.h:: ../gpl2lgpl.sed $(gettext-srcdir)/intl/%.glibc; $(copysrc)
83 %.c:: ../gpl2lgpl.sed $(gettext-srcdir)/intl/%.c; $(copysrc)
84 %.h:: ../gpl2lgpl.sed $(gettext-srcdir)/intl/%.h; $(copysrc)
85 locale.alias:: ../gpl2lgpl.sed $(gettext-srcdir)/misc/locale.alias; $(copysrc)
87 ifeq ($(with-cvs),yes)
88 define copysrc
89 sed -f $^ > $@.new
90 chmod a-w $@.new
91 mv -f $@.new $@
92 test ! -d CVS || cvs $(CVSOPTS) commit -m'Updated from $<' $@
93 endef
94 else
95 define copysrc
96 sed -f $^ > $@.new
97 chmod a-w $@.new
98 mv -f $@.new $@
99 endef
100 endif
102 endif