1 # Copyright (C) 1995-2003,2005,2008,2011,2012 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 Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of 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 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <http://www.gnu.org/licenses/>.
18 # Makefile for intl subdirectory: message handling code from GNU gettext.
22 routines
= bindtextdom dcgettext dgettext gettext \
23 dcigettext dcngettext dngettext ngettext \
24 finddomain loadmsgcat localealias textdomain
25 aux
= l10nflist explodename plural plural-exp hash-string
29 multithread-test-srcs
:= tst-gettext4 tst-gettext5 tst-gettext6
30 test-srcs
:= tst-gettext tst-translit tst-gettext2 tst-codeset tst-gettext3
31 ifeq ($(have-thread-library
),yes
)
32 test-srcs
+= $(multithread-test-srcs
)
36 before-compile
= $(objpfx
)msgs.h
38 install-others
= $(inst_msgcatdir
)/locale.alias
40 generated
= msgs.h mtrace-tst-gettext tst-gettext.mtrace
41 generated-dirs
:= domaindir localedir
45 $(BISON
) $(BISONFLAGS
) $@
$^
47 $(objpfx
)plural.o
: plural.c
51 ifeq (no
,$(cross-compiling
))
52 ifeq (yes
,$(build-shared
))
53 ifneq ($(strip $(MSGFMT
)),:)
54 tests
: $(objpfx
)tst-translit.out
$(objpfx
)tst-gettext2.out \
55 $(objpfx
)tst-codeset.out
$(objpfx
)tst-gettext3.out
56 ifeq ($(have-thread-library
),yes
)
57 tests
: $(objpfx
)tst-gettext4.out
$(objpfx
)tst-gettext5.out \
58 $(objpfx
)tst-gettext6.out
61 tests
: $(objpfx
)mtrace-tst-gettext
65 # Multiple tests use this data. Create it once to avoid racing and
66 # spurious test failures.
67 codeset_mo
= $(objpfx
)domaindir
/de_DE
/LC_MESSAGES
/codeset.mo
69 $(codeset_mo
): tstcodeset.po
70 $(make-target-directory
)
74 $(objpfx
)mtrace-tst-gettext
: $(objpfx
)tst-gettext.out
75 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-gettext.mtrace
> $@
76 $(objpfx
)tst-gettext.out
: tst-gettext.sh
$(objpfx
)tst-gettext
77 $(SHELL
) -e
$< $(common-objpfx
) $(common-objpfx
)intl
/ \
78 $(objpfx
)tst-gettext.mtrace
79 $(objpfx
)tst-translit.out
: tst-translit.sh
$(objpfx
)tst-translit
80 $(SHELL
) -e
$< $(common-objpfx
) $(common-objpfx
)intl
/
81 $(objpfx
)tst-gettext2.out
: tst-gettext2.sh
$(objpfx
)tst-gettext2
82 $(SHELL
) -e
$< $(common-objpfx
) $(common-objpfx
)intl
/
83 $(objpfx
)tst-gettext4.out
: tst-gettext4.sh
$(objpfx
)tst-gettext4
84 $(SHELL
) -e
$< $(common-objpfx
) '$(run-program-prefix)' $(common-objpfx
)intl
/
85 $(objpfx
)tst-gettext6.out
: tst-gettext6.sh
$(objpfx
)tst-gettext6
86 $(SHELL
) -e
$< $(common-objpfx
) '$(run-program-prefix)' $(common-objpfx
)intl
/
88 $(objpfx
)tst-codeset.out
: $(codeset_mo
)
89 $(objpfx
)tst-gettext3.out
: $(codeset_mo
)
90 $(objpfx
)tst-gettext5.out
: $(codeset_mo
)
94 $(objpfx
)msgs.h
: po2test.awk ..
/po
/de.po
95 $(make-target-directory
)
96 LC_ALL
=C
$(AWK
) -f
$^
> $@
98 CFLAGS-tst-gettext.c
= -DTESTSTRS_H
=\"$(objpfx
)msgs.h
\"
99 CFLAGS-tst-translit.c
= -DOBJPFX
=\"$(objpfx
)\"
100 CFLAGS-tst-gettext2.c
= -DOBJPFX
=\"$(objpfx
)\"
101 CFLAGS-tst-codeset.c
= -DOBJPFX
=\"$(objpfx
)\"
102 CFLAGS-tst-gettext3.c
= -DOBJPFX
=\"$(objpfx
)\"
103 CFLAGS-tst-gettext4.c
= -DOBJPFX
=\"$(objpfx
)\"
104 CFLAGS-tst-gettext5.c
= -DOBJPFX
=\"$(objpfx
)\"
105 CFLAGS-tst-gettext6.c
= -DOBJPFX
=\"$(objpfx
)\"
107 LOCPATH-ENV
= LOCPATH
=$(common-objpfx
)localedata
108 tst-codeset-ENV
= $(LOCPATH-ENV
)
109 tst-gettext3-ENV
= $(LOCPATH-ENV
)
110 tst-gettext5-ENV
= $(LOCPATH-ENV
)
112 ifeq ($(have-thread-library
),yes
)
113 ifeq (yes
,$(build-shared
))
114 $(addprefix $(objpfx
),$(multithread-test-srcs
)): $(shared-thread-library
)
116 $(addprefix $(objpfx
),$(multithread-test-srcs
)): $(static-thread-library
)
118 ifeq (yes
,$(build-bounded
))
119 $(multithread-test-srcs
:%=$(objpfx
)%-bp
): $(bounded-thread-library
)
123 $(objpfx
)tst-translit.out
: $(objpfx
)tst-gettext.out
124 $(objpfx
)tst-gettext2.out
: $(objpfx
)tst-gettext.out
125 $(objpfx
)tst-codeset.out
: $(objpfx
)tst-gettext.out
126 $(objpfx
)tst-gettext3.out
: $(objpfx
)tst-gettext.out
127 $(objpfx
)tst-gettext4.out
: $(objpfx
)tst-gettext.out
128 $(objpfx
)tst-gettext5.out
: $(objpfx
)tst-gettext.out
129 $(objpfx
)tst-gettext6.out
: $(objpfx
)tst-gettext.out
131 CPPFLAGS
+= -D
'LOCALEDIR="$(msgcatdir)"' \
132 -D
'LOCALE_ALIAS_PATH="$(msgcatdir)"'
133 BISONFLAGS
= --yacc --name-prefix
=__gettext
--output
135 $(inst_msgcatdir
)/locale.alias
: locale.alias
$(+force)