## Makefile.in for ICU data
-## Copyright (c) 1999-2006, International Business Machines Corporation and
+## Copyright (c) 1999-2007, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
UCMSRCDIR=$(SRCDATADIR)/mappings
COMINCDIR=$(top_srcdir)/common/unicode
SRCLISTDEPS=Makefile $(srcdir)/Makefile.in
-BUILD_DIRS=$(OUTDIR) $(BUILDDIR) $(BRKBLDDIR) $(COLBLDDIR) $(RBNFBLDDIR) $(TRANSLITBLDDIR) $(TESTOUTDIR) $(TESTBUILDDIR) $(OUTTMPDIR) $(OUTTMPDIR_390STUB) $(OUTTMPDIR)/$(COLLATION_TREE) $(OUTTMPDIR)/$(RBNF_TREE) $(OUTTMPDIR)/$(TRANSLIT_TREE) $(OUTTMPDIR)/$(BREAK_TREE)
+BUILD_DIRS=$(OUTDIR) $(MAINBUILDDIR) $(BUILDDIR) $(BRKBLDDIR) $(COLBLDDIR) $(RBNFBLDDIR) $(TRANSLITBLDDIR) $(OUTTMPDIR) $(OUTTMPDIR_390STUB) $(OUTTMPDIR)/$(COLLATION_TREE) $(OUTTMPDIR)/$(RBNF_TREE) $(OUTTMPDIR)/$(TRANSLIT_TREE) $(OUTTMPDIR)/$(BREAK_TREE)
# relative lib links from pkgdata are the same as for tmp
TOOLDIR=$(top_builddir)/tools
all-local: build-dir icupkg.inc build-local packagedata $(POST_DATA_BUILD) $(OS390PKG)
-# Starting with ICU4C 3.4, the core Unicode properties files (uprops.icu, ucase.icu, ubidi.icu, unorm.icu)
-# are hardcoded in the common DLL and therefore not included in the data package any more.
-# They are not built by default but need to be built for ICU4J data and for getting the .c source files
-# when updating the Unicode data.
-# Changed in Makefile.in revision 1.147. See Jitterbug 4497.
-uni-core-data: build-dir $(BUILDDIR)/uprops.icu $(BUILDDIR)/ucase.icu $(BUILDDIR)/ubidi.icu $(BUILDDIR)/unorm.icu
- @echo Unicode .icu files built to $(BUILDDIR)
- @echo Unicode .c source files built to $(OUTTMPDIR)
-
dist-local:
clean-map:
# We don't want to try to write over files that we are using.
PKGDATA_INVOKE:=$(subst $(LIBDIR):$(top_builddir)/stubdata,$(top_builddir)/stubdata:$(LIBDIR),$(INVOKE)) $(PKGDATA_INVOKE_OPTS)
-packagedata: icupkg.inc $(OUTTMPDIR)/icudata.lst build-local
+packagedata: icupkg.inc $(PKGDATA_LIST) build-local
ifneq ($(ENABLE_STATIC),)
- $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) -m static $(OUTTMPDIR)/icudata.lst
+ifeq ($(PKGDATA_MODE),dll)
+ $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) -m static $(PKGDATA_LIST)
+endif
endif
ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
- $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(PKGDATA_LIBNAME) $(OUTTMPDIR)/icudata.lst
+ $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(PKGDATA_LIBNAME) $(PKGDATA_LIST)
else
$(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(OUTDIR)
endif
## Install ICU data.
-install-local: $(OUTTMPDIR)/icudata.lst ./icupkg.inc packagedata $(OS390INSTALL)
+install-local: $(PKGDATA_LIST) ./icupkg.inc packagedata $(OS390INSTALL)
$(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(ICUPKGDATA_DIR)
ifneq ($(ENABLE_STATIC),)
- $(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)
+ifeq ($(PKGDATA_MODE),dll)
+ $(PKGDATA_INVOKE) $(PKGDATA) -m static -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_LIBDIR)
+endif
endif
ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
- $(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)
+ $(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)
else
$(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(DESTDIR)$(ICUPKGDATA_DIR)
endif
endif
#### $(LIB_ICUDATA_NAME)$(STUB_SUFFIX) is the subset data for batch mode
-package390: $(OUTTMPDIR)/icudata390.lst $(OUTTMPDIR)/icudata.lst ./icupkg.inc packagedata
+package390: $(OUTTMPDIR)/icudata390.lst $(PKGDATA_LIST) ./icupkg.inc packagedata
ln -s $(ICUDATA_NAME) $(OUTDIR)/build/$(ICUDATA_NAME)$(STUB_SUFFIX)
$(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)
cp $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) $(top_builddir)/stubdata/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO)
-include $(RBNFSRCDIR)/rbnflocal.mk
-include $(TRANSLITSRCDIR)/trnslocal.mk
ifdef GENRB_SOURCE
-RES_SRC= root.txt $(GENRB_SOURCE) $(GENRB_ALIAS_SOURCE) $(GENRB_SOURCE_LOCAL)
+RES_SRC= root.txt $(GENRB_SOURCE) $(GENRB_ALIAS_SOURCE) $(GENRB_SOURCE_LOCAL) $(GENRB_ALIAS_SOURCE_LOCAL)
RES_SRC_FILES = $(RES_SRC:%=$(LOCSRCDIR)/%)
INSTALLED_RB_FILES = $(GENRB_SOURCE:%.txt=%) $(GENRB_SOURCE_LOCAL:%.txt=%)
endif
ALL_RES_SRC= $(RES_SRC) $(TRNS_SOURCE) $(MSC_SOURCE)
RES_FILES = $(ALL_RES_SRC:%.txt=$(BUILDDIR)/%.res)
RES_FILES_SHORT = $(ALL_RES_SRC:%.txt=%.res)
+PKGDATA_LIST = $(OUTTMPDIR)/icudata.lst
INDEX_NAME=res_index
INDEX_FILE=$(OUTTMPDIR)/$(INDEX_NAME).txt
## All generated files
ALL_FILES = $(DAT_FILES) $(CNV_FILES) $(BRK_FILES) $(CTD_FILES) $(RES_FILES) $(INDEX_RES_FILE) $(COLLATION_FILES) $(BRK_RES_FILES) $(RBNF_FILES) $(TRANSLIT_FILES)
+ALL_INDEX_SRC_FILES = $(PKGDATA_LIST) $(INDEX_FILE) $(COLLATION_INDEX_FILE) $(BRK_RES_INDEX_FILE) $(RBNF_INDEX_FILE)
# a list to use in the .lst files (package-relative)
ALL_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)
+UNI_CORE_DATA=uprops.icu ucase.icu ubidi.icu unorm.icu
+UNI_CORE_TARGET_DATA=$(UNI_CORE_DATA:%=$(BUILDDIR)/%)
+
+ifneq ($(INCLUDE_UNI_CORE_DATA),)
+ALL_FILES_LIST+=$(UNI_CORE_DATA)
+build-local: uni-core-data
+endif
+
#####################################################
# General data build rules
CLEANFILES = *~ icupkg.inc
ifeq ($(ICUDATA_SOURCE_ARCHIVE),)
-build-local: build-dir $(SO_VERSION_DATA) $(ALL_FILES) $(OUTTMPDIR)/icudata.lst $(OS390LIST)
-$(OUTTMPDIR)/icudata.lst: $(SRCLISTDEPS)
+build-local: build-dir $(SO_VERSION_DATA) $(ALL_FILES) $(PKGDATA_LIST) $(OS390LIST)
+$(PKGDATA_LIST): $(SRCLISTDEPS)
@echo "generating $@ (list of data files)"
@-$(RMV) $@
@for file in $(ALL_FILES_LIST); do \
echo $$file >> $@; \
done;
else
-build-local: build-dir $(SO_VERSION_DATA) $(OUTTMPDIR)/icudata.lst $(OS390LIST)
-$(OUTTMPDIR)/icudata.lst: $(SRCLISTDEPS) $(ICUDATA_SOURCE_ARCHIVE) $(MAINBUILDDIR)
+build-local: build-dir $(SO_VERSION_DATA) $(PKGDATA_LIST) $(OS390LIST)
+$(PKGDATA_LIST): $(SRCLISTDEPS) $(ICUDATA_SOURCE_ARCHIVE)
ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
@echo "Unpacking $(ICUDATA_SOURCE_ARCHIVE) and generating $@ (list of data files)"
@-$(RMV) $@
endif
-build-dir: $(BUILD_DIRS)
-$(BUILD_DIRS):
- -$(MKINSTALLDIRS) $(BUILD_DIRS)
+build-dir:
+ @list='$(BUILD_DIRS)'; \
+ for dir in $$list; do \
+ if ! test -d $$dir; then \
+ echo $(MKINSTALLDIRS) $(BUILD_DIRS); \
+ $(MKINSTALLDIRS) $(BUILD_DIRS); \
+ fi; \
+ done
+# The | is an order-only prerequisite. This helps when the -j option is used,
+# and we don't want the files to be built before the directories are built.
+ifneq ($(filter order-only,$(.FEATURES)),)
+$(ALL_FILES) $(ALL_INDEX_SRC_FILES): | build-dir
+endif
# Now, sections for building each kind of data.
$(COLBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt $(BINDIR)/genrb$(EXEEXT)
$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(COLLATION_TREE) -d $(COLBLDDIR) $(INDEX_NAME).txt
-$(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
+$(COLLATION_INDEX_FILE): $(SRCLISTDEPS)
@echo "generating $@ (list of installed collation locales)"; \
$(RMV) $@; \
echo "// Warning this file is automatically generated" > $@; \
echo "}" >> $@;
### brk res
-$(BRKBLDDIR)/%.res: $(BRKSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
+$(BRKBLDDIR)/%.res: $(BRKSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(BRK_FILES) $(DAT_FILES)
$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(BRKSRCDIR) -d $(BRKBLDDIR) $(<F)
$(BRKBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt $(BINDIR)/genrb$(EXEEXT)
$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(BREAK_TREE) -d $(BRKBLDDIR) $(INDEX_NAME).txt
-$(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
+$(BRK_RES_INDEX_FILE): $(SRCLISTDEPS)
@echo "generating $@ (list of installed break locales)"; \
$(RMV) $@; \
echo "// Warning this file is automatically generated" > $@; \
$(RBNFBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt $(BINDIR)/genrb$(EXEEXT)
$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(RBNF_TREE) -d $(RBNFBLDDIR) $(INDEX_NAME).txt
-$(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
+$(RBNF_INDEX_FILE): $(SRCLISTDEPS)
@echo "generating $@ (list of installed RBNF locales)"; \
$(RMV) $@; \
echo "// Warning this file is automatically generated" > $@; \
-$(OUTTMPDIR)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
+$(INDEX_FILE): $(SRCLISTDEPS)
@echo "generating $@ (list of installed locales)"; \
$(RMV) $@; \
echo "// Warning this file is automatically generated" > $@; \
echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
+ echo " CLDRVersion { \"$(GENRB_CLDR_VERSION)\" }" >> $@; \
echo " InstalledLocales {" >> $@; \
for file in $(INSTALLED_RB_FILES); do \
echo " $$file {\"\"}" >> $@; \
echo "}" >> $@;
clean-resindex:
- -$(RMV) $(BUILDDIR)/$(INDEX_NAME).txt $(OUTTMPDIR)/icudata.lst
+ -$(RMV) $(BUILDDIR)/$(INDEX_NAME).txt $(PKGDATA_LIST)
$(INDEX_RES_FILE): $(INDEX_FILE) $(BINDIR)/genrb$(EXEEXT)
$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -d $(BUILDDIR) $(INDEX_FILE)
+# Starting with ICU4C 3.4, the core Unicode properties files (uprops.icu, ucase.icu, ubidi.icu, unorm.icu)
+# are hardcoded in the common DLL and therefore not included in the data package any more.
+# They are not built by default but need to be built for ICU4J data and for getting the .c source files
+# when updating the Unicode data.
+# Changed in Makefile.in revision 1.147. See Jitterbug 4497.
+uni-core-data: build-dir $(UNI_CORE_TARGET_DATA)
+ @echo Unicode .icu files built to $(BUILDDIR)
+ @echo Unicode .c source files built to $(OUTTMPDIR)
+
+build-icu4j: all
+ $(MAKE) -C ../tools/genrb $@
+
###################################################################
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \