• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Makefile.in for ICU data
2## Copyright (c) 1999-2007, International Business Machines Corporation and
3## others. All Rights Reserved.
4
5## Source directory information
6srcdir = .
7top_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
20LIB_ICUDATA_NAME=$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX)
21LIB_STATIC_ICUDATA_NAME=$(LIBSICU)$(DATA_STUBNAME)$(ICULIBSUFFIX)
22
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
37
38CURDIR:=$(CURR_FULL_DIR)
39PKGDATA = $(BINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR) -M'PKGDATA_LDFLAGS="$(LDFLAGSICUDT)"'
40
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
49
50# OBJDATADIR must be a short path (with ..'s) to the data.
51
52ifeq ($(top_srcdir),..)
53SRCDATADIR=.
54else
55SRCDATADIR=$(top_srcdir)/data
56endif
57ifeq ($(top_builddir),..)
58OUTDIR=./out
59else
60OUTDIR=$(top_builddir)/data/out
61endif
62
63OUTTMPDIR=$(OUTDIR)/tmp
64MAINBUILDDIR=$(OUTDIR)/build
65BUILDDIR=$(MAINBUILDDIR)/$(ICUDATA_PLATFORM_NAME)
66UNICODEDATADIR=$(SRCDATADIR)/unidata
67LOCSRCDIR=$(SRCDATADIR)/locales
68COLSRCDIR=$(SRCDATADIR)/coll
69COLBLDDIR=$(BUILDDIR)/coll
70RBNFSRCDIR=$(SRCDATADIR)/rbnf
71RBNFBLDDIR=$(BUILDDIR)/rbnf
72TRANSLITSRCDIR=$(SRCDATADIR)/translit
73TRANSLITBLDDIR=$(BUILDDIR)/translit
74MISCSRCDIR=$(SRCDATADIR)/misc
75BRKSRCDIR=$(SRCDATADIR)/brkitr
76BRKBLDDIR=$(BUILDDIR)/brkitr
77MISCSRCDIR=$(SRCDATADIR)/misc
78UCMSRCDIR=$(SRCDATADIR)/mappings
79COMINCDIR=$(top_srcdir)/common/unicode
80SRCLISTDEPS=Makefile $(srcdir)/Makefile.in
81BUILD_DIRS=$(OUTDIR) $(MAINBUILDDIR) $(BUILDDIR) $(BRKBLDDIR) $(COLBLDDIR) $(RBNFBLDDIR) $(TRANSLITBLDDIR) $(OUTTMPDIR) $(OUTTMPDIR_390STUB) $(OUTTMPDIR)/$(COLLATION_TREE) $(OUTTMPDIR)/$(RBNF_TREE) $(OUTTMPDIR)/$(TRANSLIT_TREE) $(OUTTMPDIR)/$(BREAK_TREE)
82
83# relative lib links from pkgdata are the same as for tmp
84TOOLDIR=$(top_builddir)/tools
85
86## List of phony targets
87.PHONY : all all-local all-recursive install install-local install-files	\
88install-recursive clean clean-local clean-recursive distclean		\
89distclean-local distclean-recursive dist dist-local dist-recursive	\
90check check-local check-recursive build-local clean-resindex build-dir
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
107all-local: build-dir icupkg.inc build-local packagedata $(POST_DATA_BUILD) $(OS390PKG)
108
109dist-local:
110
111clean-map:
112	-test -z *.map || $(RMV) *.map
113
114clean-local: cleanpackage cleanfiles clean-map
115
116cleanfiles:
117	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
118
119cleanpackage:
120	$(RMV) $(OUTDIR)
121	$(RMV) $(LIBDIR)/$(LIB_ICUDATA_NAME)*.$(SO)* $(LIBDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A)
122
123check-local:
124
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
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.
150PKGDATA_INVOKE:=$(subst $(LIBDIR):$(top_builddir)/stubdata,$(top_builddir)/stubdata:$(LIBDIR),$(INVOKE)) $(PKGDATA_INVOKE_OPTS)
151
152packagedata: icupkg.inc $(PKGDATA_LIST) build-local
153ifneq ($(ENABLE_STATIC),)
154ifeq ($(PKGDATA_MODE),dll)
155	$(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) -m static $(PKGDATA_LIST)
156endif
157endif
158ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
159	$(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(PKGDATA_LIBNAME) $(PKGDATA_LIST)
160else
161	$(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(OUTDIR)
162endif
163
164## Install ICU data.
165install-local: $(PKGDATA_LIST) ./icupkg.inc packagedata $(OS390INSTALL)
166	$(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(ICUPKGDATA_DIR)
167ifneq ($(ENABLE_STATIC),)
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
171endif
172ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
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)
174else
175	$(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(DESTDIR)$(ICUPKGDATA_DIR)
176endif
177
178
179####
180####
181#### 390 support
182install390: package390
183	$(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(libdir)
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)
185ifeq ($(PKGDATA_MODE),dll)
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)
187endif
188
189#### $(LIB_ICUDATA_NAME)$(STUB_SUFFIX) is the subset data for batch mode
190package390: $(OUTTMPDIR)/icudata390.lst $(PKGDATA_LIST) ./icupkg.inc packagedata
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)
194
195
196##### Define all the data files. the build rule that depends on them is below.
197# X_FILES_SHORT = just the base names (for lists)
198# X_FILES = full paths (for dependency)
199
200## DAT files - Misc. data files.
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
205DAT_FILES=$(DAT_FILES_SHORT:%=$(BUILDDIR)/%)
206
207## BRK files
208BREAK_TREE=brkitr
209-include $(BRKSRCDIR)/brkfiles.mk
210-include $(BRKSRCDIR)/brklocal.mk
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
224
225## UCM files
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)/%)
232CNV_FILES = $(ALL_UCM_SOURCE:%.ucm=$(BUILDDIR)/%.cnv)
233CNV_FILES_SHORT = $(ALL_UCM_SOURCE:%.ucm=%.cnv)
234
235## RES files
236-include $(LOCSRCDIR)/resfiles.mk
237-include $(COLSRCDIR)/colfiles.mk
238-include $(RBNFSRCDIR)/rbnffiles.mk
239-include $(TRANSLITSRCDIR)/trnsfiles.mk
240-include $(LOCSRCDIR)/reslocal.mk
241-include $(COLSRCDIR)/collocal.mk
242-include $(BRKSRCDIR)/brslocal.mk
243-include $(RBNFSRCDIR)/rbnflocal.mk
244-include $(TRANSLITSRCDIR)/trnslocal.mk
245ifdef GENRB_SOURCE
246RES_SRC= root.txt $(GENRB_SOURCE) $(GENRB_ALIAS_SOURCE) $(GENRB_SOURCE_LOCAL)
247RES_SRC_FILES = $(RES_SRC:%=$(LOCSRCDIR)/%)
248INSTALLED_RB_FILES = $(GENRB_SOURCE:%.txt=%) $(GENRB_SOURCE_LOCAL:%.txt=%)
249endif
250ifdef COLLATION_SOURCE
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=%)
254endif
255ifdef RBNF_SOURCE
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=%)
259endif
260ifdef TRANSLIT_SOURCE
261TRANSLIT_SRC= $(TRANSLIT_SOURCE) $(TRANSLIT_ALIAS_SOURCE) $(TRANSLIT_SOURCE_LOCAL)
262TRANSLIT_SRC_FILES = $(TRANSLIT_SRC:%=$(TRANSLITSRCDIR)/%)
263INSTALLED_TRANSLIT_FILES = $(TRANSLIT_SOURCE:%.txt=%)  $(TRANSLIT_SOURCE_LOCAL:%.txt=%)
264endif
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
277	rc.exe /i$(srcdir)/../common /fo$@ $(SOURCE_FILE)
278endif
279endif
280
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)
284PKGDATA_LIST = $(OUTTMPDIR)/icudata.lst
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
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
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)
317
318## All generated files
319ALL_FILES = $(DAT_FILES) $(CNV_FILES) $(BRK_FILES) $(CTD_FILES) $(RES_FILES) $(INDEX_RES_FILE) $(COLLATION_FILES) $(BRK_RES_FILES) $(RBNF_FILES) $(TRANSLIT_FILES)
320ALL_INDEX_SRC_FILES = $(PKGDATA_LIST) $(INDEX_FILE) $(COLLATION_INDEX_FILE) $(BRK_RES_INDEX_FILE) $(RBNF_INDEX_FILE)
321# a list to use in the .lst files (package-relative)
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)
323
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
332#####################################################
333# General data build rules
334
335## Files to remove for 'make clean'
336CLEANFILES = *~ icupkg.inc
337
338ifeq ($(ICUDATA_SOURCE_ARCHIVE),)
339build-local: build-dir $(SO_VERSION_DATA) $(ALL_FILES) $(PKGDATA_LIST) $(OS390LIST)
340$(PKGDATA_LIST): $(SRCLISTDEPS)
341	@echo "generating $@ (list of data files)"
342	@-$(RMV) $@
343	@for file in $(ALL_FILES_LIST); do \
344	  echo $$file >> $@; \
345	done;
346else
347build-local: build-dir $(SO_VERSION_DATA) $(PKGDATA_LIST) $(OS390LIST)
348$(PKGDATA_LIST): $(SRCLISTDEPS) $(ICUDATA_SOURCE_ARCHIVE)
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
357
358
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
367
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
373
374# Now, sections for building each kind of data.
375
376####################################################    DAT
377# DAT FILES
378
379# uprops.icu
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)
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)
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)
392	$(INVOKE) $(BINDIR)/gencase --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION)
393
394# pnames.icu
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)
397
398# unorm.icu
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)
401	$(INVOKE) $(BINDIR)/gennorm --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION)
402
403# ucadata.icu
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)
407	$(INVOKE) $(BINDIR)/genuca -s $(UNICODEDATADIR) -d $(BUILDDIR) -i $(BUILDDIR)
408
409# unames.icu
410$(BUILDDIR)/unames.icu: $(UNICODEDATADIR)/UnicodeData.txt $(BINDIR)/gennames$(EXEEXT)
411	$(INVOKE) $(BINDIR)/gennames -1 -d $(BUILDDIR) $(UNICODEDATADIR)/UnicodeData.txt -u $(UNICODE_VERSION)
412
413# cnvalias.icu
414$(BUILDDIR)/cnvalias.icu: $(UCMSRCDIR)/convrtrs.txt $(BINDIR)/gencnval$(EXEEXT)
415	$(INVOKE) $(BINDIR)/gencnval -d $(BUILDDIR) $(UCMSRCDIR)/convrtrs.txt
416
417# uidna.spp
418$(BUILDDIR)/uidna.spp: $(MISCSRCDIR)/NamePrepProfile.txt $(BINDIR)/gensprep$(EXEEXT) $(BUILDDIR)/unames.icu $(BUILDDIR)/pnames.icu
419	$(INVOKE) $(BINDIR)/gensprep -d $(BUILDDIR) -i $(BUILDDIR) -s $(MISCSRCDIR) -b uidna -n $(UNICODEDATADIR) -u 3.2.0 -k NamePrepProfile.txt
420
421####################################################    BRK
422# BRK FILES
423
424#thaidict.brk: $(SRCDATADIR)/thaidict.brk
425#	$(RMV) $@ && ln -s $(BUILDDIR) $@
426
427$(BRKBLDDIR)/%.brk: $(BRKSRCDIR)/%.txt $(BINDIR)/genbrk$(EXEEXT) $(DAT_FILES)
428	$(INVOKE) $(BINDIR)/genbrk -c -i $(BUILDDIR) -r $< -o $@
429
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
436####################################################    CNV
437# CNV FILES
438$(BUILDDIR)/%.cnv: $(UCMSRCDIR)/%.ucm $(BINDIR)/makeconv$(EXEEXT)
439	$(INVOKE) $(BINDIR)/makeconv -c -d $(BUILDDIR) $(UCMSRCDIR)/$(<F)
440
441####################################################    RES
442# RES FILES
443
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
451$(COLLATION_INDEX_FILE): $(SRCLISTDEPS)
452	@echo "generating $@ (list of installed collation locales)"; \
453	$(RMV) $@; \
454	echo "// Warning this file is automatically generated" > $@; \
455	echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
456	echo "    InstalledLocales {" >> $@; \
457	for file in $(INSTALLED_COL_FILES); do \
458	  echo "        $$file {\"\"}" >> $@; \
459	done; \
460	echo "    }" >> $@; \
461	echo "}" >> $@;
462
463### brk res
464$(BRKBLDDIR)/%.res: $(BRKSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(BRK_FILES) $(DAT_FILES)
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
470$(BRK_RES_INDEX_FILE): $(SRCLISTDEPS)
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
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
489$(RBNF_INDEX_FILE): $(SRCLISTDEPS)
490	@echo "generating $@ (list of installed RBNF locales)"; \
491	$(RMV) $@; \
492	echo "// Warning this file is automatically generated" > $@; \
493	echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
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
506all-RES:  $(RES_FILES)
507
508$(BUILDDIR)/%.res: $(LOCSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
509	$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(LOCSRCDIR) -d $(BUILDDIR) $(<F)
510
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
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)
536
537
538
539$(INDEX_FILE): $(SRCLISTDEPS)
540	@echo "generating $@ (list of installed locales)"; \
541	$(RMV) $@; \
542	echo "// Warning this file is automatically generated" > $@; \
543	echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
544        echo "    CLDRVersion { \"$(GENRB_CLDR_VERSION)\" }" >> $@; \
545	echo "    InstalledLocales {" >> $@; \
546	for file in $(INSTALLED_RB_FILES); do \
547	  echo "        $$file {\"\"}" >> $@; \
548	done; \
549	echo "    }" >> $@; \
550	echo "}" >> $@;
551
552clean-resindex:
553	-$(RMV) $(BUILDDIR)/$(INDEX_NAME).txt $(PKGDATA_LIST)
554
555$(INDEX_RES_FILE): $(INDEX_FILE) $(BINDIR)/genrb$(EXEEXT)
556	$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -d $(BUILDDIR) $(INDEX_FILE)
557
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
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
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)
585
586$(OUTTMPDIR)/icudata390.lst: $(SRCLISTDEPS)
587	@echo "generating $@ (list of 390 data files)"
588	@-$(RMV) $@
589	@for file in $(ALLFILES390); do \
590	  echo $$file >> $@; \
591	done;
592
593ifeq ($(POST_DATA_BUILD), os400-data-rebind)
594os400-data-rebind: $(LIBICUUC)
595
596$(LIBICUUC): $(LIBICUDT)
597	$(RMV) $(LIBICUUC)
598	(cd ../common && $(MAKE) RECURSIVE=YES) || exit;
599endif
600
601