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