1 #******************************************************************************
3 # Copyright (C) 1998-2004, International Business Machines
4 # Corporation and others. All Rights Reserved.
6 #******************************************************************************
7 ## Top-level Makefile.in for ICU
10 ## Source directory information
12 top_srcdir = @top_srcdir@
16 include $(top_builddir)/icudefs.mk
18 ## Build directory information
19 subdir = test/testdata
21 ## Files to remove for 'make clean'
26 ## List of phony targets
27 .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \
28 install-recursive clean clean-local clean-recursive distclean \
29 distclean-local distclean-recursive doc dist dist-local dist-recursive \
30 check check-local check-recursive build-dir
32 .NOTPARALLEL: build-dir
37 ## List of standard targets
38 all: all-local all-recursive
39 install: install-recursive install-local
40 clean: clean-recursive clean-local
41 distclean : distclean-recursive distclean-local
42 dist: dist-recursive dist-local
43 check: all check-recursive check-local
45 all-local: build-dir build-testdata testdata packagetest
52 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
55 distclean-local: clean-local
56 $(RMV) Makefile pkgdata.inc
60 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
62 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
64 pkgdata.inc: $(srcdir)/pkgdata.inc.in Makefile $(top_builddir)/config.status
66 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
69 #########################################################################
70 ############################## Test ## stuff ############################
72 ifeq ($(PKGDATA_OPTS),)
73 PKGDATA_OPTS = -O $(top_builddir)/test/testdata/pkgdata.inc
76 # relative lib links from pkgdata are the same as for tmp
78 TOOLDIR=$(top_builddir)/tools
79 SRCDATADIR=$(top_srcdir)/data
80 UNICODEDATADIR=$(SRCDATADIR)/unidata
81 OUTDIR=$(top_builddir)/data/out
82 OUTTMPDIR=$(top_builddir)/data/out/tmp
83 BUILDDIR=$(OUTDIR)/build/$(ICUDATA_PLATFORM_NAME)
84 TESTSRCDATADIR=$(top_srcdir)/test/testdata
85 TESTOUTDIR=$(top_builddir)/test/testdata/out
86 BUILD_DIRS = $(TESTOUTDIR) $(TESTBUILDDIR)
88 PKGDATA = $(BINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME)
89 PKGDATA_INVOKE:=$(INVOKE) $(PKGDATA_INVOKE_OPTS)
91 # Contains all 'intermediate' files (and temp files) except for 'unpackaged data' below
92 TESTBUILDDIR=$(TESTOUTDIR)/build
94 # unpackaged files - live in 'out' so that the path can find them as part of the pkg
95 UNPACKAGEDTESTDATA=$(TESTOUTDIR)/$(TESTDT)nam.typ
97 # pkg name for testdata
99 # prefix for files that are testdata
103 TEST_DAT_FILES=$(TESTBUILDDIR)/$(TESTDT)test.icu $(TESTBUILDDIR)/$(TESTDT)nfscsi.spp $(TESTBUILDDIR)/$(TESTDT)nfscss.spp $(TESTBUILDDIR)/$(TESTDT)nfscis.spp $(TESTBUILDDIR)/$(TESTDT)nfsmxs.spp $(TESTBUILDDIR)/$(TESTDT)nfsmxp.spp
105 TEST_UCM_SOURCE= test1.ucm test3.ucm test4.ucm test4x.ucm ibm9027.ucm
106 TEST_UCM_FILES=$(TEST_UCM_SOURCE:%=$(TESTSRCDATADIR)/data/%)
107 TEST_CNV_FILES=$(TEST_UCM_SOURCE:%.ucm=$(TESTBUILDDIR)/$(TESTDT)%.cnv)
109 TEST_RES = casing.txt mc.txt root.txt te.txt te_IN.txt testtypes.txt testaliases.txt testempty.txt structLocale.txt DataDrivenCollationTest.txt idna_rules.txt conversion.txt icuio.txt testtable32.txt
110 TEST_RES_FILES=$(TEST_RES:%.txt=$(TESTBUILDDIR)/$(TESTDT)%.res) $(TESTBUILDDIR)/$(TESTDT)iscii.res $(TESTSRCDATADIR)/$(TESTDT)icu26_testtypes.res $(TESTSRCDATADIR)/$(TESTDT)icu26e_testtypes.res
112 ALL_TEST_FILES = $(TEST_DAT_FILES) $(TEST_BRK_FILES) $(TEST_CNV_FILES) $(TEST_RES_FILES) $(TESTOUTDIR)/$(TESTDT)nam.typ
116 $(TESTBUILDDIR)/testdata.lst: $(SRCLISTDEPS)
117 @echo "generating $@ (list of data files)"
119 @for file in $(TEST_RES_FILES) $(TEST_DAT_FILES) $(TEST_CNV_FILES); do \
124 build-testdata: build-dir $(ALL_TEST_FILES) $(TESTBUILDDIR)/testdata.lst $(TESTBUILDDIR)/$(TESTDT)iscii.res
127 $(TESTBUILDDIR)/$(TESTDT)test.icu: $(TOOLDIR)/gentest/gentest$(EXEEXT)
128 $(INVOKE) $(TOOLDIR)/gentest/gentest -d $(TESTBUILDDIR)
130 $(TESTBUILDDIR)/testtable32.txt: $(TOOLDIR)/gentest/gentest$(EXEEXT)
131 $(INVOKE) $(TOOLDIR)/gentest/gentest -r -d $(TESTBUILDDIR)
133 $(TESTBUILDDIR)/$(TESTDT)testtable32.res: $(TESTBUILDDIR)/testtable32.txt $(BINDIR)/genrb$(EXEEXT)
134 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -p $(TESTDATA) -q -s $(TESTBUILDDIR) -i $(BUILDDIR) -d $(TESTBUILDDIR) $(<F)
136 # Targets for nfscsi.spp
137 $(TESTBUILDDIR)/$(TESTDT)nfscsi.spp: $(BINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_cs_prep_ci.txt
138 @echo Building nfscsi.icu
139 $(INVOKE) $(BINDIR)/gensprep -s $(TESTSRCDATADIR) -i $(BUILDDIR) -d $(TESTBUILDDIR) -b nfscsi -p $(TESTDATA) -u 3.2.0 nfs4_cs_prep_ci.txt
141 # Targets for nfscss.spp
142 $(TESTBUILDDIR)/$(TESTDT)nfscss.spp: $(BINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_cs_prep_cs.txt
143 @echo Building nfscss.icu
144 $(INVOKE) $(BINDIR)/gensprep -s $(TESTSRCDATADIR) -i $(BUILDDIR) -d $(TESTBUILDDIR) -b nfscss -p $(TESTDATA) -u 3.2.0 nfs4_cs_prep_cs.txt
146 # Targets for nfscis.spp
147 $(TESTBUILDDIR)/$(TESTDT)nfscis.spp: $(BINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_cis_prep.txt
148 @echo Building nfscis.spp
149 $(INVOKE) $(BINDIR)/gensprep -s $(TESTSRCDATADIR) -i $(BUILDDIR) -d $(TESTBUILDDIR) -b nfscis -p $(TESTDATA) -k -n $(UNICODEDATADIR) -u 3.2.0 nfs4_cis_prep.txt
151 # Targets for nfsmxs.spp
152 $(TESTBUILDDIR)/$(TESTDT)nfsmxs.spp: $(BINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_mixed_prep_s.txt
153 @echo Building nfsmxs.spp
154 $(INVOKE) $(BINDIR)/gensprep -s $(TESTSRCDATADIR) -i $(BUILDDIR) -d $(TESTBUILDDIR) -b nfsmxs -p $(TESTDATA) -k -n $(UNICODEDATADIR) -u 3.2.0 nfs4_mixed_prep_s.txt
156 # Targets for nfsmxp.spp
157 $(TESTBUILDDIR)/$(TESTDT)nfsmxp.spp: $(BINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_mixed_prep_p.txt
158 @echo Building nfsmxp.spp
159 $(INVOKE) $(BINDIR)/gensprep -s $(TESTSRCDATADIR) -i $(BUILDDIR) -d $(TESTBUILDDIR) -b nfsmxp -p $(TESTDATA) -k -n $(UNICODEDATADIR) -u 3.2.0 nfs4_mixed_prep_p.txt
161 $(TESTBUILDDIR)/$(TESTDT)%.cnv: $(TESTSRCDATADIR)/%.ucm $(BINDIR)/makeconv$(EXEEXT)
162 $(INVOKE) $(BINDIR)/makeconv -p $(TESTDATA) -c -d $(TESTBUILDDIR) $(TESTSRCDATADIR)/$(<F)
164 $(TESTBUILDDIR)/$(TESTDT)%.res: $(TESTSRCDATADIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
165 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -p $(TESTDATA) -q -s $(TESTSRCDATADIR) -i $(BUILDDIR) -d $(TESTBUILDDIR) $(<F)
167 $(TESTBUILDDIR)/$(TESTDT)iscii.res: $(TESTSRCDATADIR)/iscii.bin $(BINDIR)/genrb$(EXEEXT)
168 @echo Testing genrb -e option
169 @ICU_DATA=$(BUILDDIR) $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -s $(TESTSRCDATADIR) -p $(TESTDATA) -eISCII,version=0 -d $(TESTBUILDDIR) $(<F) >/dev/null || ( echo "WARNING: could not open ISCII - it may have been disabled." | tee $@ )
170 @echo Finished testing genrb -e option
172 ################################################################### TYP
175 $(TESTOUTDIR)/$(TESTDT)nam.typ: $(TESTBUILDDIR)/$(TESTDT)te_IN.res
179 testdata: build-dir $(ALL_TEST_FILES) $(UNPACKAGEDTESTDATA)
181 #$(ALL_TEST_FILES) $(TESTBUILDDIR)/testtable32.txt $(TESTBUILDDIR)/testdata.lst: build-dir
183 packagetest: build-dir testdata pkgdata.inc $(TESTBUILDDIR)/testdata.lst
184 $(PKGDATA_INVOKE) $(PKGDATA) -T $(TESTBUILDDIR) -d $(TESTOUTDIR) -s $(TESTBUILDDIR) -p $(TESTDATA) -m common $(TESTBUILDDIR)/testdata.lst
186 build-dir: $(BUILD_DIRS)
188 -$(MKINSTALLDIRS) $(BUILD_DIRS)