1#****************************************************************************** 2# 3# Copyright (C) 1998-2009, International Business Machines 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 21## Files to remove for 'make clean' 22CLEANFILES = *~ 23 24SUBDIRS = 25 26-include Makefile.local 27 28## List of phony targets 29.PHONY : all all-local all-recursive install install-local \ 30install-recursive clean clean-local clean-recursive distclean \ 31distclean-local distclean-recursive doc dist dist-local dist-recursive \ 32check check-local check-recursive build-dir java-output 33 34.NOTPARALLEL: build-dir 35 36## Clear suffix list 37.SUFFIXES : 38 39## List of standard targets 40all: all-local 41install: install-local 42clean: clean-local 43distclean : distclean-local 44dist: dist-local 45check: all check-local 46 47all-local: build-dir build-testdata testdata packagetest 48 49install-local: 50 51dist-local: 52 53clean-local: 54 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) 55 $(RMV) $(TESTOUTDIR) 56 57distclean-local: clean-local 58 $(RMV) Makefile pkgdata.inc 59 60check-local: 61 62Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 63 cd $(top_builddir) \ 64 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status 65 66pkgdata.inc: pkgdataMakefile 67 $(MAKE) -f pkgdataMakefile 68 69pkgdataMakefile: 70 cd $(top_builddir) \ 71 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status 72 73######################################################################### 74############################## Test ## stuff ############################ 75 76ifeq ($(PKGDATA_OPTS),) 77PKGDATA_OPTS = -O $(top_builddir)/test/testdata/pkgdata.inc 78endif 79 80# relative lib links from pkgdata are the same as for tmp 81GENRBOPTS=-k 82# use the cross root, in case we are cross compiling. Otherwise it is equal to top_builddir 83TOOLDIR=$(cross_buildroot)/tools 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 91BUILD_DIRS = $(TESTOUTDIR) $(TESTBUILDDIR) $(TESTOUTDIR)/$(TESTDT) 92GENTEST=$(TOOLDIR)/gentest/gentest$(TOOLEXEEXT) 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 107 108PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) 109PKGDATA_INVOKE:=$(INVOKE) $(PKGDATA_INVOKE_OPTS) 110 111# Contains all 'intermediate' files (and temp files) except for 'unpackaged data' below 112TESTBUILDDIR=$(TESTOUTDIR)/build 113 114# unpackaged files - live in 'out' so that the path can find them as part of the pkg 115UNPACKAGEDTESTDATA=$(TESTOUTDIR)/$(TESTDT)/nam.typ 116 117# pkg name for testdata 118TESTDATA=testdata 119# prefix for files that are testdata 120TESTDT=$(TESTDATA) 121 122# File definitions 123TEST_DAT_FILES=$(TESTBUILDDIR)/test.icu 124TEST_SPP_FILES=$(TESTBUILDDIR)/nfscsi.spp $(TESTBUILDDIR)/nfscss.spp $(TESTBUILDDIR)/nfscis.spp $(TESTBUILDDIR)/nfsmxs.spp $(TESTBUILDDIR)/nfsmxp.spp 125 126TEST_UCM_SOURCE= test1.ucm test1bmp.ucm test3.ucm test4.ucm test4x.ucm ibm9027.ucm 127TEST_UCM_FILES=$(TEST_UCM_SOURCE:%=$(TESTSRCDATADIR)/data/%) 128TEST_CNV_FILES=$(TEST_UCM_SOURCE:%.ucm=$(TESTBUILDDIR)/%.cnv) 129 130# import the shared .mk file 131include $(TESTSRCDATADIR)/tstfiles.mk 132-include $(TESTSRCDATADIR)/tstlocal.mk 133 134# TEST_RES_SOURCE comes from tstfiles.mk 135TEST_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 136TEST_RES_FILES=$(TEST_RES:%.txt=$(TESTBUILDDIR)/%.res) $(TESTBUILDDIR)/iscii.res $(TESTBUILDDIR)/icu26_testtypes.res $(TESTBUILDDIR)/icu26e_testtypes.res 137 138ALL_TEST_FILES = $(TEST_DAT_FILES) $(TEST_SPP_FILES) $(TEST_BRK_FILES) $(TEST_CNV_FILES) $(TEST_RES_FILES) $(TESTOUTDIR)/$(TESTDT)/nam.typ 139 140# list 141 142$(TESTBUILDDIR)/testdata.lst: $(SRCLISTDEPS) 143 @echo "generating $@ (list of data files)" 144 @-$(RMV) $@ 145 @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); do \ 146 echo $$file >> $@; \ 147 done; 148 149 150build-testdata: build-dir $(ALL_TEST_FILES) $(TESTBUILDDIR)/testdata.lst $(TESTBUILDDIR)/iscii.res 151 152# test.icu 153$(TESTBUILDDIR)/test.icu: $(GENTEST) 154 $(INVOKE) $(GENTEST) -d $(TESTBUILDDIR) 155 156$(TESTBUILDDIR)/testtable32.txt: $(GENTEST) 157 $(INVOKE) $(GENTEST) -r -d $(TESTBUILDDIR) 158 159# java output 160java-output: $(JAVA_OUT_DIR)/DebugUtilitiesData.java 161 162$(JAVA_OUT_DIR)/DebugUtilitiesData.java: $(GENTEST) 163 $(MKINSTALLDIRS) $(JAVA_OUT_DIR) 164 $(INVOKE) $(GENTEST) -j -d $(JAVA_OUT_DIR) 165 166 167$(TESTBUILDDIR)/testtable32.res: $(TESTBUILDDIR)/testtable32.txt $(TOOLBINDIR)/genrb$(EXEEXT) 168 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -s $(TESTBUILDDIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) $(<F) 169 170# Targets for nfscsi.spp 171$(TESTBUILDDIR)/nfscsi.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_cs_prep_ci.txt 172 @echo Building nfscsi.icu 173 $(INVOKE) $(TOOLBINDIR)/gensprep -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) -b nfscsi -u 3.2.0 nfs4_cs_prep_ci.txt 174 175# Targets for nfscss.spp 176$(TESTBUILDDIR)/nfscss.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_cs_prep_cs.txt 177 @echo Building nfscss.icu 178 $(INVOKE) $(TOOLBINDIR)/gensprep -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) -b nfscss -u 3.2.0 nfs4_cs_prep_cs.txt 179 180# Targets for nfscis.spp 181$(TESTBUILDDIR)/nfscis.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_cis_prep.txt 182 @echo Building nfscis.spp 183 $(INVOKE) $(TOOLBINDIR)/gensprep -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) -b nfscis -k -n $(UNICODEDATADIR) -u 3.2.0 nfs4_cis_prep.txt 184 185# Targets for nfsmxs.spp 186$(TESTBUILDDIR)/nfsmxs.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_mixed_prep_s.txt 187 @echo Building nfsmxs.spp 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 189 190# Targets for nfsmxp.spp 191$(TESTBUILDDIR)/nfsmxp.spp: $(TOOLBINDIR)/gensprep$(EXEEXT) $(TESTSRCDATADIR)/nfs4_mixed_prep_p.txt 192 @echo Building nfsmxp.spp 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) 197 198$(TESTBUILDDIR)/%.res: $(TESTSRCDATADIR)/%.txt $(TOOLBINDIR)/genrb$(EXEEXT) $(DAT_FILES) 199 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -q -s $(TESTSRCDATADIR) $(ICU_DATA_OPT) -d $(TESTBUILDDIR) $(<F) 200 201$(TESTBUILDDIR)/iscii.res: $(TESTSRCDATADIR)/iscii.bin $(TOOLBINDIR)/genrb$(EXEEXT) 202 @echo Testing genrb -e option 203 @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 $@ ) 204 @echo Finished testing genrb -e option 205 206################################################################### TYP 207# TYP FILES 208 209$(TESTOUTDIR)/$(TESTDT)/nam.typ: $(TESTBUILDDIR)/te_IN.res 210 cp $< $@ 211$(TESTBUILDDIR)/icu26_testtypes.res: $(TESTSRCDATADIR)/icu26_testtypes.res 212 cp $< $@ 213$(TESTBUILDDIR)/icu26e_testtypes.res: $(TESTSRCDATADIR)/icu26e_testtypes.res 214 cp $< $@ 215 216testdata: build-dir $(ALL_TEST_FILES) $(UNPACKAGEDTESTDATA) 217 218#$(ALL_TEST_FILES) $(TESTBUILDDIR)/testtable32.txt $(TESTBUILDDIR)/testdata.lst: build-dir 219 220packagetest: build-dir testdata pkgdata.inc $(TESTBUILDDIR)/testdata.lst 221 $(PKGDATA_INVOKE) $(PKGDATA) -T $(TESTBUILDDIR) -d $(TESTOUTDIR) -s $(TESTBUILDDIR) -p $(TESTDATA) -m common $(TESTBUILDDIR)/testdata.lst 222 223build-dir: $(BUILD_DIRS) 224$(BUILD_DIRS): 225 -$(MKINSTALLDIRS) $(BUILD_DIRS) 226 227 228