1 # Copyright (C) 1996-2018 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 installing locale data source files.
24 # List with all available character set descriptions.
25 charmaps
:= $(wildcard charmaps
/[A-I
]*) $(wildcard charmaps
/[J-Z
]*)
27 # List with all available character set descriptions.
28 locales
:= $(wildcard locales
/*)
31 subdir-dirs
= tests-mbwc
36 test-srcs
:= collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
37 tst-ctype tst-langinfo tst-langinfo-static tst-numeric
38 # List of test input files (list sorted alphabetically):
67 gez_ER.UTF-8@abegede \
107 tt_RU.UTF-8@iqtelif \
117 test-input-data
= $(addsuffix .in
, $(test-input
))
118 test-output
:= $(foreach s
, .out .xout
, \
119 $(addsuffix $s, $(basename $(test-input
))))
120 ld-test-names
:= test1 test2 test3 test4 test5 test6 test7
121 ld-test-srcs
:= $(addprefix tests
/,$(addsuffix .cm
,$(ld-test-names
)) \
122 $(addsuffix .def
,$(ld-test-names
)) \
123 $(addsuffix .ds
,test5 test6
) \
126 fmon-tests
= n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
127 y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
129 generated
+= $(test-input
) $(test-output
) sort-test.out tst-locale.out \
130 tst-leaks.mtrace mtrace-tst-leaks.out
131 generated-dirs
+= $(ld-test-names
) tt_TT de_DE
.437 \
132 $(addprefix tstfmon_
,$(fmon-tests
)) \
134 ifeq ($(run-built-tests
),yes
)
135 locale_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
150 tests
= $(locale_test_suite
) tst-digits tst-setlocale bug-iconv-trans \
151 tst-leaks tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
152 tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
153 tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 \
155 tests-static
= bug-setlocale1-static
156 tests
+= $(tests-static
)
157 ifeq (yes
,$(build-shared
))
159 tests-special
+= $(objpfx
)mtrace-tst-leaks.out
165 install-others
:= $(addprefix $(inst_i18ndir
)/, \
166 $(addsuffix .gz
, $(charmaps
)) \
169 tests
: $(objdir
)/iconvdata
/gconv-modules
171 tests-static
+= tst-langinfo-static
173 ifeq ($(run-built-tests
),yes
)
174 tests-special
+= $(objpfx
)sort-test.out
$(objpfx
)tst-fmon.out \
175 $(objpfx
)tst-locale.out
$(objpfx
)tst-rpmatch.out \
176 $(objpfx
)tst-trans.out
$(objpfx
)tst-ctype.out \
177 $(objpfx
)tst-langinfo.out
$(objpfx
)tst-langinfo-static.out \
178 $(objpfx
)tst-numeric.out
179 # We have to generate locales (list sorted alphabetically)
200 en_US.ANSI_X3.4
-1968 \
213 gez_ER.UTF-8@abegede \
259 tt_RU.UTF-8@iqtelif \
270 include ..
/gen-locales.mk
275 # Install the charmap files in gzipped format.
276 $(inst_i18ndir
)/charmaps
/%.gz
: charmaps
/% $(+force)
277 $(make-target-directory
)
279 $(INSTALL_DATA
) $< $(@
:.gz
=)
282 # Install the locale source files in the appropriate directory.
283 $(inst_i18ndir
)/locales
/%: locales
/% $(+force); $(do-install
)
285 ifeq ($(run-built-tests
),yes
)
286 generated-dirs
+= $(LOCALES
)
288 $(addsuffix .out
,$(addprefix $(objpfx
),$(tests
))): %: \
289 $(addprefix $(objpfx
),$(CTYPE_FILES
))
291 $(objpfx
)sort-test.out
: sort-test.sh
$(objpfx
)collate-test
$(objpfx
)xfrm-test \
292 $(test-input-data
) $(addprefix $(objpfx
),$(CTYPE_FILES
))
293 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix-before-env)' \
294 '$(run-program-env)' '$(test-program-prefix-after-env)' \
298 $(objpfx
)tst-fmon.out
: tst-fmon.sh
$(objpfx
)tst-fmon tst-fmon.data \
299 $(objpfx
)sort-test.out \
300 $(addprefix $(objpfx
),$(CTYPE_FILES
))
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 \
306 $(objpfx
)tst-numeric.out
: tst-numeric.sh
$(objpfx
)tst-numeric tst-numeric.data \
307 $(objpfx
)sort-test.out \
308 $(addprefix $(objpfx
),$(CTYPE_FILES
))
309 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)' tst-numeric.data \
312 $(objpfx
)tst-locale.out
: tst-locale.sh
$(common-objpfx
)locale
/localedef \
313 $(ld-test-srcs
) $(addprefix $(objpfx
),$(CTYPE_FILES
))
314 $(SHELL
) $< $(common-objpfx
) '$(built-program-cmd-before-env)' \
315 '$(run-program-env)' '$(built-program-cmd-after-env)' > $@
; \
317 $(objpfx
)tst-rpmatch.out
: tst-rpmatch.sh
$(objpfx
)tst-rpmatch \
318 $(objpfx
)tst-fmon.out \
319 $(addprefix $(objpfx
),$(CTYPE_FILES
))
320 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd)' > $@
; \
322 $(objpfx
)tst-trans.out
: tst-trans.sh
$(objpfx
)tst-trans \
323 $(addprefix $(objpfx
),$(CTYPE_FILES
))
324 $(SHELL
) $< $(common-objpfx
) '$(run-program-prefix-before-env)' \
325 '$(run-program-env)' '$(run-program-prefix-after-env)' \
326 '$(test-program-prefix-before-env)' \
327 '$(test-program-prefix-after-env)' > $@
; \
329 $(objpfx
)tst-ctype.out
: tst-ctype.sh
$(objpfx
)tst-ctype \
330 $(objpfx
)sort-test.out \
331 $(addprefix $(objpfx
),$(CTYPE_FILES
))
332 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd-before-env)' \
333 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@
; \
335 $(objpfx
)tst-langinfo.out
: tst-langinfo.sh
$(objpfx
)tst-langinfo \
336 $(objpfx
)sort-test.out \
337 $(addprefix $(objpfx
),$(CTYPE_FILES
))
338 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd-before-env)' \
339 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@
; \
341 $(objpfx
)tst-langinfo-static.out
: tst-langinfo.sh
$(objpfx
)tst-langinfo-static \
342 $(objpfx
)sort-test.out \
343 $(addprefix $(objpfx
),$(CTYPE_FILES
))
344 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd-before-env)' \
345 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@
; \
347 $(objpfx
)tst-digits.out
: $(objpfx
)tst-locale.out
348 $(objpfx
)tst-mbswcs6.out
: $(addprefix $(objpfx
),$(CTYPE_FILES
))
353 INSTALL-SUPPORTED-LOCALES
=$(addprefix install-
, $(SUPPORTED-LOCALES
))
355 # Sometimes the whole collection of locale files should be installed.
356 LOCALEDEF
=I18NPATH
=. GCONV_PATH
=$(common-objpfx
)iconvdata LC_ALL
=C \
357 $(rtld-prefix
) $(common-objpfx
)locale
/localedef
358 install-locales
: $(INSTALL-SUPPORTED-LOCALES
)
361 $(..
).
/scripts
/mkinstalldirs
$(inst_complocaledir
)
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.
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,/[^/]*,,'`; \
371 if
[ "$$charset" = 'SHIFT_JIS' ] \
372 ||
[ "$$charset" = 'SHIFT_JISX0213' ]; then \
373 flags
="$$flags --no-warnings=ascii"; \
375 echo
-n
`echo $$locale | sed 's/\([^.\@]*\).*/\1/'`; \
376 echo
-n
".$$charset"; \
377 echo
-n
`echo $$locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
379 input
=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
380 $(LOCALEDEF
) $$flags --alias-file
=..
/intl
/locale.alias \
381 -i locales
/$$input -f charmaps
/$$charset \
382 $(addprefix --prefix=,$(install_root
)) $$locale \
385 tst-setlocale-ENV
= LC_ALL
=ja_JP.EUC-JP
386 tst-wctype-ENV
= LC_ALL
=ja_JP.EUC-JP
388 tst-leaks-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks.mtrace
389 $(objpfx
)mtrace-tst-leaks.out
: $(objpfx
)tst-leaks.out
390 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks.mtrace
> $@
; \
393 bug-setlocale1-ENV-only
= LOCPATH
=$(objpfx
) LC_CTYPE
=de_DE.UTF-8
394 bug-setlocale1-static-ENV-only
= $(bug-setlocale1-ENV-only
)
396 $(objdir
)/iconvdata
/gconv-modules
:
397 $(MAKE
) -C ..
/iconvdata subdir
=iconvdata
$@