]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/testdata/Makefile.in
ICU-66108.tar.gz
[apple/icu.git] / icuSources / test / testdata / Makefile.in
CommitLineData
f3c0d7a5
A
1# Copyright (C) 2016 and later: Unicode, Inc. and others.
2# License & terms of use: http://www.unicode.org/copyright.html
b75a7d8f
A
3#******************************************************************************
4#
b331163b 5# Copyright (C) 1998-2015, International Business Machines
b75a7d8f
A
6# Corporation and others. All Rights Reserved.
7#
8#******************************************************************************
9## Top-level Makefile.in for ICU
10## Stephen F. Booth
11
12## Source directory information
13srcdir = @srcdir@
14top_srcdir = @top_srcdir@
15
16top_builddir = ../..
17
18include $(top_builddir)/icudefs.mk
19
20## Build directory information
21subdir = test/testdata
22
b75a7d8f
A
23## Files to remove for 'make clean'
24CLEANFILES = *~
25
b75a7d8f
A
26SUBDIRS =
27
46f4442e
A
28-include Makefile.local
29
b75a7d8f 30## List of phony targets
73c04bcf
A
31.PHONY : all all-local all-recursive install install-local \
32install-recursive clean clean-local clean-recursive distclean \
b75a7d8f 33distclean-local distclean-recursive doc dist dist-local dist-recursive \
4388f060 34check check-local check-recursive build-dir testdata.jar xcheck check-exhaustive
729e4ab9
A
35
36xcheck: all-local
374ca955
A
37
38.NOTPARALLEL: build-dir
b75a7d8f
A
39
40## Clear suffix list
41.SUFFIXES :
42
43## List of standard targets
73c04bcf
A
44all: all-local
45install: install-local
46clean: clean-local
47distclean : distclean-local
48dist: dist-local
49check: all check-local
b75a7d8f 50
4388f060
A
51check-exhaustive: check
52
374ca955 53all-local: build-dir build-testdata testdata packagetest
b75a7d8f
A
54
55install-local:
56
57dist-local:
58
59clean-local:
60 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
374ca955 61 $(RMV) $(TESTOUTDIR)
b75a7d8f
A
62
63distclean-local: clean-local
374ca955 64 $(RMV) Makefile pkgdata.inc
b75a7d8f
A
65
66check-local:
67
374ca955 68Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
b75a7d8f 69 cd $(top_builddir) \
374ca955 70 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
b75a7d8f 71
729e4ab9
A
72pkgdata.inc: pkgdataMakefile
73 $(MAKE) -f pkgdataMakefile
74
75pkgdataMakefile:
374ca955
A
76 cd $(top_builddir) \
77 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
b75a7d8f 78
374ca955
A
79#########################################################################
80############################## Test ## stuff ############################
b75a7d8f 81
374ca955
A
82# relative lib links from pkgdata are the same as for tmp
83GENRBOPTS=-k
729e4ab9
A
84# use the cross root, in case we are cross compiling. Otherwise it is equal to top_builddir
85TOOLDIR=$(cross_buildroot)/tools
374ca955
A
86SRCDATADIR=$(top_srcdir)/data
87UNICODEDATADIR=$(SRCDATADIR)/unidata
88OUTDIR=$(top_builddir)/data/out
89OUTTMPDIR=$(top_builddir)/data/out/tmp
90BUILDDIR=$(OUTDIR)/build/$(ICUDATA_PLATFORM_NAME)
91TESTSRCDATADIR=$(top_srcdir)/test/testdata
92TESTOUTDIR=$(top_builddir)/test/testdata/out
73c04bcf 93BUILD_DIRS = $(TESTOUTDIR) $(TESTBUILDDIR) $(TESTOUTDIR)/$(TESTDT)
729e4ab9 94GENTEST=$(TOOLDIR)/gentest/gentest$(TOOLEXEEXT)
73c04bcf
A
95
96ifeq ($(PKGDATA_MODE),common)
97ICU_DATA_OPT = -i $(OUTDIR)
98else
99ifeq ($(PKGDATA_MODE),dll)
100ifneq ($(ENABLE_SHARED),YES)
101ICU_DATA_OPT = -i $(BUILDDIR)
102else
103ICU_DATA_OPT =
104endif
105else
106ICU_DATA_OPT = -i $(BUILDDIR)
107endif
108endif
374ca955 109
729e4ab9
A
110CURDIR:=$(CURR_FULL_DIR)
111# current directory should not be blank
112ifeq ($(CURDIR),)
113CURDIR=.
114endif
115
116PKGDATA = $(TOOLBINDIR)/pkgdata -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME)
374ca955
A
117PKGDATA_INVOKE:=$(INVOKE) $(PKGDATA_INVOKE_OPTS)
118
119# Contains all 'intermediate' files (and temp files) except for 'unpackaged data' below
120TESTBUILDDIR=$(TESTOUTDIR)/build
121
122# unpackaged files - live in 'out' so that the path can find them as part of the pkg
73c04bcf 123UNPACKAGEDTESTDATA=$(TESTOUTDIR)/$(TESTDT)/nam.typ
374ca955
A
124
125# pkg name for testdata
126TESTDATA=testdata
127# prefix for files that are testdata
73c04bcf 128TESTDT=$(TESTDATA)
374ca955 129
3d1f044b
A
130# Variable names for rules.mk
131OUT_DIR=$(TESTBUILDDIR)
132TMP_DIR=$(TESTOUTDIR)/$(TESTDT)
374ca955 133
3d1f044b 134## Include the Python-generated rules
374ca955 135
3d1f044b 136include $(top_builddir)/$(subdir)/rules.mk
729e4ab9 137
46f4442e 138
3d1f044b 139build-testdata: build-dir $(TESTDATA_ALL_OUTPUT_FILES)
374ca955 140
3d1f044b 141testdata: build-testdata
374ca955 142
374ca955 143
3d1f044b
A
144packagetest: build-dir testdata pkgdata.inc $(TMP_DIR)/testdata.lst
145 $(PKGDATA_INVOKE) $(PKGDATA) -T $(TESTBUILDDIR) -d $(TESTOUTDIR) -s $(TESTBUILDDIR) -p $(TESTDATA) -m common $(TMP_DIR)/testdata.lst
374ca955
A
146
147build-dir: $(BUILD_DIRS)
148$(BUILD_DIRS):
149 -$(MKINSTALLDIRS) $(BUILD_DIRS)
150
729e4ab9
A
151# Build the ICU4J testdata.jar.
152# Command line:
153# (Run this from the output testdata folder which may not be .../source/test/testdata in an out-of-source build.)
154# ~/svn.icu/trunk/source/test/testdata> make JAR=jar ICU4J_ROOT=~/svn.icu4j/trunk testdata.jar
155# You can omit the ICU4J_ROOT for just building the .jar files without copying them.
156# You can omit the JAR if it's just jar.
157JAR=jar
158
159# Build testdata.jar:
160# - swap the test data
161# - extract all data items
162# - package them into the .jar file
163$(OUTDIR)/icu4j/testdata.jar: build-dir testdata $(TESTOUTDIR)/testdata.dat
164 mkdir -p $(OUTDIR)/icu4j/com/ibm/icu/dev/data/testdata
165 $(INVOKE) $(TOOLBINDIR)/icupkg $(TESTOUTDIR)/testdata.dat -r test.icu -x '*' -tb -d $(OUTDIR)/icu4j/com/ibm/icu/dev/data/testdata
166 $(JAR) cf $(OUTDIR)/icu4j/testdata.jar -C $(OUTDIR)/icu4j com/ibm/icu/dev/data/testdata
167
168
169DEBUGUTILITIESDATA_DIR=main/tests/core/src/com/ibm/icu/dev/test/util
170DEBUGUTILITIESDATA_SRC=DebugUtilitiesData.java
171
172ICU4J_DATA=$(OUTDIR)/icu4j/src/$(DEBUGUTILITIESDATA_SRC) $(OUTDIR)/icu4j/testdata.jar
173
174$(OUTDIR)/icu4j/src/$(DEBUGUTILITIESDATA_SRC): $(GENTEST)
175 mkdir -p $(OUTDIR)/icu4j/src
176 $(INVOKE) $(GENTEST) -j -d $(OUTDIR)/icu4j/src
177
178ifdef ICU4J_ROOT
179
180icu4j-data-install: $(ICU4J_ROOT)/main/shared/data/testdata.jar $(ICU4J_ROOT)/$(DEBUGUTILITIESDATA_DIR)/$(DEBUGUTILITIESDATA_SRC)
181 @echo ICU4J test data installed in $(ICU4J_ROOT)
182
183$(ICU4J_ROOT)/main/shared/data/testdata.jar: $(OUTDIR)/icu4j/testdata.jar
184 mkdir -p $(ICU4J_ROOT)/main/shared/data
185 cp $(OUTDIR)/icu4j/testdata.jar $(ICU4J_ROOT)/main/shared/data
186
187$(ICU4J_ROOT)/$(DEBUGUTILITIESDATA_DIR)/$(DEBUGUTILITIESDATA_SRC): $(OUTDIR)/icu4j/src/$(DEBUGUTILITIESDATA_SRC)
188 mkdir -p $(ICU4J_ROOT)/$(DEBUGUTILITIESDATA_DIR)
189 cp $^ $@
190
191else
192
193icu4j-data-install: $(ICU4J_DATA)
194 @echo ICU4J data was built into $(OUTDIR)/icu4j
195 @echo '** Error:' ICU4J_ROOT was not set, could not install
196 exit 1
197
198endif
374ca955 199
729e4ab9 200icu4j-data: $(ICU4J_DATA)