1 # Copyright (C) 1995-2014 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.
25 routines
= bindtextdom dcgettext dgettext gettext \
26 dcigettext dcngettext dngettext ngettext \
27 finddomain loadmsgcat localealias textdomain
28 aux
= l10nflist explodename plural plural-exp hash-string
30 multithread-test-srcs
:= tst-gettext4 tst-gettext5 tst-gettext6
31 test-srcs
:= tst-gettext tst-translit tst-gettext2 tst-codeset tst-gettext3
32 ifeq ($(have-thread-library
),yes
)
33 test-srcs
+= $(multithread-test-srcs
)
37 before-compile
+= $(objpfx
)msgs.h
39 install-others
= $(inst_msgcatdir
)/locale.alias
41 generated
+= msgs.h mtrace-tst-gettext.out tst-gettext.mtrace
42 generated-dirs
+= domaindir localedir
46 $(BISON
) $(BISONFLAGS
) $@
$^
48 $(objpfx
)plural.o
: plural.c
50 ifeq ($(run-built-tests
),yes
)
51 ifeq (yes
,$(build-shared
))
52 ifneq ($(strip $(MSGFMT
)),:)
53 tests-special
+= $(objpfx
)tst-translit.out
$(objpfx
)tst-gettext.out \
54 $(objpfx
)tst-gettext2.out
$(objpfx
)tst-codeset.out \
55 $(objpfx
)tst-gettext3.out
56 ifeq ($(have-thread-library
),yes
)
57 tests-special
+= $(objpfx
)tst-gettext4.out
$(objpfx
)tst-gettext5.out \
58 $(objpfx
)tst-gettext6.out
61 tests-special
+= $(objpfx
)mtrace-tst-gettext.out
69 ifeq ($(run-built-tests
),yes
)
70 ifeq (yes
,$(build-shared
))
71 # Multiple tests use this data. Create it once to avoid racing and
72 # spurious test failures.
73 codeset_mo
= $(objpfx
)domaindir
/de_DE
/LC_MESSAGES
/codeset.mo
75 $(codeset_mo
): tstcodeset.po
76 $(make-target-directory
)
80 $(objpfx
)mtrace-tst-gettext.out
: $(objpfx
)tst-gettext.out
81 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-gettext.mtrace
> $@
; \
83 $(objpfx
)tst-gettext.out
: tst-gettext.sh
$(objpfx
)tst-gettext
84 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)' \
85 $(common-objpfx
)intl
/ $(objpfx
)tst-gettext.mtrace
; \
87 $(objpfx
)tst-translit.out
: tst-translit.sh
$(objpfx
)tst-translit
88 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)' \
89 $(common-objpfx
)intl
/; \
91 $(objpfx
)tst-gettext2.out
: tst-gettext2.sh
$(objpfx
)tst-gettext2
92 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)' \
93 $(common-objpfx
)intl
/; \
95 $(objpfx
)tst-gettext4.out
: tst-gettext4.sh
$(objpfx
)tst-gettext4
96 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)' $(common-objpfx
)intl
/; \
98 $(objpfx
)tst-gettext6.out
: tst-gettext6.sh
$(objpfx
)tst-gettext6
99 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)' $(common-objpfx
)intl
/; \
102 $(objpfx
)tst-codeset.out
: $(codeset_mo
)
103 $(objpfx
)tst-gettext3.out
: $(codeset_mo
)
104 $(objpfx
)tst-gettext5.out
: $(codeset_mo
)
108 $(objpfx
)msgs.h
: po2test.awk ..
/po
/de.po
109 $(make-target-directory
)
110 LC_ALL
=C
$(AWK
) -f
$^
> $@
112 CFLAGS-tst-gettext.c
= -DTESTSTRS_H
=\"$(objpfx
)msgs.h
\"
113 CFLAGS-tst-translit.c
= -DOBJPFX
=\"$(objpfx
)\"
114 CFLAGS-tst-gettext2.c
= -DOBJPFX
=\"$(objpfx
)\"
115 CFLAGS-tst-codeset.c
= -DOBJPFX
=\"$(objpfx
)\"
116 CFLAGS-tst-gettext3.c
= -DOBJPFX
=\"$(objpfx
)\"
117 CFLAGS-tst-gettext4.c
= -DOBJPFX
=\"$(objpfx
)\"
118 CFLAGS-tst-gettext5.c
= -DOBJPFX
=\"$(objpfx
)\"
119 CFLAGS-tst-gettext6.c
= -DOBJPFX
=\"$(objpfx
)\"
121 LOCPATH-ENV
= LOCPATH
=$(common-objpfx
)localedata
122 tst-codeset-ENV
= $(LOCPATH-ENV
)
123 tst-gettext3-ENV
= $(LOCPATH-ENV
)
124 tst-gettext5-ENV
= $(LOCPATH-ENV
)
126 ifeq ($(have-thread-library
),yes
)
127 ifeq (yes
,$(build-shared
))
128 $(addprefix $(objpfx
),$(multithread-test-srcs
)): $(shared-thread-library
)
130 $(addprefix $(objpfx
),$(multithread-test-srcs
)): $(static-thread-library
)
134 $(objpfx
)tst-translit.out
: $(objpfx
)tst-gettext.out
135 $(objpfx
)tst-gettext2.out
: $(objpfx
)tst-gettext.out
136 $(objpfx
)tst-codeset.out
: $(objpfx
)tst-gettext.out
137 $(objpfx
)tst-gettext3.out
: $(objpfx
)tst-gettext.out
138 $(objpfx
)tst-gettext4.out
: $(objpfx
)tst-gettext.out
139 $(objpfx
)tst-gettext5.out
: $(objpfx
)tst-gettext.out
140 $(objpfx
)tst-gettext6.out
: $(objpfx
)tst-gettext.out
142 CPPFLAGS
+= -D
'LOCALEDIR="$(msgcatdir)"' \
143 -D
'LOCALE_ALIAS_PATH="$(msgcatdir)"'
144 BISONFLAGS
= --yacc --name-prefix
=__gettext
--output
146 $(inst_msgcatdir
)/locale.alias
: locale.alias
$(+force)