Update.
[platform/upstream/glibc.git] / localedata / Makefile
1 # Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
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
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.
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
12 # Library General Public License for more details.
13
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.
18
19 # Makefile for installing locale data source files.
20
21 subdir := localedata
22
23 all: # Make this the default target; it will be defined in Rules.
24
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]*))
29
30 # List with all available character set descriptions.
31 locales := $(filter-out $(addprefix locales/, CVS RCS SCCS %~), \
32                                     $(wildcard locales/*))
33
34 # List of repertoire maps.
35 repertoiremaps := $(filter-out $(addprefix repertoiremaps/, CVS RCS SCCS %~), \
36                                            $(wildcard repertoiremaps/*))
37
38
39 subdir-dirs = tests-mbwc
40 vpath %.c tests-mbwc
41 vpath %.h tests-mbwc
42
43
44 test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
45              tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
46              tst-ctype
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) \
57                                    test6.c trans.def)
58
59 fmon-tests = n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
60              y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
61
62 generated := $(test-input) $(test-output)
63 generated-dirs := $(basename $(test-input)) $(ld-test-names) tt_TT      \
64                   de_DE.437 $(addprefix tstfmon_,$(fmon-tests))         \
65                   en_US.ANSI_X3.4-1968 ja_JP.EUC-JP
66
67 distribute := CHECKSUMS README SUPPORTED ChangeLog                      \
68               $(charmaps) $(locales) $(repertoiremaps)                  \
69               tst-rpmatch.sh tst-locale.sh tst-fmon.sh sort-test.sh     \
70               tst-fmon.data $(test-input-data) $(ld-test-srcs)          \
71               th_TH.in cs_CZ.in tst-mbswcs.sh tst-trans.sh tst-ctype.sh \
72               tst-ctype-de_DE.in
73
74 # Get $(inst_i18ndir) defined.
75 include ../Makeconfig
76
77 ifeq (no,$(cross-compiling))
78 ifeq (yes,$(build-shared))
79 # Disable the tests for now - first the locales have to be generated
80 locale_test_suite := tst_iswalnum tst_iswprint tst_towctrans tst_wcsncmp \
81                      tst_wctrans tst_iswalpha tst_iswpunct tst_wcschr    \
82                      tst_wcspbrk tst_wctype tst_iswcntrl tst_iswspace    \
83                      tst_wcscoll tst_wcsspn tst_iswdigit tst_iswupper    \
84                      tst_wcscpy tst_wcsstr tst_iswgraph tst_iswxdigit    \
85                      tst_wcscspn tst_wcswidth tst_iswlower tst_swscanf   \
86                      tst_wcslen tst_wctob tst_iswctype tst_towlower      \
87                      tst_wcscat tst_towupper tst_wcscmp tst_wcsncat      \
88                      tst_wcsncpy tst_wcsxfrm tst_wcwidth tst_mbrlen
89 tests = $(locale_test_suite)
90 endif
91 endif
92
93 # Files to install.
94 install-others := $(addprefix $(inst_i18ndir)/, $(charmaps) $(locales) \
95                                                 $(repertoiremaps))
96
97 include ../Rules
98
99 # Install the source files in the appropriate directories.
100 $(inst_i18ndir)/charmaps/%: charmaps/% $(+force); $(do-install)
101 $(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
102 $(inst_i18ndir)/repertoiremaps/%: repertoiremaps/% $(+force); $(do-install)
103
104 # gcc does not know all the format specifiers we are using here.
105 CFLAGS-tst-mbswcs1.c = -Wno-format
106 CFLAGS-tst-mbswcs2.c = -Wno-format
107 CFLAGS-tst-mbswcs3.c = -Wno-format
108 CFLAGS-tst-mbswcs4.c = -Wno-format
109 CFLAGS-tst-mbswcs5.c = -Wno-format
110 CFLAGS-tst-trans.c = -Wno-format
111
112
113 ifeq (no,$(cross-compiling))
114 ifeq (yes,$(build-shared))
115 .PHONY: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-tst-trans \
116         do-tst-mbswcs do-tst-ctype
117 tests: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-tst-trans \
118        do-tst-mbswcs do-tst-ctype
119 do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
120                  $(test-input-data)
121         $(SHELL) -e $< $(common-objpfx) $(test-input)
122 do-tst-fmon: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data  do-collate-test
123         $(SHELL) -e $< $(common-objpfx) tst-fmon.data
124 do-tst-locale: tst-locale.sh $(ld-test-srcs)
125         $(SHELL) -e $< $(common-objpfx)
126 do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-tst-fmon
127         $(SHELL) -e $< $(common-objpfx)
128 do-tst-trans: tst-trans.sh $(objpfx)tst-trans
129         $(SHELL) -e $< $(common-objpfx)
130 do-tst-mbswcs: tst-mbswcs.sh $(objpfx)tst-mbswcs1 $(objpfx)tst-mbswcs2 \
131                $(objpfx)tst-mbswcs3 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5
132         $(SHELL) -e $< $(common-objpfx)
133 do-tst-ctype: tst-ctype.sh $(objpfx)tst-ctype do-collate-test
134         $(SHELL) -e $< $(common-objpfx)
135 $(addsuffix .out,$(addprefix $(objpfx),$(locale_test_suite))): %: do-tst-ctype
136 endif
137 endif
138
139 # Sometimes the whole collection of locale files should be installed.
140 LOCALEDEF=I18NPATH=. $(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
141 install-locales:
142         $(..)./scripts/mkinstalldirs $(inst_localedir)
143         while read locale charset; do \
144            case $$locale in \#*) continue;; esac; \
145            $(LOCALEDEF) -i locales/`echo $$locale | sed 's/\([^.]*\).*/\1/'` \
146                         -c -f charmaps/$$charset \
147                         -u repertoiremaps/mnemonic.ds \
148                         $(inst_localedir)/$$locale; \
149         done < SUPPORTED
150
151 TEST_MBWC_ENV:= LOCPATH=$(common-objpfx)/localedata
152 tst_iswalnum-ENV = $(TEST_MBWC_ENV)
153 tst_iswalpha-ENV = $(TEST_MBWC_ENV)
154 tst_iswcntrl-ENV = $(TEST_MBWC_ENV)
155 tst_iswctype-ENV = $(TEST_MBWC_ENV)
156 tst_iswdigit-ENV = $(TEST_MBWC_ENV)
157 tst_iswgraph-ENV = $(TEST_MBWC_ENV)
158 tst_iswlower-ENV = $(TEST_MBWC_ENV)
159 tst_iswprint-ENV = $(TEST_MBWC_ENV)
160 tst_iswpunct-ENV = $(TEST_MBWC_ENV)
161 tst_iswspace-ENV = $(TEST_MBWC_ENV)
162 tst_iswupper-ENV = $(TEST_MBWC_ENV)
163 tst_iswxdigit-ENV = $(TEST_MBWC_ENV)
164 tst_mbrlen-ENV = $(TEST_MBWC_ENV)
165 tst_swscanf-ENV = $(TEST_MBWC_ENV)
166 tst_towctrans-ENV = $(TEST_MBWC_ENV)
167 tst_towlower-ENV = $(TEST_MBWC_ENV)
168 tst_towupper-ENV = $(TEST_MBWC_ENV)
169 tst_wcscat-ENV = $(TEST_MBWC_ENV)
170 tst_wcschr-ENV = $(TEST_MBWC_ENV)
171 tst_wcscmp-ENV = $(TEST_MBWC_ENV)
172 tst_wcscoll-ENV = $(TEST_MBWC_ENV)
173 tst_wcscpy-ENV = $(TEST_MBWC_ENV)
174 tst_wcscspn-ENV = $(TEST_MBWC_ENV)
175 tst_wcslen-ENV = $(TEST_MBWC_ENV)
176 tst_wcsncat-ENV = $(TEST_MBWC_ENV)
177 tst_wcsncmp-ENV = $(TEST_MBWC_ENV)
178 tst_wcsncpy-ENV = $(TEST_MBWC_ENV)
179 tst_wcspbrk-ENV = $(TEST_MBWC_ENV)
180 tst_wcsspn-ENV = $(TEST_MBWC_ENV)
181 tst_wcsstr-ENV = $(TEST_MBWC_ENV)
182 tst_wcswidth-ENV = $(TEST_MBWC_ENV)
183 tst_wcsxfrm-ENV = $(TEST_MBWC_ENV)
184 tst_wctob-ENV = $(TEST_MBWC_ENV)
185 tst_wctrans-ENV = $(TEST_MBWC_ENV)
186 tst_wctype-ENV = $(TEST_MBWC_ENV)
187 tst_wcwidth-ENV = $(TEST_MBWC_ENV)