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