Add new files to tests and add environment for them.
[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 # Disable the tests for now - first the locales have to be generated
39 #tests := tst_iswalnum tst_iswprint tst_towctrans tst_wcsncmp tst_wctrans \
40 #         tst_iswalpha tst_iswpunct tst_wcschr tst_wcspbrk tst_wctype    \
41 #         tst_iswcntrl tst_iswspace tst_wcscoll tst_wcsspn tst_iswdigit  \
42 #         tst_iswupper tst_wcscpy tst_wcsstr tst_iswgraph tst_iswxdigit  \
43 #         tst_wcscspn tst_wcswidth tst_iswlower tst_swscanf tst_wcslen   \
44 #         tst_wctob tst_iswctype tst_towlower tst_wcscat tst_towupper    \
45 #         tst_wcscmp tst_wcsncat tst_wcsncpy tst_wcsxfrm tst_wcwidth
46 #
47
48 subdir-dirs = tests-mbwc
49 vpath %.c tests-mbwc
50 vpath %.h tests-mbwc
51
52
53 test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
54              tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
55              tst-ctype
56 #test-input := de_DE.ISO-8859-1 da_DK.ISO-8859-1 fr_CA,2.13.ISO-8859-1 \
57 #             hr_HR.ISO-8859-2 # once it is fixed: cs_CZ.ISO-8859-2
58 test-input := de_DE.ISO-8859-1 en_US.ISO-8859-1
59 test-input-data = $(addsuffix .in, $(basename $(test-input)))
60 test-output := $(foreach s, .out .xout, \
61                          $(addsuffix $s, $(basename $(test-input))))
62 ld-test-names := test1 test2 test3 test4 test5 test6
63 ld-test-srcs := $(addprefix tests/,$(addsuffix .cm,$(ld-test-names)) \
64                                    $(addsuffix .def,$(ld-test-names)) \
65                                    $(addsuffix .ds,test5 test6) \
66                                    test6.c trans.def)
67
68 fmon-tests = n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
69              y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
70
71 generated := $(test-input) $(test-output)
72 generated-dirs := $(basename $(test-input)) en_US $(ld-test-names) tt_TT\
73                   de_DE.437 $(addprefix tstfmon_,$(fmon-tests))
74
75 distribute := CHECKSUMS README SUPPORTED ChangeLog                      \
76               $(charmaps) $(locales) $(repertoiremaps)                  \
77               tst-rpmatch.sh tst-locale.sh tst-fmon.sh sort-test.sh     \
78               tst-fmon.data $(test-input-data) $(ld-test-srcs)          \
79               th_TH.in cs_CZ.in tst-mbswcs.sh tst-trans.sh tst-ctype.sh \
80               tst-ctype-de_DE.in
81
82 # Get $(inst_i18ndir) defined.
83 include ../Makeconfig
84
85 # Files to install.
86 install-others := $(addprefix $(inst_i18ndir)/, $(charmaps) $(locales) \
87                                                 $(repertoiremaps))
88
89 include ../Rules
90
91 # Install the source files in the appropriate directories.
92 $(inst_i18ndir)/charmaps/%: charmaps/% $(+force); $(do-install)
93 $(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
94 $(inst_i18ndir)/repertoiremaps/%: repertoiremaps/% $(+force); $(do-install)
95
96 # gcc does not know all the format specifiers we are using here.
97 CFLAGS-tst-mbswcs1.c = -Wno-format
98 CFLAGS-tst-mbswcs2.c = -Wno-format
99 CFLAGS-tst-mbswcs3.c = -Wno-format
100 CFLAGS-tst-mbswcs4.c = -Wno-format
101 CFLAGS-tst-mbswcs5.c = -Wno-format
102 CFLAGS-tst-trans.c = -Wno-format
103
104 ifeq (no,$(cross-compiling))
105 ifeq (yes,$(build-shared))
106 .PHONY: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-tst-trans \
107         do-tst-mbswcs do-tst-ctype
108 tests: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-tst-trans \
109        do-tst-mbswcs do-tst-ctype
110 do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
111                  $(test-input-data)
112         $(SHELL) -e $< $(common-objpfx) $(test-input)
113 do-tst-fmon: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data  do-collate-test
114         $(SHELL) -e $< $(common-objpfx) tst-fmon.data
115 do-tst-locale: tst-locale.sh $(ld-test-srcs)
116         $(SHELL) -e $< $(common-objpfx)
117 do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-tst-fmon
118         $(SHELL) -e $< $(common-objpfx)
119 do-tst-trans: tst-trans.sh $(objpfx)tst-trans
120         $(SHELL) -e $< $(common-objpfx)
121 do-tst-mbswcs: tst-mbswcs.sh $(objpfx)tst-mbswcs1 $(objpfx)tst-mbswcs2 \
122                $(objpfx)tst-mbswcs3 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5
123         $(SHELL) -e $< $(common-objpfx)
124 do-tst-ctype: tst-ctype.sh $(objpfx)tst-ctype do-collate-test
125         $(SHELL) -e $< $(common-objpfx)
126 endif
127 endif
128
129 # Sometimes the whole collection of locale files should be installed.
130 LOCALEDEF=I18NPATH=. $(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
131 install-locales:
132         $(..)./scripts/mkinstalldirs $(inst_localedir)
133         while read locale charset; do \
134            case $$locale in \#*) continue;; esac; \
135            $(LOCALEDEF) -i locales/`echo $$locale | sed 's/\([^.]*\).*/\1/'` \
136                         -c -f charmaps/$$charset \
137                         -u repertoiremaps/mnemonic.ds \
138                         $(inst_localedir)/$$locale; \
139         done < SUPPORTED
140
141 tst_iswcntrl-ENV = LOCPATH=$(common-objpfx)/localedata
142 tst_iswctype-ENV = LOCPATH=$(common-objpfx)/localedata
143 tst_iswdigit-ENV = LOCPATH=$(common-objpfx)/localedata
144 tst_iswgraph-ENV = LOCPATH=$(common-objpfx)/localedata
145 tst_iswlower-ENV = LOCPATH=$(common-objpfx)/localedata
146 tst_iswspace-ENV = LOCPATH=$(common-objpfx)/localedata
147 tst_iswupper-ENV = LOCPATH=$(common-objpfx)/localedata
148 tst_iswxdigit-ENV = LOCPATH=$(common-objpfx)/localedata
149 tst_swscanf-ENV = LOCPATH=$(common-objpfx)/localedata
150 tst_towlower-ENV = LOCPATH=$(common-objpfx)/localedata
151 tst_towupper-ENV = LOCPATH=$(common-objpfx)/localedata 
152 tst_wcscat-ENV = LOCPATH=$(common-objpfx)/localedata
153 tst_wcscmp-ENV = LOCPATH=$(common-objpfx)/localedata 
154 tst_wcscoll-ENV = LOCPATH=$(common-objpfx)/localedata
155 tst_wcscpy-ENV = LOCPATH=$(common-objpfx)/localedata
156 tst_wcscspn-ENV = LOCPATH=$(common-objpfx)/localedata
157 tst_wcslen-ENV = LOCPATH=$(common-objpfx)/localedata
158 tst_wcsncat-ENV = LOCPATH=$(common-objpfx)/localedata 
159 tst_wcsncpy-ENV = LOCPATH=$(common-objpfx)/localedata
160 tst_wcsspn-ENV = LOCPATH=$(common-objpfx)/localedata
161 tst_wcsstr-ENV = LOCPATH=$(common-objpfx)/localedata
162 tst_wcswidth-ENV = LOCPATH=$(common-objpfx)/localedata
163 tst_wcsxfrm-ENV = LOCPATH=$(common-objpfx)/localedata
164 tst_wctob-ENV = LOCPATH=$(common-objpfx)/localedata
165 tst_wcwidth-ENV = LOCPATH=$(common-objpfx)/localedata