]> git.saurik.com Git - apple/icu.git/blame - icuSources/data/Makefile.in
ICU-8.11.2.tar.gz
[apple/icu.git] / icuSources / data / Makefile.in
CommitLineData
b75a7d8f 1## Makefile.in for ICU data
73c04bcf 2## Copyright (c) 1999-2006, International Business Machines Corporation and
b75a7d8f
A
3## others. All Rights Reserved.
4
5## Source directory information
6srcdir = @srcdir@
7top_srcdir = @top_srcdir@
8
9# So that you have $(top_builddir)/config.status
10top_builddir = ..
11
12## All the flags and other definitions are included here.
13include $(top_builddir)/icudefs.mk
14
15## Build directory information
16# So that $(top_builddir)/$(subdir) ~= "here"
17subdir = data
18
19#lib icu data for link
374ca955
A
20LIB_ICUDATA_NAME=$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX)
21LIB_STATIC_ICUDATA_NAME=$(LIBSICU)$(DATA_STUBNAME)$(ICULIBSUFFIX)
b75a7d8f 22
374ca955
A
23# Allow Windows to override these options
24ifeq ($(PKGDATA_OPTS),)
25PKGDATA_OPTS = -O $(top_builddir)/data/icupkg.inc
26endif
27ifeq ($(PKGDATA_VERSIONING),)
28PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION)
29endif
30
31# This allows all the data to be in one directory
32ifeq ($(PKGDATA_MODE),dll)
33ICUPKGDATA_OUTDIR = $(LIBDIR)
34else
35ICUPKGDATA_OUTDIR = $(OUTDIR)
36endif
b75a7d8f 37
374ca955 38CURDIR:=$(CURR_FULL_DIR)
73c04bcf 39PKGDATA = $(BINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR) -M'PKGDATA_LDFLAGS="$(LDFLAGSICUDT)"'
374ca955 40
73c04bcf
A
41ifeq ($(OS390_STUBDATA),1)
42OS390PKG=package390
43OS390INSTALL=install390
44
45# Additional data for 390
46OS390LIST=$(OUTTMPDIR)/icudata390.lst
47OUTTMPDIR_390STUB=$(top_builddir)/data/out/tmp_390stub
48endif
b75a7d8f
A
49
50# OBJDATADIR must be a short path (with ..'s) to the data.
51
374ca955
A
52ifeq ($(top_srcdir),..)
53SRCDATADIR=.
54else
b75a7d8f 55SRCDATADIR=$(top_srcdir)/data
374ca955
A
56endif
57ifeq ($(top_builddir),..)
58OUTDIR=./out
59else
b75a7d8f 60OUTDIR=$(top_builddir)/data/out
374ca955
A
61endif
62
63OUTTMPDIR=$(OUTDIR)/tmp
73c04bcf
A
64MAINBUILDDIR=$(OUTDIR)/build
65BUILDDIR=$(MAINBUILDDIR)/$(ICUDATA_PLATFORM_NAME)
b75a7d8f
A
66UNICODEDATADIR=$(SRCDATADIR)/unidata
67LOCSRCDIR=$(SRCDATADIR)/locales
374ca955
A
68COLSRCDIR=$(SRCDATADIR)/coll
69COLBLDDIR=$(BUILDDIR)/coll
70RBNFSRCDIR=$(SRCDATADIR)/rbnf
71RBNFBLDDIR=$(BUILDDIR)/rbnf
72TRANSLITSRCDIR=$(SRCDATADIR)/translit
73TRANSLITBLDDIR=$(BUILDDIR)/translit
74MISCSRCDIR=$(SRCDATADIR)/misc
b75a7d8f 75BRKSRCDIR=$(SRCDATADIR)/brkitr
73c04bcf 76BRKBLDDIR=$(BUILDDIR)/brkitr
b75a7d8f
A
77MISCSRCDIR=$(SRCDATADIR)/misc
78UCMSRCDIR=$(SRCDATADIR)/mappings
79COMINCDIR=$(top_srcdir)/common/unicode
80SRCLISTDEPS=Makefile $(srcdir)/Makefile.in
73c04bcf 81BUILD_DIRS=$(OUTDIR) $(BUILDDIR) $(BRKBLDDIR) $(COLBLDDIR) $(RBNFBLDDIR) $(TRANSLITBLDDIR) $(TESTOUTDIR) $(TESTBUILDDIR) $(OUTTMPDIR) $(OUTTMPDIR_390STUB) $(OUTTMPDIR)/$(COLLATION_TREE) $(OUTTMPDIR)/$(RBNF_TREE) $(OUTTMPDIR)/$(TRANSLIT_TREE) $(OUTTMPDIR)/$(BREAK_TREE)
b75a7d8f
A
82
83# relative lib links from pkgdata are the same as for tmp
84TOOLDIR=$(top_builddir)/tools
85
86## List of phony targets
374ca955 87.PHONY : all all-local all-recursive install install-local install-files \
b75a7d8f
A
88install-recursive clean clean-local clean-recursive distclean \
89distclean-local distclean-recursive dist dist-local dist-recursive \
374ca955 90check check-local check-recursive build-local clean-resindex build-dir
b75a7d8f
A
91
92## Clear suffix list
93.SUFFIXES :
94
95## List of standard targets
96all: all-local
97install: all-local install-local
98clean: clean-local
99distclean : distclean-local
100dist:
101check: all
102
103
104distclean-local: clean
105 $(RMV) Makefile
106
374ca955 107all-local: build-dir icupkg.inc build-local packagedata $(POST_DATA_BUILD) $(OS390PKG)
b75a7d8f 108
73c04bcf
A
109# Starting with ICU4C 3.4, the core Unicode properties files (uprops.icu, ucase.icu, ubidi.icu, unorm.icu)
110# are hardcoded in the common DLL and therefore not included in the data package any more.
111# They are not built by default but need to be built for ICU4J data and for getting the .c source files
112# when updating the Unicode data.
113# Changed in Makefile.in revision 1.147. See Jitterbug 4497.
114uni-core-data: build-dir $(BUILDDIR)/uprops.icu $(BUILDDIR)/ucase.icu $(BUILDDIR)/ubidi.icu $(BUILDDIR)/unorm.icu
115 @echo Unicode .icu files built to $(BUILDDIR)
116 @echo Unicode .c source files built to $(OUTTMPDIR)
117
b75a7d8f
A
118dist-local:
119
120clean-map:
121 -test -z *.map || $(RMV) *.map
122
123clean-local: cleanpackage cleanfiles clean-map
b75a7d8f
A
124
125cleanfiles:
126 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
127
128cleanpackage:
129 $(RMV) $(OUTDIR)
374ca955 130 $(RMV) $(LIBDIR)/$(LIB_ICUDATA_NAME)*.$(SO)* $(LIBDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A)
b75a7d8f
A
131
132check-local:
133
73c04bcf
A
134# Find out if we have a source archive.
135# If we have that, then use that instead of building everything from scratch.
136ICUDATA_SOURCE_ARCHIVE = $(wildcard $(srcdir)/in/$(ICUDATA_PLATFORM_NAME).dat)
137ifeq ($(ICUDATA_SOURCE_ARCHIVE),)
138ICUDATA_ARCHIVE = $(firstword $(wildcard $(srcdir)/in/$(ICUDATA_BASENAME_VERSION)*.dat))
139# We don't have the data in the current endianess or charset.
140# See if we can find data of any archive type,
141# and convert it to the current type.
142ifneq ($(ICUDATA_ARCHIVE),)
143ICUDATA_SOURCE_ARCHIVE = $(OUTDIR)/$(ICUDATA_PLATFORM_NAME).dat
144$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) $(OUTDIR)
145 $(INVOKE) $(BINDIR)/icupkg -t$(ICUDATA_CHAR) $(ICUDATA_ARCHIVE) $(ICUDATA_SOURCE_ARCHIVE)
146endif
147else
148ifneq ($(ENABLE_STATIC),YES)
149ifeq ($(PKGDATA_MODE),common)
150# We have a source data common archive in the native endianess,
151# and it's what we want to build. Try to not run any of ICU's tools.
152ICUDATA_SOURCE_IS_NATIVE_TARGET=YES
153endif
154endif
155endif
156
b75a7d8f
A
157# During this INVOKE we only want to use stubdata.
158# We don't want to try to write over files that we are using.
374ca955 159PKGDATA_INVOKE:=$(subst $(LIBDIR):$(top_builddir)/stubdata,$(top_builddir)/stubdata:$(LIBDIR),$(INVOKE)) $(PKGDATA_INVOKE_OPTS)
b75a7d8f 160
374ca955 161packagedata: icupkg.inc $(OUTTMPDIR)/icudata.lst build-local
b75a7d8f 162ifneq ($(ENABLE_STATIC),)
374ca955 163 $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) -m static $(OUTTMPDIR)/icudata.lst
b75a7d8f 164endif
73c04bcf 165ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
374ca955 166 $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(PKGDATA_LIBNAME) $(OUTTMPDIR)/icudata.lst
73c04bcf
A
167else
168 $(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(OUTDIR)
169endif
b75a7d8f
A
170
171## Install ICU data.
374ca955 172install-local: $(OUTTMPDIR)/icudata.lst ./icupkg.inc packagedata $(OS390INSTALL)
b75a7d8f 173 $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(ICUPKGDATA_DIR)
b75a7d8f 174ifneq ($(ENABLE_STATIC),)
374ca955 175 $(PKGDATA_INVOKE) $(PKGDATA) -m static -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) $(OUTTMPDIR)/icudata.lst -I $(ICUPKGDATA_INSTALL_LIBDIR)
b75a7d8f 176endif
73c04bcf 177ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
374ca955 178 $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(OUTTMPDIR)/icudata.lst -I $(ICUPKGDATA_INSTALL_DIR)
73c04bcf
A
179else
180 $(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(DESTDIR)$(ICUPKGDATA_DIR)
181endif
b75a7d8f 182
b75a7d8f
A
183
184####
185####
186#### 390 support
374ca955 187install390: package390
b75a7d8f 188 $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(libdir)
374ca955 189 $(INVOKE) $(PKGDATA) -s $(BUILDDIR)$(STUB_SUFFIX) -T $(OUTTMPDIR_390STUB) -p $(ICUDATA_NAME)$(STUB_SUFFIX) $(PKGDATA_LIBNAME)$(STUB_SUFFIX) -e $(ICUDATA_ENTRY_POINT) $(OS390LIST) -m dll $(PKGDATA_VERSIONING) -I $(DESTDIR)$(ICUPKGDATA_DIR)
b75a7d8f 190ifeq ($(PKGDATA_MODE),dll)
374ca955 191 $(INSTALL-L) $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX)$(SO_TARGET_VERSION)$(IMPORT_LIB_EXT) $(DESTDIR)$(ICUPKGDATA_DIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX)$(SO_TARGET_VERSION)$(IMPORT_LIB_EXT)
b75a7d8f
A
192endif
193
374ca955
A
194#### $(LIB_ICUDATA_NAME)$(STUB_SUFFIX) is the subset data for batch mode
195package390: $(OUTTMPDIR)/icudata390.lst $(OUTTMPDIR)/icudata.lst ./icupkg.inc packagedata
196 ln -s $(ICUDATA_NAME) $(OUTDIR)/build/$(ICUDATA_NAME)$(STUB_SUFFIX)
197 $(INVOKE) $(PKGDATA) -s $(BUILDDIR)$(STUB_SUFFIX) -T $(OUTTMPDIR_390STUB) -p $(ICUDATA_NAME)$(STUB_SUFFIX) $(PKGDATA_LIBNAME)$(STUB_SUFFIX) -e $(ICUDATA_ENTRY_POINT) $(OS390LIST) -m dll $(PKGDATA_VERSIONING)
198 cp $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) $(top_builddir)/stubdata/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO)
b75a7d8f
A
199
200
201##### Define all the data files. the build rule that depends on them is below.
374ca955
A
202# X_FILES_SHORT = just the base names (for lists)
203# X_FILES = full paths (for dependency)
b75a7d8f
A
204
205## DAT files - Misc. data files.
73c04bcf
A
206# 2005-may-05 Removed Unicode properties files (unorm.icu, uprops.icu, ucase.icu, ubidi.icu)
207# from data build. See Jitterbug 4497. (makedata.mak revision 1.117)
208#
209DAT_FILES_SHORT=pnames.icu unames.icu cnvalias.icu ucadata.icu invuca.icu uidna.spp
374ca955 210DAT_FILES=$(DAT_FILES_SHORT:%=$(BUILDDIR)/%)
b75a7d8f
A
211
212## BRK files
73c04bcf 213BREAK_TREE=brkitr
374ca955
A
214-include $(BRKSRCDIR)/brkfiles.mk
215-include $(BRKSRCDIR)/brklocal.mk
73c04bcf
A
216ALL_BRK_SOURCE= $(BRK_SOURCE) $(BRK_SOURCE_LOCAL)
217BRK_FILES_SHORT=$(ALL_BRK_SOURCE:%.txt=$(BREAK_TREE)/%.brk)
218BRK_FILES=$(ALL_BRK_SOURCE:%.txt=$(BRKBLDDIR)/%.brk)
219ifdef BRK_CTD_SOURCE
220ALL_CTD_SOURCE=$(BRK_CTD_SOURCE) $(BRK_CTD_SOURCE_LOCAL)
221CTD_FILES_SHORT=$(ALL_CTD_SOURCE:%.txt=$(BREAK_TREE)/%.ctd)
222CTD_FILES=$(ALL_CTD_SOURCE:%.txt=$(BRKBLDDIR)/%.ctd)
223endif
224ifdef BRK_RES_SOURCE
225BRS_SRC= root.txt $(BRK_RES_SOURCE) $(BRK_RES_SOURCE_LOCAL)
226BRS_SRC_FILES = $(BRS_SRC:%=$(BRKSRCDIR)/%)
227INSTALLED_BRS_FILES = $(BRK_RES_SOURCE:%.txt=%) $(BRK_RES_SOURCE_LOCAL:%.txt=%)
228endif
b75a7d8f 229
374ca955 230## UCM files
b75a7d8f
A
231-include $(UCMSRCDIR)/ucmcore.mk
232-include $(UCMSRCDIR)/ucmfiles.mk
233-include $(UCMSRCDIR)/ucmebcdic.mk
234-include $(UCMSRCDIR)/ucmlocal.mk
235ALL_UCM_SOURCE=ibm-37_P100-1995.ucm ibm-1047_P100-1995.ucm $(UCM_SOURCE_CORE) $(UCM_SOURCE_FILES) $(UCM_SOURCE_EBCDIC) $(UCM_SOURCE_LOCAL)
236UCM_FILES = $(ALL_UCM_SOURCE:%=$(SRCDATADIR)/%)
374ca955
A
237CNV_FILES = $(ALL_UCM_SOURCE:%.ucm=$(BUILDDIR)/%.cnv)
238CNV_FILES_SHORT = $(ALL_UCM_SOURCE:%.ucm=%.cnv)
b75a7d8f
A
239
240## RES files
241-include $(LOCSRCDIR)/resfiles.mk
374ca955
A
242-include $(COLSRCDIR)/colfiles.mk
243-include $(RBNFSRCDIR)/rbnffiles.mk
244-include $(TRANSLITSRCDIR)/trnsfiles.mk
b75a7d8f 245-include $(LOCSRCDIR)/reslocal.mk
374ca955 246-include $(COLSRCDIR)/collocal.mk
73c04bcf 247-include $(BRKSRCDIR)/brslocal.mk
374ca955 248-include $(RBNFSRCDIR)/rbnflocal.mk
73c04bcf
A
249-include $(TRANSLITSRCDIR)/trnslocal.mk
250ifdef GENRB_SOURCE
374ca955
A
251RES_SRC= root.txt $(GENRB_SOURCE) $(GENRB_ALIAS_SOURCE) $(GENRB_SOURCE_LOCAL)
252RES_SRC_FILES = $(RES_SRC:%=$(LOCSRCDIR)/%)
b75a7d8f 253INSTALLED_RB_FILES = $(GENRB_SOURCE:%.txt=%) $(GENRB_SOURCE_LOCAL:%.txt=%)
73c04bcf
A
254endif
255ifdef COLLATION_SOURCE
374ca955
A
256COL_SRC= root.txt $(COLLATION_SOURCE) $(COLLATION_ALIAS_SOURCE) $(COLLATION_SOURCE_LOCAL)
257COL_SRC_FILES = $(COL_SRC:%=$(COLSRCDIR)/%)
258INSTALLED_COL_FILES = $(COLLATION_SOURCE:%.txt=%) $(COLLATION_SOURCE_LOCAL:%.txt=%)
73c04bcf
A
259endif
260ifdef RBNF_SOURCE
374ca955
A
261RBNF_SRC= root.txt $(RBNF_SOURCE) $(RBNF_ALIAS_SOURCE) $(RBNF_SOURCE_LOCAL)
262RBNF_SRC_FILES = $(RBNF_SRC:%=$(RBNFSRCDIR)/%)
263INSTALLED_RBNF_FILES = $(RBNF_SOURCE:%.txt=%) $(RBNF_SOURCE_LOCAL:%.txt=%)
73c04bcf
A
264endif
265ifdef TRANSLIT_SOURCE
266TRANSLIT_SRC= $(TRANSLIT_SOURCE) $(TRANSLIT_ALIAS_SOURCE) $(TRANSLIT_SOURCE_LOCAL)
374ca955
A
267TRANSLIT_SRC_FILES = $(TRANSLIT_SRC:%=$(TRANSLITSRCDIR)/%)
268INSTALLED_TRANSLIT_FILES = $(TRANSLIT_SOURCE:%.txt=%) $(TRANSLIT_SOURCE_LOCAL:%.txt=%)
73c04bcf 269endif
374ca955
A
270GENRBOPTS=-k
271
272## MISC files
273-include $(MISCSRCDIR)/miscfiles.mk
274-include $(MISCSRCDIR)/misclocal.mk
275MSC_SOURCE= $(MISC_SOURCE) $(MISC_SOURCE_LOCAL)
276MSC_SRC_FILES=$(MSC_SOURCE:%=$(MISCSRCDIR)/%)
277
278ifeq ($(ENABLE_SO_VERSION_DATA),1)
279ifeq ($(PKGDATA_MODE),dll)
280SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res
281$(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc
73c04bcf 282 rc.exe /i$(srcdir)/../common /fo$@ $(CPPFLAGS) $(SOURCE_FILE)
374ca955
A
283endif
284endif
b75a7d8f 285
374ca955
A
286ALL_RES_SRC= $(RES_SRC) $(TRNS_SOURCE) $(MSC_SOURCE)
287RES_FILES = $(ALL_RES_SRC:%.txt=$(BUILDDIR)/%.res)
288RES_FILES_SHORT = $(ALL_RES_SRC:%.txt=%.res)
289
290INDEX_NAME=res_index
291INDEX_FILE=$(OUTTMPDIR)/$(INDEX_NAME).txt
292INDEX_RES_FILE=$(INDEX_FILE:$(OUTTMPDIR)/%.txt=$(BUILDDIR)/%.res)
293INDEX_RES_FILE_SHORT=$(INDEX_FILE:$(OUTTMPDIR)/%.txt=%.res)
294
295COLLATION_TREE=coll
296COLLATION_INDEX_FILE=$(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt
297COLLATION_INDEX_RES=$(COLBLDDIR)/$(INDEX_NAME).res
298COLLATION_INDEX_RES_SHORT=$(COLLATION_TREE)/$(INDEX_NAME).res
299COLLATION_FILES = $(COL_SRC:%.txt=$(COLBLDDIR)/%.res) $(COLLATION_INDEX_RES)
300COLLATION_FILES_SHORT = $(COL_SRC:%.txt=$(COLLATION_TREE)/%.res)
301
73c04bcf
A
302BRK_RES_INDEX_FILE=$(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt
303BRK_RES_INDEX_RES=$(BRKBLDDIR)/$(INDEX_NAME).res
304BRK_RES_INDEX_RES_SHORT=$(BREAK_TREE)/$(INDEX_NAME).res
305BRK_RES_FILES = $(BRS_SRC:%.txt=$(BRKBLDDIR)/%.res) $(BRK_RES_INDEX_RES)
306BRK_RES_FILES_SHORT = $(BRS_SRC:%.txt=$(BREAK_TREE)/%.res)
307
374ca955
A
308RBNF_TREE=rbnf
309RBNF_INDEX_FILE=$(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt
310RBNF_INDEX_RES=$(RBNFBLDDIR)/$(INDEX_NAME).res
311RBNF_INDEX_RES_SHORT=$(RBNF_TREE)/$(INDEX_NAME).res
312RBNF_FILES = $(RBNF_SRC:%.txt=$(RBNFBLDDIR)/%.res) $(RBNF_INDEX_RES)
313RBNF_FILES_SHORT = $(RBNF_SRC:%.txt=$(RBNF_TREE)/%.res)
314
315TRANSLIT_TREE=translit
316#TRANSLIT_INDEX_FILE=$(OUTTMPDIR)/$(TRANSLIT_TREE)/$(INDEX_NAME).txt
317#TRANSLIT_INDEX_RES=$(TRANSLITBLDDIR)/$(INDEX_NAME).res
318#TRANSLIT_INDEX_RES_SHORT=$(TRANSLIT_TREE)/$(INDEX_NAME).res
319TRANSLIT_FILES = $(TRANSLIT_SRC:%.txt=$(TRANSLITBLDDIR)/%.res)
320TRANSLIT_FILES_SHORT = $(TRANSLIT_SRC:%.txt=$(TRANSLIT_TREE)/%.res)
b75a7d8f
A
321
322## All generated files
73c04bcf 323ALL_FILES = $(DAT_FILES) $(CNV_FILES) $(BRK_FILES) $(CTD_FILES) $(RES_FILES) $(INDEX_RES_FILE) $(COLLATION_FILES) $(BRK_RES_FILES) $(RBNF_FILES) $(TRANSLIT_FILES)
374ca955 324# a list to use in the .lst files (package-relative)
73c04bcf 325ALL_FILES_LIST = $(DAT_FILES_SHORT) $(CNV_FILES_SHORT) $(BRK_FILES_SHORT) $(CTD_FILES_SHORT) $(RES_FILES_SHORT) $(INDEX_RES_FILE_SHORT) $(COLLATION_FILES_SHORT) $(COLLATION_INDEX_RES_SHORT) $(BRK_RES_FILES_SHORT) $(BRK_RES_INDEX_RES_SHORT) $(RBNF_FILES_SHORT) $(RBNF_INDEX_RES_SHORT) $(TRANSLIT_FILES_SHORT)
b75a7d8f
A
326
327#####################################################
328# General data build rules
329
330## Files to remove for 'make clean'
331CLEANFILES = *~ icupkg.inc
332
73c04bcf
A
333ifeq ($(ICUDATA_SOURCE_ARCHIVE),)
334build-local: build-dir $(SO_VERSION_DATA) $(ALL_FILES) $(OUTTMPDIR)/icudata.lst $(OS390LIST)
374ca955 335$(OUTTMPDIR)/icudata.lst: $(SRCLISTDEPS)
b75a7d8f
A
336 @echo "generating $@ (list of data files)"
337 @-$(RMV) $@
374ca955 338 @for file in $(ALL_FILES_LIST); do \
b75a7d8f
A
339 echo $$file >> $@; \
340 done;
73c04bcf
A
341else
342build-local: build-dir $(SO_VERSION_DATA) $(OUTTMPDIR)/icudata.lst $(OS390LIST)
343$(OUTTMPDIR)/icudata.lst: $(SRCLISTDEPS) $(ICUDATA_SOURCE_ARCHIVE) $(MAINBUILDDIR)
344ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
345 @echo "Unpacking $(ICUDATA_SOURCE_ARCHIVE) and generating $@ (list of data files)"
346 @-$(RMV) $@
347 $(INVOKE) $(BINDIR)/icupkg -d $(BUILDDIR) --list -x \* $(ICUDATA_SOURCE_ARCHIVE) > $@
348else
349 @echo "$@" > $@
350endif
351endif
b75a7d8f 352
b75a7d8f 353
374ca955
A
354build-dir: $(BUILD_DIRS)
355$(BUILD_DIRS):
356 -$(MKINSTALLDIRS) $(BUILD_DIRS)
b75a7d8f
A
357
358
359# Now, sections for building each kind of data.
360
361#################################################### DAT
362# DAT FILES
363
364# uprops.icu
374ca955
A
365$(BUILDDIR)/uprops.icu: $(UNICODEDATADIR)/UnicodeData.txt $(UNICODEDATADIR)/BidiMirroring.txt $(BINDIR)/genprops$(EXEEXT) $(BUILDDIR)/$(ICUDT)pnames.icu
366 $(INVOKE) $(BINDIR)/genprops -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(BUILDDIR) -u $(UNICODE_VERSION)
73c04bcf
A
367 $(INVOKE) $(BINDIR)/genprops --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION)
368
369# ubidi.icu
370$(BUILDDIR)/ubidi.icu: $(UNICODEDATADIR)/UnicodeData.txt $(BINDIR)/genbidi$(EXEEXT)
371 $(INVOKE) $(BINDIR)/genbidi -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(BUILDDIR) -u $(UNICODE_VERSION)
372 $(INVOKE) $(BINDIR)/genbidi --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION)
374ca955
A
373
374# ucase.icu
375$(BUILDDIR)/ucase.icu: $(UNICODEDATADIR)/UnicodeData.txt $(BINDIR)/gencase$(EXEEXT)
376 $(INVOKE) $(BINDIR)/gencase -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(BUILDDIR) -u $(UNICODE_VERSION)
73c04bcf 377 $(INVOKE) $(BINDIR)/gencase --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION)
b75a7d8f
A
378
379# pnames.icu
374ca955
A
380$(BUILDDIR)/pnames.icu: $(UNICODEDATADIR)/PropertyAliases.txt $(UNICODEDATADIR)/PropertyValueAliases.txt $(UNICODEDATADIR)/Blocks.txt $(COMINCDIR)/uscript.h $(COMINCDIR)/uchar.h $(BINDIR)/genpname$(EXEEXT)
381 $(INVOKE) $(BINDIR)/genpname -d $(BUILDDIR)
b75a7d8f
A
382
383# unorm.icu
374ca955
A
384$(BUILDDIR)/unorm.icu: $(UNICODEDATADIR)/UnicodeData.txt $(UNICODEDATADIR)/DerivedNormalizationProps.txt $(UNICODEDATADIR)/BidiMirroring.txt $(BINDIR)/gennorm$(EXEEXT) $(BUILDDIR)/$(ICUDT)pnames.icu $(BUILDDIR)/$(ICUDT)uprops.icu $(BUILDDIR)/$(ICUDT)ucase.icu
385 $(INVOKE) $(BINDIR)/gennorm -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(BUILDDIR) -u $(UNICODE_VERSION)
73c04bcf 386 $(INVOKE) $(BINDIR)/gennorm --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION)
b75a7d8f
A
387
388# ucadata.icu
73c04bcf
A
389# used to depend on $(BUILDDIR)/$(ICUDT)unorm.icu $(BUILDDIR)/$(ICUDT)ucase.icu
390# see Jitterbug 4497
391$(BUILDDIR)/ucadata.icu $(BUILDDIR)/$(ICUDT)invuca.icu: $(UNICODEDATADIR)/FractionalUCA.txt $(BINDIR)/genuca$(EXEEXT)
374ca955 392 $(INVOKE) $(BINDIR)/genuca -s $(UNICODEDATADIR) -d $(BUILDDIR) -i $(BUILDDIR)
b75a7d8f
A
393
394# unames.icu
374ca955
A
395$(BUILDDIR)/unames.icu: $(UNICODEDATADIR)/UnicodeData.txt $(BINDIR)/gennames$(EXEEXT)
396 $(INVOKE) $(BINDIR)/gennames -1 -d $(BUILDDIR) $(UNICODEDATADIR)/UnicodeData.txt -u $(UNICODE_VERSION)
b75a7d8f
A
397
398# cnvalias.icu
374ca955
A
399$(BUILDDIR)/cnvalias.icu: $(UCMSRCDIR)/convrtrs.txt $(BINDIR)/gencnval$(EXEEXT)
400 $(INVOKE) $(BINDIR)/gencnval -d $(BUILDDIR) $(UCMSRCDIR)/convrtrs.txt
b75a7d8f 401
374ca955 402# uidna.spp
73c04bcf 403$(BUILDDIR)/uidna.spp: $(MISCSRCDIR)/NamePrepProfile.txt $(BINDIR)/gensprep$(EXEEXT) $(BUILDDIR)/unames.icu $(BUILDDIR)/pnames.icu
374ca955 404 $(INVOKE) $(BINDIR)/gensprep -d $(BUILDDIR) -i $(BUILDDIR) -s $(MISCSRCDIR) -b uidna -n $(UNICODEDATADIR) -u 3.2.0 -k NamePrepProfile.txt
b75a7d8f
A
405
406#################################################### BRK
407# BRK FILES
408
73c04bcf
A
409#thaidict.brk: $(SRCDATADIR)/thaidict.brk
410# $(RMV) $@ && ln -s $(BUILDDIR) $@
b75a7d8f 411
73c04bcf 412$(BRKBLDDIR)/%.brk: $(BRKSRCDIR)/%.txt $(BINDIR)/genbrk$(EXEEXT) $(DAT_FILES)
374ca955 413 $(INVOKE) $(BINDIR)/genbrk -c -i $(BUILDDIR) -r $< -o $@
b75a7d8f 414
73c04bcf
A
415#################################################### CTD
416# CTD FILES
417
418$(BRKBLDDIR)/%.ctd: $(BRKSRCDIR)/%.txt $(BINDIR)/genctd$(EXEEXT) $(DAT_FILES)
419 $(INVOKE) $(BINDIR)/genctd -c -i $(BUILDDIR) -o $@ $<
420
b75a7d8f
A
421#################################################### CNV
422# CNV FILES
374ca955
A
423$(BUILDDIR)/%.cnv: $(UCMSRCDIR)/%.ucm $(BINDIR)/makeconv$(EXEEXT)
424 $(INVOKE) $(BINDIR)/makeconv -c -d $(BUILDDIR) $(UCMSRCDIR)/$(<F)
b75a7d8f
A
425
426#################################################### RES
427# RES FILES
428
374ca955
A
429### collation res
430$(COLBLDDIR)/%.res: $(COLSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
431 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(COLSRCDIR) -d $(COLBLDDIR) $(<F)
432
433$(COLBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt $(BINDIR)/genrb$(EXEEXT)
434 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(COLLATION_TREE) -d $(COLBLDDIR) $(INDEX_NAME).txt
435
436$(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
437 @echo "generating $@ (list of installed collation locales)"; \
438 $(RMV) $@; \
439 echo "// Warning this file is automatically generated" > $@; \
73c04bcf 440 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
374ca955
A
441 echo " InstalledLocales {" >> $@; \
442 for file in $(INSTALLED_COL_FILES); do \
443 echo " $$file {\"\"}" >> $@; \
444 done; \
445 echo " }" >> $@; \
446 echo "}" >> $@;
447
73c04bcf
A
448### brk res
449$(BRKBLDDIR)/%.res: $(BRKSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
450 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(BRKSRCDIR) -d $(BRKBLDDIR) $(<F)
451
452$(BRKBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt $(BINDIR)/genrb$(EXEEXT)
453 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(BREAK_TREE) -d $(BRKBLDDIR) $(INDEX_NAME).txt
454
455$(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
456 @echo "generating $@ (list of installed break locales)"; \
457 $(RMV) $@; \
458 echo "// Warning this file is automatically generated" > $@; \
459 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
460 echo " InstalledLocales {" >> $@; \
461 for file in $(INSTALLED_BRS_FILES); do \
462 echo " $$file {\"\"}" >> $@; \
463 done; \
464 echo " }" >> $@; \
465 echo "}" >> $@;
466
374ca955
A
467### RBNF res
468$(RBNFBLDDIR)/%.res: $(RBNFSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
469 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(RBNFSRCDIR) -d $(RBNFBLDDIR) $(<F)
470
471$(RBNFBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt $(BINDIR)/genrb$(EXEEXT)
472 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(RBNF_TREE) -d $(RBNFBLDDIR) $(INDEX_NAME).txt
473
474$(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
475 @echo "generating $@ (list of installed RBNF locales)"; \
476 $(RMV) $@; \
477 echo "// Warning this file is automatically generated" > $@; \
73c04bcf 478 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
374ca955
A
479 echo " InstalledLocales {" >> $@; \
480 for file in $(INSTALLED_RBNF_FILES); do \
481 echo " $$file {\"\"}" >> $@; \
482 done; \
483 echo " }" >> $@; \
484 echo "}" >> $@;
485
486### TRANSLIT res
487$(TRANSLITBLDDIR)/%.res: $(TRANSLITSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
488 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(TRANSLITSRCDIR) -d $(TRANSLITBLDDIR) $(<F)
489
490### normal (locale) res
b75a7d8f
A
491all-RES: $(RES_FILES)
492
374ca955
A
493$(BUILDDIR)/%.res: $(LOCSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
494 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(LOCSRCDIR) -d $(BUILDDIR) $(<F)
b75a7d8f 495
73c04bcf
A
496# if the tzcode directory contains a new tzdata*.tar.gz file, use it for zoneinfo.txt
497TZDATA = $(firstword $(wildcard $(top_builddir)/tools/tzcode/tzdata*.tar.gz) $(wildcard $(top_srcdir)/tools/tzcode/tzdata*.tar.gz))
498
499ifneq ($(TZDATA),)
500
501TZCODE_DIR=$(top_builddir)/tools/tzcode
502ZONEINFO=$(TZCODE_DIR)/zoneinfo.txt
503
504# Override the normal genrb for zoneinfo.txt to always pull from
505# icu/source/tools/tzcode/zoneinfo.txt
506$(BUILDDIR)/zoneinfo.res: $(ZONEINFO) $(BINDIR)/genrb$(EXEEXT)
507 @echo Note: $(MISCSRCDIR)/zoneinfo.txt is IGNORED because $(TZDATA) is present.
508 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -d $(BUILDDIR) $(ZONEINFO)
509
510# Create the tzcode tool and zoneinfo.txt as needed.
511$(ZONEINFO): $(TZDATA)
512 @echo "$(MAKE)[$(MAKELEVEL)]: Making \`$(ZONEINFO)' in \`$(TZCODE_DIR)'"; \
513 (cd $(TZCODE_DIR) && $(MAKE)) || exit; \
514
515# end of zoneinfo.txt-generation
516endif
517
374ca955
A
518# zoneinfo has some issues. Ignore some warnings with -q
519$(BUILDDIR)/%.res: $(MISCSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT)
520 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -s $(MISCSRCDIR) -d $(BUILDDIR) $(<F)
b75a7d8f 521
73c04bcf
A
522
523
374ca955 524$(OUTTMPDIR)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
b75a7d8f
A
525 @echo "generating $@ (list of installed locales)"; \
526 $(RMV) $@; \
527 echo "// Warning this file is automatically generated" > $@; \
73c04bcf 528 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
b75a7d8f
A
529 echo " InstalledLocales {" >> $@; \
530 for file in $(INSTALLED_RB_FILES); do \
531 echo " $$file {\"\"}" >> $@; \
532 done; \
533 echo " }" >> $@; \
534 echo "}" >> $@;
535
374ca955
A
536clean-resindex:
537 -$(RMV) $(BUILDDIR)/$(INDEX_NAME).txt $(OUTTMPDIR)/icudata.lst
538
539$(INDEX_RES_FILE): $(INDEX_FILE) $(BINDIR)/genrb$(EXEEXT)
540 $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -d $(BUILDDIR) $(INDEX_FILE)
b75a7d8f
A
541
542###################################################################
543Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
544 cd $(top_builddir) \
545 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
546
547icupkg.inc: $(srcdir)/icupkg.inc.in $(top_builddir)/config.status
548 cd $(top_builddir) \
549 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
550
551###########
552########### 390 (z/OS) support
553UCMFILES390=ebcdic-xml-us.ucm ibm-37_P100-1995.ucm ibm-1047_P100-1995.ucm ibm-4909_P100-1999.ucm
73c04bcf
A
554# used to depend on uprops.icu ucase.icu ubidi.icu unorm.icu
555# see Jitterbug 4497
556ALLFILES390=pnames.icu cnvalias.icu $(UCMFILES390:.ucm=.cnv)
b75a7d8f 557
374ca955 558$(OUTTMPDIR)/icudata390.lst: $(SRCLISTDEPS)
b75a7d8f
A
559 @echo "generating $@ (list of 390 data files)"
560 @-$(RMV) $@
561 @for file in $(ALLFILES390); do \
b75a7d8f
A
562 echo $$file >> $@; \
563 done;
564
374ca955
A
565ifeq ($(POST_DATA_BUILD), os400-data-rebind)
566os400-data-rebind: $(LIBICUUC)
b75a7d8f 567
374ca955
A
568$(LIBICUUC): $(LIBICUDT)
569 $(RMV) $(LIBICUUC)
570 (cd ../common && $(MAKE) RECURSIVE=YES) || exit;
571endif
b75a7d8f 572