2000-08-29 07:28:22 +00:00
#******************************************************************************
#
2012-10-05 20:12:49 +00:00
# Copyright (C) 1998-2012, International Business Machines
2000-08-29 07:28:22 +00:00
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
## Top-level Makefile.in for ICU
## Stephen F. Booth
2000-10-24 19:50:20 +00:00
## Source directory information
2000-08-29 07:28:22 +00:00
srcdir = @srcdir@
top_srcdir = @top_srcdir@
2000-10-26 19:28:33 +00:00
top_builddir = ../..
i n c l u d e $( top_builddir ) / i c u d e f s . m k
2000-08-29 07:28:22 +00:00
## Build directory information
subdir = test/testdata
## Files to remove for 'make clean'
CLEANFILES = *~
SUBDIRS =
2008-05-28 21:00:59 +00:00
- i n c l u d e M a k e f i l e . l o c a l
2000-08-29 07:28:22 +00:00
## List of phony targets
2006-03-27 17:33:08 +00:00
.PHONY : all all -local all -recursive install install -local \
i n s t a l l - r e c u r s i v e c l e a n c l e a n - l o c a l c l e a n - r e c u r s i v e d i s t c l e a n \
2000-08-29 07:28:22 +00:00
d i s t c l e a n - l o c a l d i s t c l e a n - r e c u r s i v e d o c d i s t d i s t - l o c a l d i s t - r e c u r s i v e \
2011-11-14 22:33:19 +00:00
c h e c k c h e c k - l o c a l c h e c k - r e c u r s i v e b u i l d - d i r t e s t d a t a . j a r x c h e c k c h e c k - e x h a u s t i v e
2010-07-12 15:24:57 +00:00
xcheck : all -local
2004-08-06 06:16:42 +00:00
.NOTPARALLEL : build -dir
2000-08-29 07:28:22 +00:00
## Clear suffix list
.SUFFIXES :
## List of standard targets
2006-03-27 17:33:08 +00:00
all : all -local
install : install -local
clean : clean -local
distclean : distclean -local
dist : dist -local
check : all check -local
2000-08-29 07:28:22 +00:00
2011-11-14 22:33:19 +00:00
check-exhaustive : check
2004-08-06 06:16:42 +00:00
all-local : build -dir build -testdata testdata packagetest
2000-08-29 07:28:22 +00:00
install-local :
dist-local :
clean-local :
test -z " $( CLEANFILES) " || $( RMV) $( CLEANFILES)
2004-07-19 14:10:08 +00:00
$( RMV) $( TESTOUTDIR)
2000-08-29 07:28:22 +00:00
2000-10-02 23:37:16 +00:00
distclean-local : clean -local
2004-07-20 02:53:14 +00:00
$( RMV) Makefile pkgdata.inc
2000-10-02 23:37:16 +00:00
2000-08-29 07:28:22 +00:00
check-local :
2004-07-19 14:10:08 +00:00
Makefile : $( srcdir ) /Makefile .in $( top_builddir ) /config .status
2000-08-29 07:28:22 +00:00
cd $( top_builddir) \
2004-07-19 14:10:08 +00:00
&& CONFIG_FILES = $( subdir) /$@ CONFIG_HEADERS = $( SHELL) ./config.status
2000-08-29 07:28:22 +00:00
2008-12-01 21:57:14 +00:00
pkgdata.inc : pkgdataMakefile
2008-11-24 20:04:52 +00:00
$( MAKE) -f pkgdataMakefile
2000-08-29 07:28:22 +00:00
2008-12-01 21:57:14 +00:00
pkgdataMakefile :
cd $( top_builddir) \
&& CONFIG_FILES = $( subdir) /$@ CONFIG_HEADERS = $( SHELL) ./config.status
2004-07-19 14:10:08 +00:00
#########################################################################
############################## Test ## stuff ############################
# relative lib links from pkgdata are the same as for tmp
GENRBOPTS = -k
2009-04-01 01:54:14 +00:00
# use the cross root, in case we are cross compiling. Otherwise it is equal to top_builddir
TOOLDIR = $( cross_buildroot) /tools
2004-07-19 14:10:08 +00:00
SRCDATADIR = $( top_srcdir) /data
UNICODEDATADIR = $( SRCDATADIR) /unidata
OUTDIR = $( top_builddir) /data/out
OUTTMPDIR = $( top_builddir) /data/out/tmp
BUILDDIR = $( OUTDIR) /build/$( ICUDATA_PLATFORM_NAME)
TESTSRCDATADIR = $( top_srcdir) /test/testdata
TESTOUTDIR = $( top_builddir) /test/testdata/out
2006-02-24 19:31:34 +00:00
BUILD_DIRS = $( TESTOUTDIR) $( TESTBUILDDIR) $( TESTOUTDIR) /$( TESTDT)
2009-04-01 01:54:14 +00:00
GENTEST = $( TOOLDIR) /gentest/gentest$( TOOLEXEEXT)
2004-07-19 14:10:08 +00:00
2005-06-09 00:59:07 +00:00
i f e q ( $( PKGDATA_MODE ) , c o m m o n )
ICU_DATA_OPT = -i $( OUTDIR)
e l s e
i f e q ( $( PKGDATA_MODE ) , d l l )
2006-05-27 10:04:47 +00:00
i f n e q ( $( ENABLE_SHARED ) , Y E S )
ICU_DATA_OPT = -i $( BUILDDIR)
e l s e
2005-06-09 00:59:07 +00:00
ICU_DATA_OPT =
2006-05-27 10:04:47 +00:00
e n d i f
2005-06-09 00:59:07 +00:00
e l s e
ICU_DATA_OPT = -i $( BUILDDIR)
e n d i f
e n d i f
2010-10-04 23:52:24 +00:00
CURDIR := $( CURR_FULL_DIR)
# current directory should not be blank
i f e q ( $( CURDIR ) , )
CURDIR = .
e n d i f
2009-09-23 16:53:07 +00:00
PKGDATA = $( TOOLBINDIR) /pkgdata -q -c -s $( CURDIR) /out/build/$( ICUDATA_PLATFORM_NAME)
2004-07-19 14:10:08 +00:00
PKGDATA_INVOKE := $( INVOKE) $( PKGDATA_INVOKE_OPTS)
# Contains all 'intermediate' files (and temp files) except for 'unpackaged data' below
TESTBUILDDIR = $( TESTOUTDIR) /build
# unpackaged files - live in 'out' so that the path can find them as part of the pkg
2006-02-24 19:31:34 +00:00
UNPACKAGEDTESTDATA = $( TESTOUTDIR) /$( TESTDT) /nam.typ
2004-07-19 14:10:08 +00:00
# pkg name for testdata
TESTDATA = testdata
# prefix for files that are testdata
2006-02-24 19:31:34 +00:00
TESTDT = $( TESTDATA)
2004-07-19 14:10:08 +00:00
# File definitions
2006-02-24 19:31:34 +00:00
TEST_DAT_FILES = $( TESTBUILDDIR) /test.icu
TEST_SPP_FILES = $( TESTBUILDDIR) /nfscsi.spp $( TESTBUILDDIR) /nfscss.spp $( TESTBUILDDIR) /nfscis.spp $( TESTBUILDDIR) /nfsmxs.spp $( TESTBUILDDIR) /nfsmxp.spp
2004-07-19 14:10:08 +00:00
2012-10-05 20:12:49 +00:00
TEST_UCM_SOURCE = test1.ucm test1bmp.ucm test2.ucm test3.ucm test4.ucm test4x.ucm test5.ucm ibm9027.ucm
2004-07-19 14:10:08 +00:00
TEST_UCM_FILES = $( TEST_UCM_SOURCE:%= $( TESTSRCDATADIR) /data/%)
2006-02-24 19:31:34 +00:00
TEST_CNV_FILES = $( TEST_UCM_SOURCE:%.ucm= $( TESTBUILDDIR) /%.cnv)
2004-07-19 14:10:08 +00:00
2010-02-16 23:43:22 +00:00
TEST_NRM_FILES = $( TESTBUILDDIR) /testnorm.nrm
2007-07-12 21:53:20 +00:00
# import the shared .mk file
i n c l u d e $( TESTSRCDATADIR ) / t s t f i l e s . m k
2008-05-28 21:00:59 +00:00
- i n c l u d e $( TESTSRCDATADIR ) / t s t l o c a l . m k
2007-07-12 21:53:20 +00:00
# TEST_RES_SOURCE comes from tstfiles.mk
2008-05-28 21:00:59 +00:00
TEST_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
2010-01-16 05:15:30 +00:00
TEST_RES_FILES = $( TEST_RES:%.txt= $( TESTBUILDDIR) /%.res) $( TESTBUILDDIR) /iscii.res $( TESTBUILDDIR) /old_l_testtypes.res $( TESTBUILDDIR) /old_e_testtypes.res
2004-07-19 14:10:08 +00:00
2010-02-17 00:21:18 +00:00
ALL_TEST_FILES = $( TEST_DAT_FILES) $( TEST_SPP_FILES) $( TEST_BRK_FILES) $( TEST_CNV_FILES) $( TEST_NRM_FILES) $( TEST_RES_FILES) $( TESTOUTDIR) /$( TESTDT) /nam.typ
2004-07-19 14:10:08 +00:00
# list
$(TESTBUILDDIR)/testdata.lst : $( SRCLISTDEPS )
@echo " generating $@ (list of data files) "
@-$( RMV) $@
2010-02-16 23:43:22 +00:00
@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 \
2004-07-19 14:10:08 +00:00
echo $$ file >> $@ ; \
done ;
2006-02-24 19:31:34 +00:00
build-testdata : build -dir $( ALL_TEST_FILES ) $( TESTBUILDDIR ) /testdata .lst $( TESTBUILDDIR ) /iscii .res
2004-07-19 14:10:08 +00:00
# test.icu
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/test.icu : $( GENTEST )
$( INVOKE) $( GENTEST) -d $( TESTBUILDDIR)
2004-07-19 14:10:08 +00:00
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/testtable32.txt : $( GENTEST )
$( INVOKE) $( GENTEST) -r -d $( TESTBUILDDIR)
2004-07-19 14:10:08 +00:00
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/testtable32.res : $( TESTBUILDDIR ) /testtable 32.txt $( TOOLBINDIR ) /genrb $( EXEEXT )
$( INVOKE) $( TOOLBINDIR) /genrb $( GENRBOPTS) -s $( TESTBUILDDIR) $( ICU_DATA_OPT) -d $( TESTBUILDDIR) $( <F)
2004-07-19 14:10:08 +00:00
# Targets for nfscsi.spp
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/nfscsi.spp : $( TOOLBINDIR ) /gensprep $( EXEEXT ) $( TESTSRCDATADIR ) /nfs 4_cs_prep_ci .txt
2004-07-19 14:10:08 +00:00
@echo Building nfscsi.icu
2009-04-01 01:54:14 +00:00
$( INVOKE) $( TOOLBINDIR) /gensprep -s $( TESTSRCDATADIR) $( ICU_DATA_OPT) -d $( TESTBUILDDIR) -b nfscsi -u 3.2.0 nfs4_cs_prep_ci.txt
2004-07-19 14:10:08 +00:00
# Targets for nfscss.spp
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/nfscss.spp : $( TOOLBINDIR ) /gensprep $( EXEEXT ) $( TESTSRCDATADIR ) /nfs 4_cs_prep_cs .txt
2004-07-19 14:10:08 +00:00
@echo Building nfscss.icu
2009-04-01 01:54:14 +00:00
$( INVOKE) $( TOOLBINDIR) /gensprep -s $( TESTSRCDATADIR) $( ICU_DATA_OPT) -d $( TESTBUILDDIR) -b nfscss -u 3.2.0 nfs4_cs_prep_cs.txt
2004-07-19 14:10:08 +00:00
# Targets for nfscis.spp
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/nfscis.spp : $( TOOLBINDIR ) /gensprep $( EXEEXT ) $( TESTSRCDATADIR ) /nfs 4_cis_prep .txt
2004-07-19 14:10:08 +00:00
@echo Building nfscis.spp
2009-04-01 01:54:14 +00:00
$( INVOKE) $( TOOLBINDIR) /gensprep -s $( TESTSRCDATADIR) $( ICU_DATA_OPT) -d $( TESTBUILDDIR) -b nfscis -k -n $( UNICODEDATADIR) -u 3.2.0 nfs4_cis_prep.txt
2004-07-19 14:10:08 +00:00
# Targets for nfsmxs.spp
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/nfsmxs.spp : $( TOOLBINDIR ) /gensprep $( EXEEXT ) $( TESTSRCDATADIR ) /nfs 4_mixed_prep_s .txt
2004-07-19 14:10:08 +00:00
@echo Building nfsmxs.spp
2009-04-01 01:54:14 +00:00
$( INVOKE) $( TOOLBINDIR) /gensprep -s $( TESTSRCDATADIR) $( ICU_DATA_OPT) -d $( TESTBUILDDIR) -b nfsmxs -k -n $( UNICODEDATADIR) -u 3.2.0 nfs4_mixed_prep_s.txt
2004-07-19 14:10:08 +00:00
# Targets for nfsmxp.spp
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/nfsmxp.spp : $( TOOLBINDIR ) /gensprep $( EXEEXT ) $( TESTSRCDATADIR ) /nfs 4_mixed_prep_p .txt
2004-07-19 14:10:08 +00:00
@echo Building nfsmxp.spp
2009-04-01 01:54:14 +00:00
$( INVOKE) $( TOOLBINDIR) /gensprep -s $( TESTSRCDATADIR) $( ICU_DATA_OPT) -d $( TESTBUILDDIR) -b nfsmxp -k -n $( UNICODEDATADIR) -u 3.2.0 nfs4_mixed_prep_p.txt
2004-07-19 14:10:08 +00:00
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/%.cnv : $( TESTSRCDATADIR ) /%.ucm $( TOOLBINDIR ) /makeconv $( EXEEXT )
$( INVOKE) $( TOOLBINDIR) /makeconv --small -c -d $( TESTBUILDDIR) $( TESTSRCDATADIR) /$( <F)
2004-07-19 14:10:08 +00:00
2010-02-16 23:43:22 +00:00
$(TESTBUILDDIR)/%.nrm : $( TESTSRCDATADIR ) /%.txt $( TOOLBINDIR ) /gennorm 2$( EXEEXT )
$( INVOKE) $( TOOLBINDIR) /gennorm2 -s $( TESTSRCDATADIR) $( <F) -o $@
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/%.res : $( TESTSRCDATADIR ) /%.txt $( TOOLBINDIR ) /genrb $( EXEEXT ) $( DAT_FILES )
$( INVOKE) $( TOOLBINDIR) /genrb $( GENRBOPTS) -q -s $( TESTSRCDATADIR) $( ICU_DATA_OPT) -d $( TESTBUILDDIR) $( <F)
2004-07-19 14:10:08 +00:00
2009-04-01 01:54:14 +00:00
$(TESTBUILDDIR)/iscii.res : $( TESTSRCDATADIR ) /iscii .bin $( TOOLBINDIR ) /genrb $( EXEEXT )
2004-07-19 14:10:08 +00:00
@echo Testing genrb -e option
2009-04-01 01:54:14 +00:00
@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 $@ )
2004-07-19 14:10:08 +00:00
@echo Finished testing genrb -e option
################################################################### TYP
# TYP FILES
2006-02-24 19:31:34 +00:00
$(TESTOUTDIR)/$(TESTDT)/nam.typ : $( TESTBUILDDIR ) /te_IN .res
cp $< $@
2010-01-16 05:15:30 +00:00
$(TESTBUILDDIR)/old_l_testtypes.res : $( TESTSRCDATADIR ) /old_l_testtypes .res
2006-02-24 19:31:34 +00:00
cp $< $@
2010-01-16 05:15:30 +00:00
$(TESTBUILDDIR)/old_e_testtypes.res : $( TESTSRCDATADIR ) /old_e_testtypes .res
2004-07-19 14:10:08 +00:00
cp $< $@
2004-08-06 06:16:42 +00:00
testdata : build -dir $( ALL_TEST_FILES ) $( UNPACKAGEDTESTDATA )
2004-07-19 14:10:08 +00:00
2004-08-06 06:16:42 +00:00
#$(ALL_TEST_FILES) $(TESTBUILDDIR)/testtable32.txt $(TESTBUILDDIR)/testdata.lst: build-dir
2004-07-19 14:10:08 +00:00
2004-08-06 06:16:42 +00:00
packagetest : build -dir testdata pkgdata .inc $( TESTBUILDDIR ) /testdata .lst
2004-07-19 14:10:08 +00:00
$( PKGDATA_INVOKE) $( PKGDATA) -T $( TESTBUILDDIR) -d $( TESTOUTDIR) -s $( TESTBUILDDIR) -p $( TESTDATA) -m common $( TESTBUILDDIR) /testdata.lst
2004-08-06 06:16:42 +00:00
build-dir : $( BUILD_DIRS )
2004-08-04 23:41:42 +00:00
$(BUILD_DIRS) :
2004-08-06 06:16:42 +00:00
-$( MKINSTALLDIRS) $( BUILD_DIRS)
2004-07-19 14:10:08 +00:00
2009-07-17 22:57:26 +00:00
# Build the ICU4J testdata.jar.
# Command line:
# (Run this from the output testdata folder which may not be .../source/test/testdata in an out-of-source build.)
# ~/svn.icu/trunk/source/test/testdata> make JAR=jar ICU4J_ROOT=~/svn.icu4j/trunk testdata.jar
# You can omit the ICU4J_ROOT for just building the .jar files without copying them.
# You can omit the JAR if it's just jar.
JAR = jar
2004-07-19 14:10:08 +00:00
2009-07-17 22:57:26 +00:00
# Build testdata.jar:
# - swap the test data
# - extract all data items
# - package them into the .jar file
$(OUTDIR)/icu4j/testdata.jar : build -dir testdata $( TESTOUTDIR ) /testdata .dat
mkdir -p $( OUTDIR) /icu4j/com/ibm/icu/dev/data/testdata
$( INVOKE) $( TOOLBINDIR) /icupkg $( TESTOUTDIR) /testdata.dat -r test.icu -x '*' -tb -d $( OUTDIR) /icu4j/com/ibm/icu/dev/data/testdata
$( JAR) cf $( OUTDIR) /icu4j/testdata.jar -C $( OUTDIR) /icu4j com/ibm/icu/dev/data/testdata
2010-02-02 21:49:58 +00:00
DEBUGUTILITIESDATA_DIR = main/tests/core/src/com/ibm/icu/dev/test/util
DEBUGUTILITIESDATA_SRC = DebugUtilitiesData.java
ICU4J_DATA = $( OUTDIR) /icu4j/src/$( DEBUGUTILITIESDATA_SRC) $( OUTDIR) /icu4j/testdata.jar
$(OUTDIR)/icu4j/src/$(DEBUGUTILITIESDATA_SRC) : $( GENTEST )
mkdir -p $( OUTDIR) /icu4j/src
$( INVOKE) $( GENTEST) -j -d $( OUTDIR) /icu4j/src
2009-07-17 22:57:26 +00:00
i f d e f I C U 4 J _ R O O T
2010-02-02 21:49:58 +00:00
icu4j-data-install : $( ICU 4J_ROOT ) /main /shared /data /testdata .jar $( ICU 4J_ROOT ) /$( DEBUGUTILITIESDATA_DIR ) /$( DEBUGUTILITIESDATA_SRC )
@echo ICU4J test data installed in $( ICU4J_ROOT)
2009-07-17 22:57:26 +00:00
$(ICU4J_ROOT)/main/shared/data/testdata.jar : $( OUTDIR ) /icu 4j /testdata .jar
mkdir -p $( ICU4J_ROOT) /main/shared/data
cp $( OUTDIR) /icu4j/testdata.jar $( ICU4J_ROOT) /main/shared/data
2010-02-02 21:49:58 +00:00
$(ICU4J_ROOT)/$(DEBUGUTILITIESDATA_DIR)/$(DEBUGUTILITIESDATA_SRC) : $( OUTDIR ) /icu 4j /src /$( DEBUGUTILITIESDATA_SRC )
mkdir -p $( ICU4J_ROOT) /$( DEBUGUTILITIESDATA_DIR)
cp $^ $@
2009-07-17 22:57:26 +00:00
e l s e
2010-02-02 21:49:58 +00:00
icu4j-data-install : $( ICU 4J_DATA )
@echo ICU4J data was built into $( OUTDIR) /icu4j
@echo '** Error:' ICU4J_ROOT was not set, could not install
exit 1
2009-07-17 22:57:26 +00:00
e n d i f
2010-02-02 21:49:58 +00:00
2010-10-04 23:52:24 +00:00
icu4j-data : $( ICU 4J_DATA )