ICU-743 moving where data is built and tested

X-SVN-Rev: 3086
This commit is contained in:
Steven R. Loomis 2000-12-01 17:20:26 +00:00
parent 3c59d27ecc
commit 282bf3d991
4 changed files with 269 additions and 29 deletions

View File

@ -4,8 +4,13 @@
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
## Top-level Makefile.in for ICU
## ICU data directory. This is the directory where the final packaging
## of data goes, + some test data.
##
## Point ICU_DATA to this directory.
##
## Stephen F. Booth
## Steven R. Loomis
## Install directory information
srcdir = @srcdir@
@ -21,22 +26,20 @@ subdir = data
## Platform-specific setup
include @platform_make_fragment@
## Optional directory setup
@EXTRAS_TRUE@EXTRA = extra
@EXTRAS_FALSE@EXTRA =
@TESTS_TRUE@TEST = test
@TESTS_FALSE@TEST =
@SAMPLES_TRUE@SAMPLE = samples
@SAMPLES_FALSE@SAMPLE =
## Files to remove for 'make clean'
CLEANFILES = *~
CLEANFILES = *~ $(SPECIALTESTDATA)
DOCDIRS =
SUBDIRS =
SUBDIRS = build
## Extra files to install [nothing at present]
EXTRA_DATA =
SPECIALTESTDATA=test1.cnv test3.cnv test4.cnv
TESTDATAOBJDIR=../test/testdata
top_builddir_from_tmp = $(patsubst ..%,../..%,$(top_builddir))
INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir_from_tmp)/common:$(top_builddir_from_tmp)/tools/toolutil:$$$(LDLIBRARYPATH_ENVVAR)
CURDIR=$(shell /bin/pwd)
PKGDATA = $(top_builddir_from_tmp)/tools/pkgdata/pkgdata -O $(top_builddir_from_tmp)/tools/pkgdata/icupkg.inc -d $(CURDIR) -m $(PKGDATA_MODE)
## List of phony targets
.PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \
@ -48,9 +51,9 @@ check check-local check-recursive builddata
.SUFFIXES :
## List of standard targets
all: all-local all-recursive
install: install-recursive install-local
clean: clean-recursive clean-local
all: all-recursive
install: install-recursive
clean: clean-recursive
distclean : distclean-recursive distclean-local
dist: dist-recursive dist-local
check: all check-recursive check-local
@ -73,17 +76,17 @@ all-recursive install-recursive clean-recursive distclean-recursive dist-recursi
$(MAKE) "$$target-local" || exit; \
fi
all-local: builddata
all-local: packagedata testdata packagetest
install-local:
dist-local:
clean-local:
cleanfiles:
test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
ifneq ($(wildcard .links),)
$(RMV) UnicodeData-$(UNICODE_VERSION).txt thaidict.brk unidata .links
endif
clean-local: cleanpackage cleanfiles
distclean-local: clean-local
$(RMV) Makefile
@ -94,14 +97,29 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
builddata: UnicodeData-$(UNICODE_VERSION).txt thaidict.brk
packagedata: build/icudata.lst $(top_builddir)/tools/pkgdata/icupkg.inc
( cd build ; $(INVOKE) $(PKGDATA) -s . -T . -p $(ICUDATA_NAME) icudata.lst )
UnicodeData-$(UNICODE_VERSION).txt: $(top_srcdir)/../data/UnicodeData-$(UNICODE_VERSION).txt
$(RMV) $@ && ln -s $< $@
touch .links
packagetest: $(TESTDATAOBJDIR)/testdata.lst $(top_builddir)/tools/pkgdata/icupkg.inc
( cd $(TESTDATAOBJDIR) ; $(INVOKE) $(PKGDATA) -T . -s . -p testdata testdata.lst )
thaidict.brk: $(top_srcdir)/../data/thaidict.brk
$(RMV) $@ && ln -s $< $@
$(RMV) unidata && ln -s $(top_srcdir)/../data/unidata .
touch .links
cleanpackage:
@echo Cleaning up packaged data..
@-( cd build ; $(INVOKE) $(PKGDATA) -s . -T . -p $(ICUDATA_NAME) icudata.lst --clean 2> /dev/null)
@-( cd $(TESTDATAOBJDIR) ; $(INVOKE) $(PKGDATA) -T . -s . -p testdata testdata.lst --clean 2> /dev/null )
$(RMV) $(ICUDATA_NAME).* build/icudata.lst build/*.mak
## Install ICU data. Make a convenience link 'icudata' library if it's a library mode.
install: build/icudata.lst $(top_builddir)/tools/pkgdata/icupkg.inc
$(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(ICUDATA_DIR)/$(VERSION)
( cd build ; $(INVOKE) $(PKGDATA) -T . -s . -p $(ICUDATA_NAME) icudata.lst -I $(DESTDIR)$(ICUDATA_DIR)/$(VERSION) )
ifeq ($(strip $(PKGDATA_MODE)),dll)
(cd $(DESTDIR)$(ICUDATA_DIR)/$(VERSION); $(RM) icudata.$(SO) && ln -s $(ICUDATA_NAME).$(SO) icudata.$(SO))
endif
# specials
testdata: $(SPECIALTESTDATA)
%.cnv: build/%.cnv
ln -sf $< .

11
icu4c/source/data/README Normal file
View File

@ -0,0 +1,11 @@
== Copyright (c) 2000 IBM, Inc. All rights reserved. ==
This directory contains the intermediate, generated ICU data. For example,
.res, .cnv, and some .dat files end up here.
It is also used as a temporary directory by some ICU tools build processes.
You should NOT set your ICU_DATA directory to point here. Instead,
point it to ".." (that is, icu/source/data).

View File

@ -0,0 +1,200 @@
## Makefile.in for ICU data/build
## Copyright (c) 1999-2000, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../..
include $(top_builddir)/icudefs.mk
include @platform_make_fragment@
## Build directory information
subdir = data/build
# OBJDATADIR must be a short path (with ..'s) to the data.
SRCDATADIR=$(top_srcdir)/../data
UNICODEDATADIR=$(SRCDATADIR)/unidata
TESTSRCDATADIR=$(top_srcdir)/test/testdata
TESTOBJDATADIR=$(top_builddir)/test/testdata
SRCLISTDEPS=Makefile Makefile.in $(SRCDATADIR)/resfiles.mk $(SRCDATADIR)/ucmfiles.mk
OBJDATADIR=.
CURDIR=$(shell /bin/pwd)
# relative lib links from pkgdata are the same as for tmp
INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir)/common:$(top_builddir)/i18n:$(top_builddir)/tools/toolutil:$(top_builddir)/extra/ustdio:$$$(LDLIBRARYPATH_ENVVAR)
TOOLDIR=$(top_builddir)/tools
## List of phony targets
.PHONY : all all-local all-recursive install install-local install-files install-dlls build-cmnfile build-dll \
install-recursive clean clean-local clean-recursive distclean \
distclean-local distclean-recursive dist dist-local dist-recursive \
check check-local check-recursive build-testdlls build-basetestdata build-local
## Clear suffix list
.SUFFIXES :
## List of standard targets
all: all-local
install:
clean: clean-local
distclean : distclean
dist:
check: all
all-local: thaidict.brk build-local
##### Define all the data files. the build rule that depends on them is below.
## DAT files - Misc. data files.
DAT_FILES=uprops.dat unames.dat cnvalias.dat tz.dat
TEST_DAT_FILES=$(TESTOBJDATADIR)/test.dat
## BRK files
# ALL of these files can be deleted (the following BRK files) - they are copied
BRK_FILES=char.brk line.brk line_th.brk sent.brk word.brk word_th.brk
# don't include thaidict.brk - it goes into a resource bundle - plus it isn't deleted
## UCM files
include $(SRCDATADIR)/ucmfiles.mk
-include $(SRCDATADIR)/ucmlocal.mk
ALL_UCM_SOURCE= $(UCM_SOURCE) $(UCM_SOURCE_LOCAL)
UCM_FILES = $(ALL_UCM_SOURCE:%=$(SRCDATADIR)/%)
CNV_FILES = $(ALL_UCM_SOURCE:%.ucm=%.cnv)
TEST_UCM_SOURCE= test1.ucm test3.ucm test4.ucm
TEST_UCM_FILES=$(TEST_UCM_SOURCE:%=$(TESTSRCDATADIR)/data/%)
TEST_CNV_FILES=$(TEST_UCM_SOURCE:%.ucm=%.cnv)
## RES files
include $(SRCDATADIR)/resfiles.mk
-include $(SRCDATADIR)/reslocal.mk
ALL_RES_SOURCE= $(GENRB_SOURCE) $(TRANSLIT_SOURCE) $(RESOURCE_SRC) $(GENRB_SOURCE_LOCAL)
RES_SRC_FILES = $(ALL_RES_SOURCE:%=$(SRCDATADIR)/%)
RES_FILES = $(ALL_RES_SOURCE:%.txt=%.res)
TEST_RES = root.txt te.txt te_IN.txt testtypes.txt
TEST_RES_SRC_FILES=$(ALL_TEST_RES_SOURCE:%=$(TESTSRCDATADIR)/%)
TEST_RES_FILES=$(TEST_RES:%.txt=$(TESTOBJDATADIR)/%.res)
## All generated files
ALL_FILES = $(DAT_FILES) $(BRK_FILES) $(CNV_FILES) $(RES_FILES)
ALL_TEST_FILES = $(TEST_DAT_FILES) $(TEST_BRK_FILES) $(TEST_CNV_FILES) $(TEST_RES_FILES)
#####################################################
# General data build rules
## Files to remove for 'make clean'
CLEANFILES = *~ $(ALL_FILES) $(ALL_TEST_FILES)
icudata.lst: $(SRCLISTDEPS)
@echo Generating $@ list of data files
@-$(RMV) $@
@for file in $(ALL_FILES); do \
echo $$file >> $@; \
done;
$(TESTOBJDATADIR)/testdata.lst: $(SRCLISTDEPS)
@echo Generating $@ list of data files
@-$(RMV) $@
@for file in $(TEST_RES_FILES) $(TEST_DAT_FILES); do \
echo $$file >> $@; \
done;
build-local: build-data build-testdata
build-data: $(ALL_FILES) icudata.lst
@echo "ICU data files are up to date."
clean-local:
@echo '#' removing built files: .brk .dat .cnv .res ...
@$(RMV) $(CLEANFILES) thaidict.brk
@echo Cleaning up..
#$(ALL_TEST_FILES)
build-testdata: $(ALL_TEST_FILES) $(TESTOBJDATADIR)/testdata.lst
@echo "ICU test data files are up to date."
# Now, sections for building each kind of data.
#################################################### DAT
# DAT FILES
# uprops.dat
uprops.dat: $(UNICODEDATADIR)/UnicodeData.txt $(UNICODEDATADIR)/Mirror.txt $(TOOLDIR)/genprops/genprops
@echo Creating uprops.dat
@ICU_DATA=. $(INVOKE) $(TOOLDIR)/genprops/genprops -s $(UNICODEDATADIR) -d . -u $(UNICODE_VERSION)
# unames.dat
unames.dat: $(UNICODEDATADIR)/UnicodeData.txt $(TOOLDIR)/gennames/gennames
@echo Creating unames.dat
@ICU_DATA=. $(INVOKE) $(TOOLDIR)/gennames/gennames -d . $(UNICODEDATADIR)/UnicodeData.txt -u $(UNICODE_VERSION)
# cnvalias.dat
cnvalias.dat: $(SRCDATADIR)/convrtrs.txt $(TOOLDIR)/gencnval/gencnval
@echo Creating $@
@ICU_DATA=. $(INVOKE) $(TOOLDIR)/gencnval/gencnval -d . $(SRCDATADIR)/convrtrs.txt
# tz.dat
tz.dat: $(SRCDATADIR)/timezone.txt $(TOOLDIR)/gentz/gentz
@echo Creating $@
@ICU_DATA=. $(INVOKE) $(TOOLDIR)/gentz/gentz -d . $(SRCDATADIR)/timezone.txt
# test.dat
$(TESTOBJDATADIR)/test.dat: $(TOOLDIR)/gentest/gentest
@echo Creating $@
@ICU_DATA=. $(INVOKE) $(TOOLDIR)/gentest/gentest -d $(TESTOBJDATADIR)
#################################################### BRK
# BRK FILES
thaidict.brk: $(SRCDATADIR)/thaidict.brk
@echo $@
@$(RMV) $@ && ln -s $< $@
# copy the right endianness
ifeq (@U_IS_BIG_ENDIAN@,1)
%.brk: $(SRCDATADIR)/%BE.brk
cp $< $@
else
%.brk: $(SRCDATADIR)/%LE.brk
cp $< $@
endif
#################################################### CNV
# CNV FILES
%.cnv: $(SRCDATADIR)/%.ucm $(TOOLDIR)/makeconv/makeconv
@ICU_DATA=. $(INVOKE) $(TOOLDIR)/makeconv/makeconv -c -d . $(SRCDATADIR)/$(<F)
%.cnv: $(TESTSRCDATADIR)/%.ucm $(TOOLDIR)/makeconv/makeconv
@ICU_DATA=. $(INVOKE) $(TOOLDIR)/makeconv/makeconv -c -d . $(TESTSRCDATADIR)/$(<F)
#################################################### RES
# RES FILES
$(TESTOBJDATADIR)/%.res: $(TESTSRCDATADIR)/%.txt $(TOOLDIR)/genrb/genrb
@ICU_DATA=. $(INVOKE) $(TOOLDIR)/genrb/genrb -s $(TESTSRCDATADIR) -d $(TESTOBJDATADIR) $(<F)
%.res: $(SRCDATADIR)/%.txt $(TOOLDIR)/genrb/genrb
@ICU_DATA=. $(INVOKE) $(TOOLDIR)/genrb/genrb -s $(SRCDATADIR) -d . $(<F)
###################################################################
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status

View File

@ -0,0 +1,11 @@
== Copyright (c) 2000 IBM, Inc. All rights reserved. ==
This directory contains the intermediate, generated ICU data. For example,
.res, .cnv, and some .dat files end up here.
It is also used as a temporary directory by some ICU tools build processes.
You should NOT set your ICU_DATA directory to point here. Instead,
point it to ".." (that is, icu/source/data).