]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/testdata/Makefile.in
ICU-491.11.3.tar.gz
[apple/icu.git] / icuSources / test / testdata / Makefile.in
CommitLineData
b75a7d8f
A
1#******************************************************************************
2#
4388f060 3# Copyright (C) 1998-2011, International Business Machines
b75a7d8f
A
4# Corporation and others. All Rights Reserved.
5#
6#******************************************************************************
7## Top-level Makefile.in for ICU
8## Stephen F. Booth
9
10## Source directory information
11srcdir = @srcdir@
12top_srcdir = @top_srcdir@
13
14top_builddir = ../..
15
16include $(top_builddir)/icudefs.mk
17
18## Build directory information
19subdir = test/testdata
20
b75a7d8f
A
21## Files to remove for 'make clean'
22CLEANFILES = *~
23
b75a7d8f
A
24SUBDIRS =
25
46f4442e
A
26-include Makefile.local
27
b75a7d8f 28## List of phony targets
73c04bcf
A
29.PHONY : all all-local all-recursive install install-local \
30install-recursive clean clean-local clean-recursive distclean \
b75a7d8f 31distclean-local distclean-recursive doc dist dist-local dist-recursive \
4388f060 32check check-local check-recursive build-dir testdata.jar xcheck check-exhaustive
729e4ab9
A
33
34xcheck: all-local
374ca955
A
35
36.NOTPARALLEL: build-dir
b75a7d8f
A
37
38## Clear suffix list
39.SUFFIXES :
40
41## List of standard targets
73c04bcf
A
42all: all-local
43install: install-local
44clean: clean-local
45distclean : distclean-local
46dist: dist-local
47check: all check-local
b75a7d8f 48
4388f060
A
49check-exhaustive: check
50
374ca955 51all-local: build-dir build-testdata testdata packagetest
b75a7d8f
A
52
53install-local:
54
55dist-local:
56
57clean-local:
58 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
374ca955 59 $(RMV) $(TESTOUTDIR)
b75a7d8f
A
60
61distclean-local: clean-local
374ca955 62 $(RMV) Makefile pkgdata.inc
b75a7d8f
A
63
64check-local:
65
374ca955 66Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
b75a7d8f 67 cd $(top_builddir) \
374ca955 68 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
b75a7d8f 69
729e4ab9
A
70pkgdata.inc: pkgdataMakefile
71 $(MAKE) -f pkgdataMakefile
72
73pkgdataMakefile:
374ca955
A
74 cd $(top_builddir) \
75 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
b75a7d8f 76
374ca955
A
77#########################################################################
78############################## Test ## stuff ############################
b75a7d8f 79
374ca955
A
80# relative lib links from pkgdata are the same as for tmp
81GENRBOPTS=-k
729e4ab9
A
82# use the cross root, in case we are cross compiling. Otherwise it is equal to top_builddir
83TOOLDIR=$(cross_buildroot)/tools
374ca955
A
84SRCDATADIR=$(top_srcdir)/data
85UNICODEDATADIR=$(SRCDATADIR)/unidata
86OUTDIR=$(top_builddir)/data/out
87OUTTMPDIR=$(top_builddir)/data/out/tmp
88BUILDDIR=$(OUTDIR)/build/$(ICUDATA_PLATFORM_NAME)
89TESTSRCDATADIR=$(top_srcdir)/test/testdata
90TESTOUTDIR=$(top_builddir)/test/testdata/out
73c04bcf 91BUILD_DIRS = $(TESTOUTDIR) $(TESTBUILDDIR) $(TESTOUTDIR)/$(TESTDT)
729e4ab9 92GENTEST=$(TOOLDIR)/gentest/gentest$(TOOLEXEEXT)
73c04bcf
A
93
94ifeq ($(PKGDATA_MODE),common)
95ICU_DATA_OPT = -i $(OUTDIR)
96else
97ifeq ($(PKGDATA_MODE),dll)
98ifneq ($(ENABLE_SHARED),YES)
99ICU_DATA_OPT = -i $(BUILDDIR)
100else
101ICU_DATA_OPT =
102endif
103else
104ICU_DATA_OPT = -i $(BUILDDIR)
105endif
106endif
374ca955 107
729e4ab9
A
108CURDIR:=$(CURR_FULL_DIR)
109# current directory should not be blank
110ifeq ($(CURDIR),)
111CURDIR=.
112endif
113
114PKGDATA = $(TOOLBINDIR)/pkgdata -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME)
374ca955
A
115PKGDATA_INVOKE:=$(INVOKE) $(PKGDATA_INVOKE_OPTS)
116
117# Contains all 'intermediate' files (and temp files) except for 'unpackaged data' below
118TESTBUILDDIR=$(TESTOUTDIR)/build
119
120# unpackaged files - live in 'out' so that the path can find them as part of the pkg
73c04bcf 121UNPACKAGEDTESTDATA=$(TESTOUTDIR)/$(TESTDT)/nam.typ
374ca955
A
122
123# pkg name for testdata
124TESTDATA=testdata
125# prefix for files that are testdata
73c04bcf 126TESTDT=$(TESTDATA)
374ca955
A
127
128# File definitions
73c04bcf
A
129TEST_DAT_FILES=$(TESTBUILDDIR)/test.icu
130TEST_SPP_FILES=$(TESTBUILDDIR)/nfscsi.spp $(TESTBUILDDIR)/nfscss.spp $(TESTBUILDDIR)/nfscis.spp $(TESTBUILDDIR)/nfsmxs.spp $(TESTBUILDDIR)/nfsmxp.spp
374ca955 131
729e4ab9 132TEST_UCM_SOURCE= test1.ucm test1bmp.ucm test3.ucm test4.ucm test4x.ucm test5.ucm ibm9027.ucm
374ca955 133TEST_UCM_FILES=$(TEST_UCM_SOURCE:%=$(TESTSRCDATADIR)/data/%)
73c04bcf 134TEST_CNV_FILES=$(TEST_UCM_SOURCE:%.ucm=$(TESTBUILDDIR)/%.cnv)
374ca955 135
729e4ab9
A
136TEST_NRM_FILES=$(TESTBUILDDIR)/testnorm.nrm
137
46f4442e
A
138# import the shared .mk file
139include $(TESTSRCDATADIR)/tstfiles.mk
140-include $(TESTSRCDATADIR)/tstlocal.mk
141
142# TEST_RES_SOURCE comes from tstfiles.mk
143TEST_RES = $(TEST_RES_SOURCE) $(TEST_RES_LOCAL) casing.txt mc.txt root.txt sh.txt sh_YU.txt te.txt te_IN.txt te_IN_REVISED.txt testtypes.txt testaliases.txt testempty.txt structLocale.txt idna_rules.txt conversion.txt icuio.txt testtable32.txt
729e4ab9 144TEST_RES_FILES=$(TEST_RES:%.txt=$(TESTBUILDDIR)/%.res) $(TESTBUILDDIR)/iscii.res $(TESTBUILDDIR)/old_l_testtypes.res $(TESTBUILDDIR)/old_e_testtypes.res
374ca955 145
729e4ab9 146ALL_TEST_FILES = $(TEST_DAT_FILES) $(TEST_SPP_FILES) $(TEST_BRK_FILES) $(TEST_CNV_FILES) $(TEST_NRM_FILES) $(TEST_RES_FILES) $(TESTOUTDIR)/$(TESTDT)/nam.typ
374ca955
A
147
148# list
149
150$(TESTBUILDDIR)/testdata.lst: $(SRCLISTDEPS)
151 @echo "generating $@ (list of data files)"
152 @-$(RMV) $@
729e4ab9 153 @for file in $(TEST_RES_FILES:$(TESTBUILDDIR)/%.res=%.res) $(TEST_DAT_FILES:$(TESTBUILDDIR)/%.icu=%.icu) $(TEST_SPP_FILES:$(TESTBUILDDIR)/%.spp=%.spp) $(TEST_CNV_FILES:$(TESTBUILDDIR)/%.cnv=%.cnv) $(TEST_NRM_FILES:$(TESTBUILDDIR)/%.nrm=%.nrm); do \
374ca955
A
154 echo $$file >> $@; \
155 done;
156
157
73c04bcf 158build-testdata: build-dir $(ALL_TEST_FILES) $(TESTBUILDDIR)/testdata.lst $(TESTBUILDDIR)/iscii.res
374ca955
A
159
160# test.icu
729e4ab9
A
161$(TESTBUILDDIR)/test.icu: $(GENTEST)
162 $(INVOKE) $(GENTEST) -d $(TESTBUILDDIR)
46f4442e 163
729e4ab9
A
164$(TESTBUILDDIR)/testtable32.txt: $(GENTEST)
165 $(INVOKE) $(GENTEST) -r -d $(TESTBUILDDIR)
46f4442e 166
729e4ab9
A
167$(TESTBUILDDIR)/testtable32.res: $(TESTBUILDDIR)/testtable32.txt $(TOOLBINDIR)/genrb$(EXEEXT)
168 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -s $(TESTBUILDDIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) $(<F)
374ca955
A
169
170# Targets for nfscsi.spp
729e4ab9 171$(TESTBUILDDIR)/nfscsi.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_cs_prep_ci.txt
374ca955 172 @echo Building nfscsi.icu
729e4ab9 173 $(INVOKE) $(TOOLBINDIR)/gensprep -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) -b nfscsi -u 3.2.0 nfs4_cs_prep_ci.txt
374ca955
A
174
175# Targets for nfscss.spp
729e4ab9 176$(TESTBUILDDIR)/nfscss.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_cs_prep_cs.txt
374ca955 177 @echo Building nfscss.icu
729e4ab9 178 $(INVOKE) $(TOOLBINDIR)/gensprep -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) -b nfscss -u 3.2.0 nfs4_cs_prep_cs.txt
374ca955
A
179
180# Targets for nfscis.spp
729e4ab9 181$(TESTBUILDDIR)/nfscis.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_cis_prep.txt
374ca955 182 @echo Building nfscis.spp
729e4ab9 183 $(INVOKE) $(TOOLBINDIR)/gensprep -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) -b nfscis -k -n $(UNICODEDATADIR) -u 3.2.0 nfs4_cis_prep.txt
374ca955
A
184
185# Targets for nfsmxs.spp
729e4ab9 186$(TESTBUILDDIR)/nfsmxs.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_mixed_prep_s.txt
374ca955 187 @echo Building nfsmxs.spp
729e4ab9 188 $(INVOKE) $(TOOLBINDIR)/gensprep -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) -b nfsmxs -k -n $(UNICODEDATADIR) -u 3.2.0 nfs4_mixed_prep_s.txt
374ca955
A
189
190# Targets for nfsmxp.spp
729e4ab9 191$(TESTBUILDDIR)/nfsmxp.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_mixed_prep_p.txt
374ca955 192 @echo Building nfsmxp.spp
729e4ab9
A
193 $(INVOKE) $(TOOLBINDIR)/gensprep -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) -b nfsmxp -k -n $(UNICODEDATADIR) -u 3.2.0 nfs4_mixed_prep_p.txt
194
195$(TESTBUILDDIR)/%.cnv: $(TESTSRCDATADIR)/%.ucm $(TOOLBINDIR)/makeconv$(EXEEXT)
196 $(INVOKE) $(TOOLBINDIR)/makeconv --small -c -d $(TESTBUILDDIR) $(TESTSRCDATADIR)/$(<F)
374ca955 197
729e4ab9
A
198$(TESTBUILDDIR)/%.nrm: $(TESTSRCDATADIR)/%.txt $(TOOLBINDIR)/gennorm2$(EXEEXT)
199 $(INVOKE) $(TOOLBINDIR)/gennorm2 -s $(TESTSRCDATADIR) $(<F) -o $@
374ca955 200
729e4ab9
A
201$(TESTBUILDDIR)/%.res: $(TESTSRCDATADIR)/%.txt $(TOOLBINDIR)/genrb$(EXEEXT) $(DAT_FILES)
202 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -q -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) $(<F)
374ca955 203
729e4ab9 204$(TESTBUILDDIR)/iscii.res: $(TESTSRCDATADIR)/iscii.bin $(TOOLBINDIR)/genrb$(EXEEXT)
374ca955 205 @echo Testing genrb -e option
729e4ab9 206 @ICU_DATA=$(BUILDDIR) $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -s $(TESTSRCDATADIR) -eISCII,version=0 -d $(TESTBUILDDIR) $(<F) >/dev/null || ( echo "WARNING: could not open ISCII - it may have been disabled." | tee $@ )
374ca955
A
207 @echo Finished testing genrb -e option
208
209################################################################### TYP
210# TYP FILES
211
73c04bcf
A
212$(TESTOUTDIR)/$(TESTDT)/nam.typ: $(TESTBUILDDIR)/te_IN.res
213 cp $< $@
729e4ab9 214$(TESTBUILDDIR)/old_l_testtypes.res: $(TESTSRCDATADIR)/old_l_testtypes.res
73c04bcf 215 cp $< $@
729e4ab9 216$(TESTBUILDDIR)/old_e_testtypes.res: $(TESTSRCDATADIR)/old_e_testtypes.res
374ca955 217 cp $< $@
374ca955
A
218
219testdata: build-dir $(ALL_TEST_FILES) $(UNPACKAGEDTESTDATA)
220
221#$(ALL_TEST_FILES) $(TESTBUILDDIR)/testtable32.txt $(TESTBUILDDIR)/testdata.lst: build-dir
222
223packagetest: build-dir testdata pkgdata.inc $(TESTBUILDDIR)/testdata.lst
224 $(PKGDATA_INVOKE) $(PKGDATA) -T $(TESTBUILDDIR) -d $(TESTOUTDIR) -s $(TESTBUILDDIR) -p $(TESTDATA) -m common $(TESTBUILDDIR)/testdata.lst
225
226build-dir: $(BUILD_DIRS)
227$(BUILD_DIRS):
228 -$(MKINSTALLDIRS) $(BUILD_DIRS)
229
729e4ab9
A
230# Build the ICU4J testdata.jar.
231# Command line:
232# (Run this from the output testdata folder which may not be .../source/test/testdata in an out-of-source build.)
233# ~/svn.icu/trunk/source/test/testdata> make JAR=jar ICU4J_ROOT=~/svn.icu4j/trunk testdata.jar
234# You can omit the ICU4J_ROOT for just building the .jar files without copying them.
235# You can omit the JAR if it's just jar.
236JAR=jar
237
238# Build testdata.jar:
239# - swap the test data
240# - extract all data items
241# - package them into the .jar file
242$(OUTDIR)/icu4j/testdata.jar: build-dir testdata $(TESTOUTDIR)/testdata.dat
243 mkdir -p $(OUTDIR)/icu4j/com/ibm/icu/dev/data/testdata
244 $(INVOKE) $(TOOLBINDIR)/icupkg $(TESTOUTDIR)/testdata.dat -r test.icu -x '*' -tb -d $(OUTDIR)/icu4j/com/ibm/icu/dev/data/testdata
245 $(JAR) cf $(OUTDIR)/icu4j/testdata.jar -C $(OUTDIR)/icu4j com/ibm/icu/dev/data/testdata
246
247
248DEBUGUTILITIESDATA_DIR=main/tests/core/src/com/ibm/icu/dev/test/util
249DEBUGUTILITIESDATA_SRC=DebugUtilitiesData.java
250
251ICU4J_DATA=$(OUTDIR)/icu4j/src/$(DEBUGUTILITIESDATA_SRC) $(OUTDIR)/icu4j/testdata.jar
252
253$(OUTDIR)/icu4j/src/$(DEBUGUTILITIESDATA_SRC): $(GENTEST)
254 mkdir -p $(OUTDIR)/icu4j/src
255 $(INVOKE) $(GENTEST) -j -d $(OUTDIR)/icu4j/src
256
257ifdef ICU4J_ROOT
258
259icu4j-data-install: $(ICU4J_ROOT)/main/shared/data/testdata.jar $(ICU4J_ROOT)/$(DEBUGUTILITIESDATA_DIR)/$(DEBUGUTILITIESDATA_SRC)
260 @echo ICU4J test data installed in $(ICU4J_ROOT)
261
262$(ICU4J_ROOT)/main/shared/data/testdata.jar: $(OUTDIR)/icu4j/testdata.jar
263 mkdir -p $(ICU4J_ROOT)/main/shared/data
264 cp $(OUTDIR)/icu4j/testdata.jar $(ICU4J_ROOT)/main/shared/data
265
266$(ICU4J_ROOT)/$(DEBUGUTILITIESDATA_DIR)/$(DEBUGUTILITIESDATA_SRC): $(OUTDIR)/icu4j/src/$(DEBUGUTILITIESDATA_SRC)
267 mkdir -p $(ICU4J_ROOT)/$(DEBUGUTILITIESDATA_DIR)
268 cp $^ $@
269
270else
271
272icu4j-data-install: $(ICU4J_DATA)
273 @echo ICU4J data was built into $(OUTDIR)/icu4j
274 @echo '** Error:' ICU4J_ROOT was not set, could not install
275 exit 1
276
277endif
374ca955 278
729e4ab9 279icu4j-data: $(ICU4J_DATA)