]> git.ipfire.org Git - thirdparty/glibc.git/blame - localedata/Makefile
testrun.sh: Implement --tool=strace, --tool=valgrind
[thirdparty/glibc.git] / localedata / Makefile
CommitLineData
688903eb 1# Copyright (C) 1996-2018 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
20subdir := localedata
21
a5f891ac 22include ../Makeconfig
f5f52655
UD
23
24# List with all available character set descriptions.
9d65ea3a 25charmaps := $(wildcard charmaps/[A-I]*) $(wildcard charmaps/[J-Z]*)
f5f52655
UD
26
27# List with all available character set descriptions.
9d65ea3a 28locales := $(wildcard locales/*)
f5f52655 29
5b905722
AJ
30
31subdir-dirs = tests-mbwc
32vpath %.c tests-mbwc
33vpath %.h tests-mbwc
34
35
316518d6 36test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
2976feab 37 tst-ctype tst-langinfo tst-langinfo-static tst-numeric
15973854
MF
38# List of test input files (list sorted alphabetically):
39test-input := \
40 am_ET.UTF-8 \
41 az_AZ.UTF-8 \
42 be_BY.UTF-8 \
43 ber_DZ.UTF-8 \
44 ber_MA.UTF-8 \
45 bg_BG.UTF-8 \
46 br_FR.UTF-8 \
47 bs_BA.UTF-8 \
48 cmn_TW.UTF-8 \
49 crh_UA.UTF-8 \
50 cs_CZ.UTF-8 \
51 csb_PL.UTF-8 \
52 cv_RU.UTF-8 \
53 cy_GB.UTF-8 \
54 da_DK.ISO-8859-1 \
55 de_DE.ISO-8859-1 \
56 dz_BT.UTF-8 \
57 en_US.ISO-8859-1 \
58 eo.UTF-8 \
59 es_ES.UTF-8 \
60 et_EE.UTF-8 \
61 fa_IR.UTF-8 \
62 fi_FI.UTF-8 \
63 fil_PH.UTF-8 \
64 fr_CA.UTF-8 \
65 fr_FR.UTF-8 \
66 fur_IT.UTF-8 \
67 gez_ER.UTF-8@abegede \
68 ha_NG.UTF-8 \
69 hr_HR.ISO-8859-2 \
70 hr_HR.UTF-8 \
71 hsb_DE.UTF-8 \
72 hu_HU.UTF-8 \
73 ig_NG.UTF-8 \
74 ik_CA.UTF-8 \
75 is_IS.UTF-8 \
76 kk_KZ.UTF-8 \
77 ku_TR.UTF-8 \
78 ky_KG.UTF-8 \
79 ln_CD.UTF-8 \
80 lt_LT.UTF-8 \
81 lv_LV.UTF-8 \
82 mi_NZ.UTF-8 \
83 ml_IN.UTF-8 \
84 mn_MN.UTF-8 \
85 mr_IN.UTF-8 \
86 mt_MT.UTF-8 \
87 nan_TW.UTF-8@latin \
88 nb_NO.UTF-8 \
89 om_KE.UTF-8 \
90 os_RU.UTF-8 \
91 pl_PL.UTF-8 \
92 ps_AF.UTF-8 \
93 ro_RO.UTF-8 \
94 ru_RU.UTF-8 \
95 sc_IT.UTF-8 \
96 se_NO.UTF-8 \
97 si_LK.UTF-8 \
98 sq_AL.UTF-8 \
99 sr_RS.UTF-8 \
100 sv_SE.ISO-8859-1 \
101 sv_SE.UTF-8 \
102 szl_PL.UTF-8 \
103 tg_TJ.UTF-8 \
104 tk_TM.UTF-8 \
105 tr_TR.UTF-8 \
106 tt_RU.UTF-8 \
107 tt_RU.UTF-8@iqtelif \
108 ug_CN.UTF-8 \
109 uk_UA.UTF-8 \
110 uz_UZ.UTF-8 \
111 vi_VN.UTF-8 \
112 yi_US.UTF-8 \
113 yo_NG.UTF-8 \
114 zh_CN.UTF-8 \
115 $(NULL)
116
56fa555a 117test-input-data = $(addsuffix .in, $(test-input))
da2d1bc5
UD
118test-output := $(foreach s, .out .xout, \
119 $(addsuffix $s, $(basename $(test-input))))
69c69fe1 120ld-test-names := test1 test2 test3 test4 test5 test6 test7
0a614877 121ld-test-srcs := $(addprefix tests/,$(addsuffix .cm,$(ld-test-names)) \
afa0569f 122 $(addsuffix .def,$(ld-test-names)) \
cf2964e2
UD
123 $(addsuffix .ds,test5 test6) \
124 test6.c trans.def)
880f421f 125
8956ac9e
UD
126fmon-tests = n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
127 y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
128
f08e9a26 129generated += $(test-input) $(test-output) sort-test.out tst-locale.out \
2976feab 130 tst-leaks.mtrace mtrace-tst-leaks.out
f08e9a26 131generated-dirs += $(ld-test-names) tt_TT de_DE.437 \
40c4c9b5 132 $(addprefix tstfmon_,$(fmon-tests)) \
414fd335 133
03ac099f 134ifeq ($(run-built-tests),yes)
5ca8accd
AJ
135locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
136 tst_iswctype tst_iswdigit tst_iswgraph \
137 tst_iswlower tst_iswprint tst_iswpunct \
138 tst_iswspace tst_iswupper tst_iswxdigit tst_mblen \
139 tst_mbrlen tst_mbrtowc tst_mbsrtowcs tst_mbstowcs \
140 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm \
141 tst_swscanf tst_towctrans tst_towlower \
142 tst_towupper tst_wcrtomb tst_wcscat tst_wcschr \
143 tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn \
144 tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy \
145 tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
146 tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
147 tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \
148 tst_wctype tst_wcwidth
2e23c3cc 149
7bcad280 150tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
2976feab
JM
151 tst-leaks tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
152 tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
4e8f95a0
FW
153 tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 \
154 tst-wctype
c34521ce
L
155tests-static = bug-setlocale1-static
156tests += $(tests-static)
7bcad280
UD
157ifeq (yes,$(build-shared))
158ifneq (no,$(PERL))
0b20a9e8 159tests-special += $(objpfx)mtrace-tst-leaks.out
7bcad280
UD
160endif
161endif
0e16ecfa 162endif
0e16ecfa 163
f5f52655 164# Files to install.
d77cd295
UD
165install-others := $(addprefix $(inst_i18ndir)/, \
166 $(addsuffix .gz, $(charmaps)) \
167 $(locales))
f5f52655 168
23433315
PP
169tests: $(objdir)/iconvdata/gconv-modules
170
85bb81c9
WN
171tests-static += tst-langinfo-static
172
173ifeq ($(run-built-tests),yes)
f214606a
JM
174tests-special += $(objpfx)sort-test.out $(objpfx)tst-fmon.out \
175 $(objpfx)tst-locale.out $(objpfx)tst-rpmatch.out \
2976feab 176 $(objpfx)tst-trans.out $(objpfx)tst-ctype.out \
ae75a883
AJ
177 $(objpfx)tst-langinfo.out $(objpfx)tst-langinfo-static.out \
178 $(objpfx)tst-numeric.out
15973854
MF
179# We have to generate locales (list sorted alphabetically)
180LOCALES := \
181 am_ET.UTF-8 \
182 az_AZ.UTF-8 \
183 be_BY.UTF-8 \
184 ber_DZ.UTF-8 \
185 ber_MA.UTF-8 \
186 bg_BG.UTF-8 \
187 br_FR.UTF-8 \
188 bs_BA.UTF-8 \
189 cmn_TW.UTF-8 \
190 crh_UA.UTF-8 \
191 cs_CZ.UTF-8 \
192 csb_PL.UTF-8 \
193 cv_RU.UTF-8 \
194 cy_GB.UTF-8 \
195 da_DK.ISO-8859-1 \
196 de_DE.ISO-8859-1 \
197 de_DE.UTF-8 \
198 dz_BT.UTF-8 \
199 en_GB.UTF-8 \
200 en_US.ANSI_X3.4-1968 \
201 en_US.ISO-8859-1\
202 en_US.UTF-8 \
203 eo.UTF-8 \
204 es_ES.UTF-8 \
205 et_EE.UTF-8 \
206 fa_IR.UTF-8 \
207 fi_FI.UTF-8 \
208 fil_PH.UTF-8 \
209 fr_CA.UTF-8 \
210 fr_FR.ISO-8859-1 \
211 fr_FR.UTF-8 \
212 fur_IT.UTF-8 \
213 gez_ER.UTF-8@abegede \
214 ha_NG.UTF-8 \
215 hr_HR.ISO-8859-2 \
216 hr_HR.UTF-8 \
217 hsb_DE.UTF-8 \
218 hu_HU.UTF-8 \
219 ig_NG.UTF-8 \
220 ik_CA.UTF-8 \
221 is_IS.UTF-8 \
222 ja_JP.EUC-JP \
223 ja_JP.SJIS \
224 ja_JP.UTF-8 \
225 kk_KZ.UTF-8 \
226 ku_TR.UTF-8 \
227 ky_KG.UTF-8 \
228 ln_CD.UTF-8 \
229 lt_LT.UTF-8 \
230 lv_LV.UTF-8 \
231 mi_NZ.UTF-8 \
232 ml_IN.UTF-8 \
233 mn_MN.UTF-8 \
234 mr_IN.UTF-8 \
235 mt_MT.UTF-8 \
236 nan_TW.UTF-8@latin \
237 nb_NO.ISO-8859-1 \
238 nb_NO.UTF-8 \
239 nn_NO.ISO-8859-1 \
240 om_KE.UTF-8 \
241 os_RU.UTF-8 \
242 pl_PL.UTF-8 \
243 ps_AF.UTF-8 \
244 ro_RO.UTF-8 \
245 ru_RU.UTF-8 \
246 sc_IT.UTF-8 \
247 se_NO.UTF-8 \
248 si_LK.UTF-8 \
249 sq_AL.UTF-8 \
250 sr_RS.UTF-8 \
251 sv_SE.ISO-8859-1 \
252 sv_SE.UTF-8 \
253 szl_PL.UTF-8 \
254 tg_TJ.UTF-8 \
255 tk_TM.UTF-8 \
256 tr_TR.ISO-8859-9 \
257 tr_TR.UTF-8 \
258 tt_RU.UTF-8 \
259 tt_RU.UTF-8@iqtelif \
260 ug_CN.UTF-8 \
261 uk_UA.UTF-8 \
262 uz_UZ.UTF-8 \
263 vi_VN.UTF-8 \
264 yi_US.UTF-8 \
265 yo_NG.UTF-8 \
266 zh_CN.UTF-8 \
267 zh_TW.EUC-TW \
268 $(NULL)
269
9f53d7ad 270include ../gen-locales.mk
6f99f280
JM
271endif
272
f5f52655
UD
273include ../Rules
274
d77cd295
UD
275# Install the charmap files in gzipped format.
276$(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
277 $(make-target-directory)
278 rm -f $(@:.gz=) $@
279 $(INSTALL_DATA) $< $(@:.gz=)
962edb7e 280 gzip -9n $(@:.gz=)
d77cd295
UD
281
282# Install the locale source files in the appropriate directory.
73237de3 283$(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
f5f52655 284
03ac099f 285ifeq ($(run-built-tests),yes)
40c4c9b5
UD
286generated-dirs += $(LOCALES)
287
9f2bedd0 288$(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
5e087c71
UD
289 $(addprefix $(objpfx),$(CTYPE_FILES))
290
ca41028b
UD
291$(objpfx)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
292 $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
8540f6d2
JM
293 $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
294 '$(run-program-env)' '$(test-program-prefix-after-env)' \
295 $(test-input) \
f0881698
JM
296 > $@; \
297 $(evaluate-test)
ca41028b
UD
298$(objpfx)tst-fmon.out: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data \
299 $(objpfx)sort-test.out \
300 $(addprefix $(objpfx),$(CTYPE_FILES))
8540f6d2
JM
301 $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \
302 '$(run-program-env)' '$(run-program-prefix-after-env)' \
303 '$(test-program-prefix)' tst-fmon.data \
f0881698
JM
304 > $@; \
305 $(evaluate-test)
76352f64
UD
306$(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \
307 $(objpfx)sort-test.out \
308 $(addprefix $(objpfx),$(CTYPE_FILES))
740b3dbe 309 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' tst-numeric.data \
f0881698
JM
310 > $@; \
311 $(evaluate-test)
ca41028b
UD
312$(objpfx)tst-locale.out: tst-locale.sh $(common-objpfx)locale/localedef \
313 $(ld-test-srcs) $(addprefix $(objpfx),$(CTYPE_FILES))
8540f6d2
JM
314 $(SHELL) $< $(common-objpfx) '$(built-program-cmd-before-env)' \
315 '$(run-program-env)' '$(built-program-cmd-after-env)' > $@; \
f0881698 316 $(evaluate-test)
ca41028b
UD
317$(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \
318 $(objpfx)tst-fmon.out \
319 $(addprefix $(objpfx),$(CTYPE_FILES))
f0881698
JM
320 $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
321 $(evaluate-test)
ca41028b
UD
322$(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \
323 $(addprefix $(objpfx),$(CTYPE_FILES))
8540f6d2
JM
324 $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \
325 '$(run-program-env)' '$(run-program-prefix-after-env)' \
326 '$(test-program-prefix-before-env)' \
d5afb385 327 '$(test-program-prefix-after-env)' > $@; \
f0881698 328 $(evaluate-test)
ca41028b
UD
329$(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \
330 $(objpfx)sort-test.out \
331 $(addprefix $(objpfx),$(CTYPE_FILES))
8540f6d2 332 $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
d5afb385 333 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
f0881698 334 $(evaluate-test)
f79d99cb
UD
335$(objpfx)tst-langinfo.out: tst-langinfo.sh $(objpfx)tst-langinfo \
336 $(objpfx)sort-test.out \
337 $(addprefix $(objpfx),$(CTYPE_FILES))
8540f6d2
JM
338 $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
339 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
ae75a883
AJ
340 $(evaluate-test)
341$(objpfx)tst-langinfo-static.out: tst-langinfo.sh $(objpfx)tst-langinfo-static \
342 $(objpfx)sort-test.out \
343 $(addprefix $(objpfx),$(CTYPE_FILES))
8540f6d2
JM
344 $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
345 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
f0881698 346 $(evaluate-test)
69c69fe1 347$(objpfx)tst-digits.out: $(objpfx)tst-locale.out
db2d05f9 348$(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES))
df455ccb 349endif
92610fbe 350
f7364247
UD
351include SUPPORTED
352
353INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
354
92610fbe 355# Sometimes the whole collection of locale files should be installed.
246a9a19 356LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
85d89278 357$(rtld-prefix) $(common-objpfx)locale/localedef
f7364247
UD
358install-locales: $(INSTALL-SUPPORTED-LOCALES)
359
360install-locales-dir:
90fe682d 361 $(..)./scripts/mkinstalldirs $(inst_complocaledir)
f7364247 362
02eec681
CD
363# The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
364# therefore we have to use --no-warnings=ascii to disable the ASCII check.
365# See localedata/gen-locale.sh for the same logic.
f7364247
UD
366$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
367 @locale=`echo $@ | sed -e 's/^install-//'`; \
368 charset=`echo $$locale | sed -e 's,.*/,,'`; \
369 locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
81be4b5e 370 flags="-c"; \
02eec681
CD
371 if [ "$$charset" = 'SHIFT_JIS' ] \
372 || [ "$$charset" = 'SHIFT_JISX0213' ]; then \
373 flags="$$flags --no-warnings=ascii"; \
374 fi; \
f7364247
UD
375 echo -n `echo $$locale | sed 's/\([^.\@]*\).*/\1/'`; \
376 echo -n ".$$charset"; \
377 echo -n `echo $$locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
378 echo -n '...'; \
379 input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
02eec681
CD
380 $(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
381 -i locales/$$input -f charmaps/$$charset \
6c307927
CD
382 $(addprefix --prefix=,$(install_root)) $$locale \
383 && echo ' done'; \
5b905722 384
2bf18041 385tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
2976feab 386tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP
2bf18041
JM
387
388tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace
0b20a9e8 389$(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out
f0881698
JM
390 $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@; \
391 $(evaluate-test)
23433315 392
9162c01d
RM
393bug-setlocale1-ENV-only = LOCPATH=$(objpfx) LC_CTYPE=de_DE.UTF-8
394bug-setlocale1-static-ENV-only = $(bug-setlocale1-ENV-only)
cc9e536d 395
23433315
PP
396$(objdir)/iconvdata/gconv-modules:
397 $(MAKE) -C ../iconvdata subdir=iconvdata $@