]>
Commit | Line | Data |
---|---|---|
bfff8b1b | 1 | # Copyright (C) 1996-2017 Free Software Foundation, Inc. |
f5f52655 UD |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
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. | |
f5f52655 UD |
8 | |
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 | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
f5f52655 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
15 | # License along with the GNU C Library; if not, see |
16 | # <http://www.gnu.org/licenses/>. | |
f5f52655 UD |
17 | |
18 | # Makefile for installing locale data source files. | |
19 | ||
20 | subdir := localedata | |
21 | ||
a5f891ac | 22 | include ../Makeconfig |
f5f52655 UD |
23 | |
24 | # List with all available character set descriptions. | |
9d65ea3a | 25 | charmaps := $(wildcard charmaps/[A-I]*) $(wildcard charmaps/[J-Z]*) |
f5f52655 UD |
26 | |
27 | # List with all available character set descriptions. | |
9d65ea3a | 28 | locales := $(wildcard locales/*) |
f5f52655 | 29 | |
5b905722 AJ |
30 | |
31 | subdir-dirs = tests-mbwc | |
32 | vpath %.c tests-mbwc | |
33 | vpath %.h tests-mbwc | |
34 | ||
35 | ||
316518d6 | 36 | test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \ |
2976feab | 37 | tst-ctype tst-langinfo tst-langinfo-static tst-numeric |
081e43f2 | 38 | test-input := de_DE.ISO-8859-1 en_US.ISO-8859-1 da_DK.ISO-8859-1 \ |
a5ff533e | 39 | hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 tr_TR.UTF-8 fr_FR.UTF-8 \ |
ea1898dd | 40 | si_LK.UTF-8 uk_UA.UTF-8 hu_HU.UTF-8 |
56fa555a | 41 | test-input-data = $(addsuffix .in, $(test-input)) |
da2d1bc5 UD |
42 | test-output := $(foreach s, .out .xout, \ |
43 | $(addsuffix $s, $(basename $(test-input)))) | |
69c69fe1 | 44 | ld-test-names := test1 test2 test3 test4 test5 test6 test7 |
0a614877 | 45 | ld-test-srcs := $(addprefix tests/,$(addsuffix .cm,$(ld-test-names)) \ |
afa0569f | 46 | $(addsuffix .def,$(ld-test-names)) \ |
cf2964e2 UD |
47 | $(addsuffix .ds,test5 test6) \ |
48 | test6.c trans.def) | |
880f421f | 49 | |
8956ac9e UD |
50 | fmon-tests = n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \ |
51 | y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21 | |
52 | ||
f08e9a26 | 53 | generated += $(test-input) $(test-output) sort-test.out tst-locale.out \ |
2976feab | 54 | tst-leaks.mtrace mtrace-tst-leaks.out |
f08e9a26 | 55 | generated-dirs += $(ld-test-names) tt_TT de_DE.437 \ |
40c4c9b5 | 56 | $(addprefix tstfmon_,$(fmon-tests)) \ |
414fd335 | 57 | |
03ac099f | 58 | ifeq ($(run-built-tests),yes) |
5ca8accd AJ |
59 | locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \ |
60 | tst_iswctype tst_iswdigit tst_iswgraph \ | |
61 | tst_iswlower tst_iswprint tst_iswpunct \ | |
62 | tst_iswspace tst_iswupper tst_iswxdigit tst_mblen \ | |
63 | tst_mbrlen tst_mbrtowc tst_mbsrtowcs tst_mbstowcs \ | |
64 | tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm \ | |
65 | tst_swscanf tst_towctrans tst_towlower \ | |
66 | tst_towupper tst_wcrtomb tst_wcscat tst_wcschr \ | |
67 | tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn \ | |
68 | tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy \ | |
69 | tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \ | |
70 | tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \ | |
71 | tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \ | |
72 | tst_wctype tst_wcwidth | |
2e23c3cc | 73 | |
7bcad280 | 74 | tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ |
2976feab JM |
75 | tst-leaks tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \ |
76 | tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ | |
4e8f95a0 FW |
77 | tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 \ |
78 | tst-wctype | |
c34521ce L |
79 | tests-static = bug-setlocale1-static |
80 | tests += $(tests-static) | |
7bcad280 UD |
81 | ifeq (yes,$(build-shared)) |
82 | ifneq (no,$(PERL)) | |
0b20a9e8 | 83 | tests-special += $(objpfx)mtrace-tst-leaks.out |
7bcad280 UD |
84 | endif |
85 | endif | |
0e16ecfa | 86 | endif |
0e16ecfa | 87 | |
f5f52655 | 88 | # Files to install. |
d77cd295 UD |
89 | install-others := $(addprefix $(inst_i18ndir)/, \ |
90 | $(addsuffix .gz, $(charmaps)) \ | |
91 | $(locales)) | |
f5f52655 | 92 | |
23433315 PP |
93 | tests: $(objdir)/iconvdata/gconv-modules |
94 | ||
85bb81c9 WN |
95 | tests-static += tst-langinfo-static |
96 | ||
97 | ifeq ($(run-built-tests),yes) | |
f214606a JM |
98 | tests-special += $(objpfx)sort-test.out $(objpfx)tst-fmon.out \ |
99 | $(objpfx)tst-locale.out $(objpfx)tst-rpmatch.out \ | |
2976feab | 100 | $(objpfx)tst-trans.out $(objpfx)tst-ctype.out \ |
ae75a883 AJ |
101 | $(objpfx)tst-langinfo.out $(objpfx)tst-langinfo-static.out \ |
102 | $(objpfx)tst-numeric.out | |
6f99f280 JM |
103 | # We have to generate locales |
104 | LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \ | |
105 | en_US.ISO-8859-1 en_US.UTF-8 ja_JP.EUC-JP da_DK.ISO-8859-1 \ | |
106 | hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 ja_JP.SJIS fr_FR.ISO-8859-1 \ | |
107 | nb_NO.ISO-8859-1 nn_NO.ISO-8859-1 tr_TR.UTF-8 cs_CZ.UTF-8 \ | |
108 | zh_TW.EUC-TW fa_IR.UTF-8 fr_FR.UTF-8 ja_JP.UTF-8 si_LK.UTF-8 \ | |
ea1898dd | 109 | tr_TR.ISO-8859-9 en_GB.UTF-8 uk_UA.UTF-8 hu_HU.UTF-8 |
9f53d7ad | 110 | include ../gen-locales.mk |
6f99f280 JM |
111 | endif |
112 | ||
f5f52655 UD |
113 | include ../Rules |
114 | ||
d77cd295 UD |
115 | # Install the charmap files in gzipped format. |
116 | $(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force) | |
117 | $(make-target-directory) | |
118 | rm -f $(@:.gz=) $@ | |
119 | $(INSTALL_DATA) $< $(@:.gz=) | |
962edb7e | 120 | gzip -9n $(@:.gz=) |
d77cd295 UD |
121 | |
122 | # Install the locale source files in the appropriate directory. | |
73237de3 | 123 | $(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install) |
f5f52655 | 124 | |
03ac099f | 125 | ifeq ($(run-built-tests),yes) |
40c4c9b5 UD |
126 | generated-dirs += $(LOCALES) |
127 | ||
9f2bedd0 | 128 | $(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \ |
5e087c71 UD |
129 | $(addprefix $(objpfx),$(CTYPE_FILES)) |
130 | ||
ca41028b UD |
131 | $(objpfx)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \ |
132 | $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES)) | |
8540f6d2 JM |
133 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ |
134 | '$(run-program-env)' '$(test-program-prefix-after-env)' \ | |
135 | $(test-input) \ | |
f0881698 JM |
136 | > $@; \ |
137 | $(evaluate-test) | |
ca41028b UD |
138 | $(objpfx)tst-fmon.out: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data \ |
139 | $(objpfx)sort-test.out \ | |
140 | $(addprefix $(objpfx),$(CTYPE_FILES)) | |
8540f6d2 JM |
141 | $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \ |
142 | '$(run-program-env)' '$(run-program-prefix-after-env)' \ | |
143 | '$(test-program-prefix)' tst-fmon.data \ | |
f0881698 JM |
144 | > $@; \ |
145 | $(evaluate-test) | |
76352f64 UD |
146 | $(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \ |
147 | $(objpfx)sort-test.out \ | |
148 | $(addprefix $(objpfx),$(CTYPE_FILES)) | |
740b3dbe | 149 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' tst-numeric.data \ |
f0881698 JM |
150 | > $@; \ |
151 | $(evaluate-test) | |
ca41028b UD |
152 | $(objpfx)tst-locale.out: tst-locale.sh $(common-objpfx)locale/localedef \ |
153 | $(ld-test-srcs) $(addprefix $(objpfx),$(CTYPE_FILES)) | |
8540f6d2 JM |
154 | $(SHELL) $< $(common-objpfx) '$(built-program-cmd-before-env)' \ |
155 | '$(run-program-env)' '$(built-program-cmd-after-env)' > $@; \ | |
f0881698 | 156 | $(evaluate-test) |
ca41028b UD |
157 | $(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \ |
158 | $(objpfx)tst-fmon.out \ | |
159 | $(addprefix $(objpfx),$(CTYPE_FILES)) | |
f0881698 JM |
160 | $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \ |
161 | $(evaluate-test) | |
ca41028b UD |
162 | $(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \ |
163 | $(addprefix $(objpfx),$(CTYPE_FILES)) | |
8540f6d2 JM |
164 | $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \ |
165 | '$(run-program-env)' '$(run-program-prefix-after-env)' \ | |
166 | '$(test-program-prefix-before-env)' \ | |
d5afb385 | 167 | '$(test-program-prefix-after-env)' > $@; \ |
f0881698 | 168 | $(evaluate-test) |
ca41028b UD |
169 | $(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \ |
170 | $(objpfx)sort-test.out \ | |
171 | $(addprefix $(objpfx),$(CTYPE_FILES)) | |
8540f6d2 | 172 | $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \ |
d5afb385 | 173 | '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \ |
f0881698 | 174 | $(evaluate-test) |
f79d99cb UD |
175 | $(objpfx)tst-langinfo.out: tst-langinfo.sh $(objpfx)tst-langinfo \ |
176 | $(objpfx)sort-test.out \ | |
177 | $(addprefix $(objpfx),$(CTYPE_FILES)) | |
8540f6d2 JM |
178 | $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \ |
179 | '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \ | |
ae75a883 AJ |
180 | $(evaluate-test) |
181 | $(objpfx)tst-langinfo-static.out: tst-langinfo.sh $(objpfx)tst-langinfo-static \ | |
182 | $(objpfx)sort-test.out \ | |
183 | $(addprefix $(objpfx),$(CTYPE_FILES)) | |
8540f6d2 JM |
184 | $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \ |
185 | '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \ | |
f0881698 | 186 | $(evaluate-test) |
69c69fe1 | 187 | $(objpfx)tst-digits.out: $(objpfx)tst-locale.out |
db2d05f9 | 188 | $(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES)) |
df455ccb | 189 | endif |
92610fbe | 190 | |
f7364247 UD |
191 | include SUPPORTED |
192 | ||
193 | INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES)) | |
194 | ||
92610fbe | 195 | # Sometimes the whole collection of locale files should be installed. |
246a9a19 | 196 | LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \ |
85d89278 | 197 | $(rtld-prefix) $(common-objpfx)locale/localedef |
f7364247 UD |
198 | install-locales: $(INSTALL-SUPPORTED-LOCALES) |
199 | ||
200 | install-locales-dir: | |
90fe682d | 201 | $(..)./scripts/mkinstalldirs $(inst_complocaledir) |
f7364247 UD |
202 | |
203 | $(INSTALL-SUPPORTED-LOCALES): install-locales-dir | |
204 | @locale=`echo $@ | sed -e 's/^install-//'`; \ | |
205 | charset=`echo $$locale | sed -e 's,.*/,,'`; \ | |
206 | locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \ | |
207 | echo -n `echo $$locale | sed 's/\([^.\@]*\).*/\1/'`; \ | |
208 | echo -n ".$$charset"; \ | |
209 | echo -n `echo $$locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \ | |
210 | echo -n '...'; \ | |
211 | input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \ | |
aa97cce1 RM |
212 | $(LOCALEDEF) --alias-file=../intl/locale.alias \ |
213 | -i locales/$$input -c -f charmaps/$$charset \ | |
6c307927 CD |
214 | $(addprefix --prefix=,$(install_root)) $$locale \ |
215 | && echo ' done'; \ | |
5b905722 | 216 | |
2bf18041 | 217 | tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP |
2976feab | 218 | tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP |
2bf18041 JM |
219 | |
220 | tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace | |
0b20a9e8 | 221 | $(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out |
f0881698 JM |
222 | $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@; \ |
223 | $(evaluate-test) | |
23433315 | 224 | |
9162c01d RM |
225 | bug-setlocale1-ENV-only = LOCPATH=$(objpfx) LC_CTYPE=de_DE.UTF-8 |
226 | bug-setlocale1-static-ENV-only = $(bug-setlocale1-ENV-only) | |
cc9e536d | 227 | |
23433315 PP |
228 | $(objdir)/iconvdata/gconv-modules: |
229 | $(MAKE) -C ../iconvdata subdir=iconvdata $@ |