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