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