1 # Copyright (C) 1996, 1997, 1998, 1999, 2000 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 Library General Public License
6 # as published by the Free Software Foundation; either version 2 of
7 # 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 # Library General Public License for more details.
14 # You should have received a copy of the GNU Library General Public
15 # License along with the GNU C Library; see the file COPYING.LIB. If not,
16 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
19 # Makefile for installing locale data source files.
23 all: # Make this the default target; it will be defined in Rules.
25 # List with all available character set descriptions.
26 charmaps
:= $(filter-out $(addprefix charmaps
/, CVS RCS SCCS
%~
), \
27 $(wildcard charmaps
/[A-I
]*) \
28 $(wildcard charmaps
/[J-Z
]*))
30 # List with all available character set descriptions.
31 locales
:= $(filter-out $(addprefix locales
/, CVS RCS SCCS
%~
), \
32 $(wildcard locales
/*))
34 # List of repertoire maps.
35 repertoiremaps
:= $(filter-out $(addprefix repertoiremaps
/, CVS RCS SCCS
%~
), \
36 $(wildcard repertoiremaps
/*))
39 subdir-dirs
= tests-mbwc
44 test-srcs
:= collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
45 tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
47 #test-input := de_DE.ISO-8859-1 da_DK.ISO-8859-1 fr_CA,2.13.ISO-8859-1 \
48 # hr_HR.ISO-8859-2 # once it is fixed: cs_CZ.ISO-8859-2
49 test-input
:= de_DE.ISO-8859-1 en_US.ISO-8859-1
50 test-input-data
= $(addsuffix .in
, $(basename $(test-input
)))
51 test-output
:= $(foreach s
, .out .xout
, \
52 $(addsuffix $s, $(basename $(test-input
))))
53 ld-test-names
:= test1 test2 test3 test4 test5 test6
54 ld-test-srcs
:= $(addprefix tests
/,$(addsuffix .cm
,$(ld-test-names
)) \
55 $(addsuffix .def
,$(ld-test-names
)) \
56 $(addsuffix .ds
,test5 test6
) \
59 fmon-tests
= n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
60 y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
62 generated
:= $(test-input
) $(test-output
)
63 generated-dirs
:= $(ld-test-names
) tt_TT de_DE
.437 \
64 $(addprefix tstfmon_
,$(fmon-tests
)) \
66 distribute
:= CHECKSUMS README SUPPORTED ChangeLog \
67 $(charmaps
) $(locales
) $(repertoiremaps
) \
68 tst-rpmatch.sh tst-locale.sh tst-fmon.sh sort-test.sh \
69 tst-fmon.data
$(test-input-data
) $(ld-test-srcs
) \
70 th_TH.in cs_CZ.in tst-mbswcs.sh tst-trans.sh tst-ctype.sh \
71 tst-ctype-de_DE.in
$(wildcard tests-mbwc
/*.
[ch
]) \
72 $(addprefix tst-fmon-locales
/tstfmon_
,$(fmon-tests
)) \
73 gen-locale.sh show-ucs-data.c
75 # Get $(inst_i18ndir) defined.
78 ifeq (no
,$(cross-compiling
))
79 locale_test_suite
:= tst_iswalnum tst_iswalpha tst_iswcntrl \
80 tst_iswctype tst_iswdigit tst_iswgraph \
81 tst_iswlower tst_iswprint tst_iswpunct \
82 tst_iswspace tst_iswupper tst_iswxdigit tst_mblen \
83 tst_mbrlen tst_mbrtowc tst_mbsrtowcs tst_mbstowcs \
84 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm \
85 tst_swscanf tst_towctrans tst_towlower \
86 tst_towupper tst_wcrtomb tst_wcscat tst_wcschr \
87 tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn \
88 tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy \
89 tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
90 tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
91 tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \
92 tst_wctype tst_wcwidth
94 tests
= $(locale_test_suite
)
98 install-others
:= $(addprefix $(inst_i18ndir
)/, $(charmaps
) $(locales
) \
103 # Install the source files in the appropriate directories.
104 $(inst_i18ndir
)/charmaps
/%: charmaps
/% $(+force); $(do-install
)
105 $(inst_i18ndir
)/locales
/%: locales
/% $(+force); $(do-install
)
106 $(inst_i18ndir
)/repertoiremaps
/%: repertoiremaps
/% $(+force); $(do-install
)
108 # gcc does not know all the format specifiers we are using here.
109 CFLAGS-tst-mbswcs1.c
= -Wno-format
110 CFLAGS-tst-mbswcs2.c
= -Wno-format
111 CFLAGS-tst-mbswcs3.c
= -Wno-format
112 CFLAGS-tst-mbswcs4.c
= -Wno-format
113 CFLAGS-tst-mbswcs5.c
= -Wno-format
114 CFLAGS-tst-trans.c
= -Wno-format
117 ifeq (no
,$(cross-compiling
))
118 # We have to generate locales
119 LOCALES
:= de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4
-1968 \
120 en_US.ISO-8859-1 ja_JP.EUC-JP
121 LOCALE_SRCS
:= $(shell echo
"$(LOCALES)"|sed
's/\([^ .]*\)[^ ]*/\1/g')
122 CHARMAPS
:= $(shell echo
"$(LOCALES)"|sed
's/[^ .]*[.]\([^ ]*\)/\1/g')
123 CTYPE_FILES
= $(addsuffix /LC_CTYPE
,$(LOCALES
))
125 generated-dirs
+= $(LOCALES
)
127 # Dependency for the locale files. We actually make it depend only on
129 $(addprefix $(objpfx
),$(CTYPE_FILES
)): %: \
130 gen-locale.sh
$(common-objpfx
)locale
/localedef Makefile \
131 $(addprefix charmaps
/,$(CHARMAPS
)) $(addprefix locales
/,$(LOCALE_SRCS
))
132 @
$(SHELL
) -e gen-locale.sh
$(common-objpfx
) '$(built-program-cmd)' $@
134 $(addsuffix .out
,$(addprefix $(objpfx
),$(locale_test_suite
))): %: \
135 $(addprefix $(objpfx
),$(CTYPE_FILES
))
137 tests
: $(objpfx
)sort-test.out
$(objpfx
)tst-fmon.out
$(objpfx
)tst-locale.out \
138 $(objpfx
)tst-rpmatch.out
$(objpfx
)tst-trans.out \
139 $(objpfx
)tst-mbswcs.out
$(objpfx
)tst-ctype.out
141 $(objpfx
)sort-test.out
: sort-test.sh
$(objpfx
)collate-test
$(objpfx
)xfrm-test \
142 $(test-input-data
) $(addprefix $(objpfx
),$(CTYPE_FILES
))
143 $(SHELL
) -e
$< $(common-objpfx
) '$(run-program-prefix)' $(test-input
) \
145 $(objpfx
)tst-fmon.out
: tst-fmon.sh
$(objpfx
)tst-fmon tst-fmon.data \
146 $(objpfx
)sort-test.out \
147 $(addprefix $(objpfx
),$(CTYPE_FILES
))
148 $(SHELL
) -e
$< $(common-objpfx
) '$(run-program-prefix)' tst-fmon.data \
150 $(objpfx
)tst-locale.out
: tst-locale.sh
$(common-objpfx
)locale
/localedef \
151 $(ld-test-srcs
) $(addprefix $(objpfx
),$(CTYPE_FILES
))
152 $(SHELL
) -e
$< $(common-objpfx
) '$(built-program-cmd)' > $@
153 $(objpfx
)tst-rpmatch.out
: tst-rpmatch.sh
$(objpfx
)tst-rpmatch \
154 $(objpfx
)tst-fmon.out \
155 $(addprefix $(objpfx
),$(CTYPE_FILES
))
156 $(SHELL
) -e
$< $(common-objpfx
) '$(built-program-cmd)' > $@
157 $(objpfx
)tst-trans.out
: tst-trans.sh
$(objpfx
)tst-trans \
158 $(addprefix $(objpfx
),$(CTYPE_FILES
))
159 $(SHELL
) -e
$< $(common-objpfx
) '$(run-program-prefix)'
160 $(objpfx
)tst-mbswcs.out
: tst-mbswcs.sh
$(objpfx
)tst-mbswcs1 \
161 $(objpfx
)tst-mbswcs2
$(objpfx
)tst-mbswcs3 \
162 $(objpfx
)tst-mbswcs4
$(objpfx
)tst-mbswcs5 \
163 $(addprefix $(objpfx
),$(CTYPE_FILES
))
164 $(SHELL
) -e
$< $(common-objpfx
) '$(run-program-prefix)'
165 $(objpfx
)tst-ctype.out
: tst-ctype.sh
$(objpfx
)tst-ctype \
166 $(objpfx
)sort-test.out \
167 $(addprefix $(objpfx
),$(CTYPE_FILES
))
168 $(SHELL
) -e
$< $(common-objpfx
) '$(built-program-cmd)'
171 # Sometimes the whole collection of locale files should be installed.
172 LOCALEDEF
=I18NPATH
=.
$(common-objpfx
)elf
/ld.so
--library-path
$(rpath-link
) $(common-objpfx
)locale
/localedef
174 $(..
).
/scripts
/mkinstalldirs
$(inst_localedir
)
175 while read locale charset
; do \
176 case
$$locale in \
#*) continue;; esac; \
177 $(LOCALEDEF
) -i locales
/`echo $$locale | sed 's/\([^.]*\).*/\1/'` \
178 -c
-f charmaps
/$$charset \
179 $(inst_localedir
)/$$locale; \
182 # The mbwc-tests need some environment setup to find the locale data files
183 TEST_MBWC_ENV
:= LOCPATH
=$(common-objpfx
)localedata
184 tst_iswalnum-ENV
= $(TEST_MBWC_ENV
)
185 tst_iswalpha-ENV
= $(TEST_MBWC_ENV
)
186 tst_iswcntrl-ENV
= $(TEST_MBWC_ENV
)
187 tst_iswctype-ENV
= $(TEST_MBWC_ENV
)
188 tst_iswdigit-ENV
= $(TEST_MBWC_ENV
)
189 tst_iswgraph-ENV
= $(TEST_MBWC_ENV
)
190 tst_iswlower-ENV
= $(TEST_MBWC_ENV
)
191 tst_iswprint-ENV
= $(TEST_MBWC_ENV
)
192 tst_iswpunct-ENV
= $(TEST_MBWC_ENV
)
193 tst_iswspace-ENV
= $(TEST_MBWC_ENV
)
194 tst_iswupper-ENV
= $(TEST_MBWC_ENV
)
195 tst_iswxdigit-ENV
= $(TEST_MBWC_ENV
)
196 tst_mblen-ENV
= $(TEST_MBWC_ENV
)
197 tst_mbrlen-ENV
= $(TEST_MBWC_ENV
)
198 tst_mbrtowc-ENV
= $(TEST_MBWC_ENV
)
199 tst_mbsrtowcs-ENV
= $(TEST_MBWC_ENV
)
200 tst_mbstowcs-ENV
= $(TEST_MBWC_ENV
)
201 tst_mbtowc-ENV
= $(TEST_MBWC_ENV
)
202 tst_strcoll-ENV
= $(TEST_MBWC_ENV
)
203 tst_strfmon-ENV
= $(TEST_MBWC_ENV
)
204 tst_strxfrm-ENV
= $(TEST_MBWC_ENV
)
205 tst_swscanf-ENV
= $(TEST_MBWC_ENV
)
206 tst_towctrans-ENV
= $(TEST_MBWC_ENV
)
207 tst_towlower-ENV
= $(TEST_MBWC_ENV
)
208 tst_towupper-ENV
= $(TEST_MBWC_ENV
)
209 tst_wcrtomb-ENV
= $(TEST_MBWC_ENV
)
210 tst_wcscat-ENV
= $(TEST_MBWC_ENV
)
211 tst_wcschr-ENV
= $(TEST_MBWC_ENV
)
212 tst_wcscmp-ENV
= $(TEST_MBWC_ENV
)
213 tst_wcscoll-ENV
= $(TEST_MBWC_ENV
)
214 tst_wcscpy-ENV
= $(TEST_MBWC_ENV
)
215 tst_wcscspn-ENV
= $(TEST_MBWC_ENV
)
216 tst_wcslen-ENV
= $(TEST_MBWC_ENV
)
217 tst_wcsncat-ENV
= $(TEST_MBWC_ENV
)
218 tst_wcsncmp-ENV
= $(TEST_MBWC_ENV
)
219 tst_wcsncpy-ENV
= $(TEST_MBWC_ENV
)
220 tst_wcspbrk-ENV
= $(TEST_MBWC_ENV
)
221 tst_wcsrtombs-ENV
= $(TEST_MBWC_ENV
)
222 tst_wcsspn-ENV
= $(TEST_MBWC_ENV
)
223 tst_wcsstr-ENV
= $(TEST_MBWC_ENV
)
224 tst_wcstod-ENV
= $(TEST_MBWC_ENV
)
225 tst_wcstok-ENV
= $(TEST_MBWC_ENV
)
226 tst_wcstombs-ENV
= $(TEST_MBWC_ENV
)
227 tst_wcswidth-ENV
= $(TEST_MBWC_ENV
)
228 tst_wcsxfrm-ENV
= $(TEST_MBWC_ENV
)
229 tst_wctob-ENV
= $(TEST_MBWC_ENV
)
230 tst_wctomb-ENV
= $(TEST_MBWC_ENV
)
231 tst_wctrans-ENV
= $(TEST_MBWC_ENV
)
232 tst_wctype-ENV
= $(TEST_MBWC_ENV
)
233 tst_wcwidth-ENV
= $(TEST_MBWC_ENV
)