Makefile.in (12762B)
1 ## Makefile.in for ICU data 2 ## Copyright (C) 2016 and later: Unicode, Inc. and others. 3 ## License & terms of use: http://www.unicode.org/copyright.html 4 ## Copyright (c) 1999-2015, International Business Machines Corporation and 5 ## others. All Rights Reserved. 6 7 ## Source directory information 8 srcdir = @srcdir@ 9 top_srcdir = @top_srcdir@ 10 11 # So that you have $(top_builddir)/config.status 12 top_builddir = .. 13 14 ## All the flags and other definitions are included here. 15 include $(top_builddir)/icudefs.mk 16 17 ## Build directory information 18 # So that $(top_builddir)/$(subdir) ~= "here" 19 subdir = data 20 21 #lib icu data for link 22 LIB_ICUDATA_NAME=$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX) 23 LIB_STATIC_ICUDATA_NAME=$(LIBSICU)$(DATA_STUBNAME)$(ICULIBSUFFIX) 24 25 # Allow Windows to override these options 26 ifeq ($(PKGDATA_OPTS),) 27 PKGDATA_OPTS = -O $(top_builddir)/data/icupkg.inc 28 endif 29 ifeq ($(PKGDATA_VERSIONING),) 30 PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION) 31 endif 32 33 # This allows all the data to be in one directory 34 ifeq ($(PKGDATA_MODE),dll) 35 ICUPKGDATA_OUTDIR = $(LIBDIR) 36 else 37 ifeq ($(PKGDATA_MODE),static) 38 ICUPKGDATA_OUTDIR = $(LIBDIR) 39 else 40 ICUPKGDATA_OUTDIR = $(OUTDIR) 41 endif 42 endif 43 44 CURDIR:=$(CURR_FULL_DIR) 45 # current directory should not be blank 46 ifeq ($(CURDIR),) 47 CURDIR=. 48 endif 49 ifeq ($(BUILD_HOST_ICU),OS390) 50 PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -z -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR) 51 else 52 PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR) 53 endif 54 55 # OBJDATADIR must be a short path (with ..'s) to the data. 56 57 ifeq ($(top_srcdir),..) 58 SRCDATADIR=. 59 else 60 SRCDATADIR=$(top_srcdir)/data 61 endif 62 ifeq ($(top_builddir),..) 63 OUTDIR=./out 64 else 65 OUTDIR=$(top_builddir)/data/out 66 endif 67 68 OUTTMPDIR=$(OUTDIR)/tmp 69 MAINBUILDDIR=$(OUTDIR)/build 70 BUILDDIR=$(MAINBUILDDIR)/$(ICUDATA_PLATFORM_NAME) 71 MISCSRCDIR=$(SRCDATADIR)/misc 72 SRCLISTDEPS=Makefile $(srcdir)/Makefile.in 73 74 # Variable names for rules.mk 75 OUT_DIR=$(BUILDDIR) 76 TMP_DIR=$(OUTTMPDIR) 77 78 # relative lib links from pkgdata are the same as for tmp 79 TOOLDIR=$(top_builddir)/tools 80 81 ## List of phony targets 82 .PHONY : all all-local all-recursive install install-local install-files \ 83 install-recursive clean clean-local clean-recursive distclean \ 84 distclean-local distclean-recursive dist dist-local dist-recursive \ 85 check check-local check-recursive clean-resindex icudata.jar \ 86 check-exhaustive 87 88 ## Clear suffix list 89 .SUFFIXES : 90 91 ## List of standard targets 92 all: all-local 93 install: all-local install-local 94 clean: clean-local 95 distclean : distclean-local 96 dist: 97 check: all check-local 98 99 check-exhaustive: check 100 101 -include Makefile.local 102 103 104 distclean-local: clean 105 $(RMV) Makefile 106 107 all-local: icupkg.inc build-local packagedata $(POST_DATA_BUILD) 108 109 dist-local: 110 111 clean-map: 112 -test -z *.map || $(RMV) *.map 113 114 clean-local: cleanpackage cleanfiles clean-map 115 $(RMV) $(OUTDIR) build-local packagedata uni-core-data 116 117 cleanfiles: 118 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) 119 120 cleanpackage: 121 $(RMV) $(OUTDIR) 122 $(RMV) $(LIBDIR)/*$(LIB_ICUDATA_NAME)*.$(SO)* $(LIBDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) 123 124 check-local: 125 PYTHONPATH=$(top_srcdir)/python @PYTHON@ -m icutools.databuilder.test 126 127 # Find out if we have a source archive. 128 # If we have that, then use that instead of building everything from scratch. 129 ICUDATA_SOURCE_ARCHIVE = $(wildcard $(srcdir)/in/$(ICUDATA_PLATFORM_NAME).dat) 130 ifeq ($(ICUDATA_SOURCE_ARCHIVE),) 131 ICUDATA_ARCHIVE = $(firstword $(wildcard $(srcdir)/in/$(ICUDATA_BASENAME_VERSION)*.dat)) 132 # We don't have the data in the current endianness or charset. 133 # See if we can find data of any archive type, 134 # and convert it to the current type. 135 ifneq ($(ICUDATA_ARCHIVE),) 136 ICUDATA_SOURCE_ARCHIVE = $(OUTDIR)/$(ICUDATA_PLATFORM_NAME).dat 137 $(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) 138 $(MKINSTALLDIRS) $(OUTDIR) 139 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(ICUDATA_ARCHIVE) $(ICUDATA_SOURCE_ARCHIVE) 140 141 $(OUTDIR): 142 mkdir -p $(OUTDIR) 143 144 endif 145 else 146 ifneq ($(ENABLE_STATIC),YES) 147 ifeq ($(PKGDATA_MODE),common) 148 # We have a source data common archive in the native endianness, 149 # and it's what we want to build. Try to not run any of ICU's tools. 150 ICUDATA_SOURCE_IS_NATIVE_TARGET=YES 151 endif 152 endif 153 endif 154 155 packagedata: icupkg.inc $(PKGDATA_LIST) build-local 156 ifneq ($(ENABLE_STATIC),) 157 ifeq ($(PKGDATA_MODE),dll) 158 $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) -m static $(PKGDATA_VERSIONING) $(PKGDATA_LIST) 159 endif 160 endif 161 ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) 162 $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) 163 else 164 $(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(OUTDIR) 165 endif 166 echo timestamp > $@ 167 168 ## Install ICU data. 169 install-local: $(PKGDATA_LIST) ./icupkg.inc packagedata 170 $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(ICUPKGDATA_DIR) 171 ifeq ($(PKGDATA_MODE),files) 172 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME) 173 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(CURR_TREE) 174 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(LANG_TREE) 175 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(REGION_TREE) 176 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(ZONE_TREE) 177 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(UNIT_TREE) 178 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(BREAK_TREE) 179 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(COLLATION_TREE) 180 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(RBNF_TREE) 181 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(TRANSLIT_TREE) 182 endif 183 ifneq ($(ENABLE_STATIC),) 184 ifeq ($(PKGDATA_MODE),dll) 185 # For MinGW, do we want the DLL to go in the bin location? 186 ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) 187 $(PKGDATA_INVOKE) $(PKGDATA) -m static -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) 188 else 189 $(PKGDATA_INVOKE) $(PKGDATA) -m static -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_LIBDIR) 190 endif 191 endif 192 endif 193 ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) 194 # For MinGW, do we want the DLL to go in the bin location? 195 ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) 196 $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) 197 else 198 $(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) 199 endif 200 else 201 $(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(DESTDIR)$(ICUPKGDATA_DIR) 202 endif 203 204 205 ## Include the main build rules for data files 206 include $(top_builddir)/$(subdir)/rules.mk 207 208 209 ifeq ($(ENABLE_SO_VERSION_DATA),1) 210 ifeq ($(PKGDATA_MODE),dll) 211 SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res 212 $(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc | $(TMP_DIR)/dirs.timestamp 213 ifeq ($(MSYS_RC_MODE),1) 214 rc.exe -i$(srcdir)/../common -i$(top_builddir)/common -fo$@ $(CPPFLAGS) $< 215 else 216 rc.exe /i$(srcdir)/../common /i$(top_builddir)/common /fo$@ $(CPPFLAGS) $(SOURCE_FILE) 217 endif 218 endif 219 endif 220 221 PKGDATA_LIST = $(TMP_DIR)/icudata.lst 222 223 224 ##################################################### 225 # General data build rules 226 227 ## Files to remove for 'make clean' 228 CLEANFILES = *~ icupkg.inc *.x 229 230 ifeq ($(ICUDATA_SOURCE_ARCHIVE),) 231 build-local: $(SO_VERSION_DATA) $(ICUDATA_ALL_OUTPUT_FILES) $(PKGDATA_LIST) 232 echo timestamp > $@ 233 else 234 build-local: $(SO_VERSION_DATA) $(PKGDATA_LIST) 235 echo timestamp > $@ 236 $(PKGDATA_LIST): $(SRCLISTDEPS) $(ICUDATA_SOURCE_ARCHIVE) 237 ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) 238 $(MKINSTALLDIRS) $(OUTTMPDIR) $(BUILDDIR) 239 @echo "Unpacking $(ICUDATA_SOURCE_ARCHIVE) and generating $@ (list of data files)" 240 @-$(RMV) $@ 241 $(INVOKE) $(TOOLBINDIR)/icupkg -d $(BUILDDIR) --list -x \* $(ICUDATA_SOURCE_ARCHIVE) -o $@ 242 else 243 @echo "$@" > $@ 244 endif 245 endif 246 247 248 # if the tzcode directory contains a new tzdata*.tar.gz file, use it for zoneinfo 249 ifeq ($(TZDATA),) 250 TZDATA = $(firstword $(wildcard $(top_builddir)/tools/tzcode/tzdata*.tar.gz) $(wildcard $(top_srcdir)/tools/tzcode/tzdata*.tar.gz)) 251 endif 252 253 # TODO(ICU-20466): Make the TZDATA override part of Python icutools.databuilder 254 ifneq ($(TZDATA),) 255 256 TZCODE_DIR=$(top_builddir)/tools/tzcode 257 ZONEINFO=$(TZCODE_DIR)/zoneinfo64.txt 258 259 # Override the normal genrb for zoneinfo to always pull from 260 # icu/source/tools/tzcode/zoneinfo64.txt 261 $(BUILDDIR)/zoneinfo64.res: $(ZONEINFO) $(TOOLBINDIR)/genrb$(TOOLEXEEXT) | $(BUILDDIR)/cnvalias.icu 262 @echo Note: $(MISCSRCDIR)/zoneinfo.txt is IGNORED because $(TZDATA) is present. 263 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -d $(BUILDDIR) $(ZONEINFO) 264 265 # Create the tzcode tool and zoneinfo as needed. 266 $(ZONEINFO): $(TZDATA) 267 @echo "$(MAKE)[$(MAKELEVEL)]: Making \`$(ZONEINFO)' in \`$(TZCODE_DIR)'"; \ 268 (cd $(TZCODE_DIR) && $(MAKE)) || exit; \ 269 270 # end of zoneinfo-generation 271 endif 272 273 # Build the ICU4J icudata.jar. 274 # Command line: 275 # (Run this from the output data folder which may not be .../source/data in an out-of-source build.) 276 # ~/svn.icu/trunk/source/data> make JAR=jar ICU4J_ROOT=~/svn.icu4j/trunk icudata.jar 277 # You can omit the ICU4J_ROOT for just building the .jar files without copying them. 278 # You can omit the JAR if it's just jar. 279 JAR=jar 280 281 # For building the testdata.jar see ../test/testdata/Makefile. 282 283 ICU4J_TZDATA=$(OUTDIR)/icu4j/icutzdata.jar 284 ICU4J_TZDATA_FILES=zoneinfo64 metaZones timezoneTypes windowsZones 285 ICU4J_DATA_DIRNAME=com/ibm/icu/impl/data/icudata 286 ICU4J_TZDATA_PATHS=$(ICU4J_TZDATA_FILES:%="$(ICU4J_DATA_DIRNAME)/%.res") 287 288 # generate icu4j-related data to $(OUTDIR)/icu4j/com/ibm/icu/impl/data/... 289 generate-data: packagedata $(OUTTMPDIR)/$(ICUDATA_PLATFORM_NAME).dat 290 mkdir -p $(OUTDIR)/icu4j/$(ICU4J_DATA_DIRNAME) 291 mkdir -p $(OUTDIR)/icu4j/tzdata/$(ICU4J_DATA_DIRNAME) 292 $(INVOKE) $(TOOLBINDIR)/icupkg $(OUTTMPDIR)/$(ICUDATA_PLATFORM_NAME).dat $(OUTDIR)/icu4j/$(ICUDATA_BASENAME_VERSION)b.dat -s $(BUILDDIR) -x '*' -tb -d $(OUTDIR)/icu4j/$(ICU4J_DATA_DIRNAME) 293 mv $(ICU4J_TZDATA_PATHS:%=$(OUTDIR)/icu4j/%) "$(OUTDIR)/icu4j/tzdata/$(ICU4J_DATA_DIRNAME)" 294 295 $(OUTDIR)/icu4j/icutzdata.jar: generate-data 296 $(JAR) cf $(OUTDIR)/icu4j/icutzdata.jar -C $(OUTDIR)/icu4j/tzdata $(ICU4J_DATA_DIRNAME)/ 297 298 # Build icudata.jar: 299 # - add the uni-core-data to the ICU package 300 # - swap the ICU data 301 # - extract all data items 302 # - package them into the .jar file 303 # TODO(ICU-20466): Move this to Python 304 # NOTE: If you get the error "No rule to make target 'out/build/icudt64l/uprops.icu'", 305 # you need to reconfigure with unicore data. See icu4j-readme.txt 306 $(OUTDIR)/icu4j/icudata.jar: generate-data | $(OUT_DIR)/uprops.icu 307 $(JAR) cf $(OUTDIR)/icu4j/icudata.jar -C $(OUTDIR)/icu4j $(ICU4J_DATA_DIRNAME)/ 308 309 ICU4J_DATA=$(OUTDIR)/icu4j/icudata.jar 310 311 ifdef ICU4J_ROOT 312 313 ICU4J_DATA_INSTALLED=$(ICU4J_ROOT)/main/shared/data/icudata.jar $(ICU4J_ROOT)/main/shared/data/icutzdata.jar 314 315 $(ICU4J_ROOT)/main/shared/data/icudata.jar: $(OUTDIR)/icu4j/icudata.jar 316 mkdir -p $(ICU4J_ROOT)/main/shared/data 317 cp $(OUTDIR)/icu4j/icudata.jar $(ICU4J_ROOT)/main/shared/data 318 319 $(ICU4J_ROOT)/main/shared/data/icutzdata.jar: $(OUTDIR)/icu4j/icutzdata.jar 320 mkdir -p $(ICU4J_ROOT)/main/shared/data 321 cp $(OUTDIR)/icu4j/icutzdata.jar $(ICU4J_ROOT)/main/shared/data 322 323 icu4j-data-install: $(ICU4J_DATA_INSTALLED) 324 325 else 326 327 icu4j-data-install: icu4j-data 328 @echo data is built into $(OUTDIR)/icu4j 329 @echo '** Error:' ICU4J_ROOT was not set, could not install 330 exit 1 331 332 endif 333 334 icu4j-data: $(ICU4J_DATA) $(ICU4J_TZDATA) 335 336 337 ################################################################### 338 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 339 cd $(top_builddir) \ 340 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status 341 342 icupkg.inc: pkgdataMakefile 343 $(MAKE) -f pkgdataMakefile 344 345 pkgdataMakefile: 346 cd $(top_builddir) \ 347 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status 348 349 ########### 350 ########### 390 (z/OS) support 351 UCMFILES390=ebcdic-xml-us.ucm ibm-37_P100-1995.ucm ibm-1047_P100-1995.ucm ibm-4909_P100-1999.ucm 352 # used to depend on pnames.icu uprops.icu ucase.icu ubidi.icu 353 # These are now hardcoded in ICU4C and only loaded in ICU4J. 354 ALLFILES390=cnvalias.icu $(UCMFILES390:.ucm=.cnv) 355 356 $(OUTTMPDIR)/icudata390.lst: $(SRCLISTDEPS) 357 @echo "generating $@ (list of 390 data files)" 358 @-$(RMV) $@ 359 @for file in $(ALLFILES390); do \ 360 echo $$file >> $@; \ 361 done; 362 363 ifeq ($(POST_DATA_BUILD), os400-data-rebind) 364 os400-data-rebind: $(LIBICUUC) 365 366 $(LIBICUUC): $(LIBICUDT) 367 $(RMV) $(LIBICUUC) 368 (cd ../common && $(MAKE) RECURSIVE=YES) || exit; 369 endif