+
+.PHONY : icu check installsrc installhdrs installhdrsint clean install debug debug-install \
+crossbuildhost icutztoolsforsdk
+.DELETE_ON_ERROR :
+
+# Rule for adjusting sources for different train types.
+# Assumes current directory is icuSources to be patched.
+# This may be:
+# $(SRCROOT)/icuSources for installsrc, or
+# $(OBJROOT_CURRENT) if sources are copied for e.g. a local make.
+#
+# The various patchconfig files should assume the current directory is icuSources.
+#
+# Note that if sources have been installed by installsrc (only run as part of buildit
+# or B&I builds), then
+# $(SRCROOT)/.git is not present, and
+# ADJUST_SOURCES has already have been run.
+# Otherwise, if we are doing a local build (e.g. make check, make install), then
+# $(SRCROOT)/.git is present, and
+# ADJUST_SOURCES has not been run (run it after copying sources to OBJROOT_CURRENT)
+#
+
+ADJUST_SOURCES = \
+ if test "$(ICU_FOR_EMBEDDED_TRAINS)" = "YES"; then \
+ patch -p1 <$(SRCROOT)/minimalpatchconfig.txt; \
+ elif test "$(WINDOWS)" = "YES"; then \
+ patch -p1 <$(SRCROOT)/windowspatchconfig.txt; \
+ else \
+ patch -p1 <$(SRCROOT)/patchconfig.txt; \
+ fi; \
+ if test "$(WINDOWS)" = "YES"; then \
+ mv data/unidata/base_unidata/*.txt data/unidata/; \
+ mv data/unidata/norm2/base_norm2/*.txt data/unidata/norm2/; \
+ mv data/in/base_in/*.nrm data/in/; \
+ mv data/in/base_in/*.icu data/in/; \
+ elif test "$(LINUX)" = "YES"; then \
+ mv data/unidata/base_unidata/*.txt data/unidata/; \
+ mv data/unidata/norm2/base_norm2/*.txt data/unidata/norm2/; \
+ mv data/in/base_in/*.nrm data/in/; \
+ mv data/in/base_in/*.icu data/in/; \
+ fi
+
+
+icu debug profile : $(OBJROOT_CURRENT)/Makefile
+ echo "# make for target";
+ (cd $(OBJROOT_CURRENT); \
+ $(MAKE) $($(ENV_$@)); \
+ if test "$(WINDOWS)" = "YES"; then \
+ (cd common; \
+ rc.exe /folibicuuc.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
+ "-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 libicuuc.rc; \
+ ); \
+ (cd i18n; \
+ rc.exe /folibicuin.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common libicuin.rc; \
+ ); \
+ if test "$@" = "debug"; then \
+ (cd common; \
+ LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a800000" /DYNAMICBASE /DEBUG \
+ /IMPLIB:../lib/libicuuc_$@.lib /out:../lib/libicuuc_$@.dll \
+ *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
+ ); \
+ (cd i18n; \
+ LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a900000" /DYNAMICBASE /DEBUG \
+ /IMPLIB:../lib/libicuin_$@.lib /out:../lib/libicuin_$@.dll \
+ *.o libicuin.res ../lib/libicuuc_$@.lib ../stubdata/icudt.lib advapi32.lib; \
+ ); \
+ else \
+ (cd common; \
+ rm -f ../lib/libicuuc.dll.manifest; \
+ if test "$(ARCH64)" = "YES"; then \
+ LINK.EXE /DLL /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
+ /IMPLIB:../lib/libicuuc.lib /out:../lib/libicuuc.dll \
+ *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
+ else \
+ LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
+ /IMPLIB:../lib/libicuuc.lib /out:../lib/libicuuc.dll \
+ *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
+ fi; \
+ mt.exe -nologo -manifest ../lib/libicuuc.dll.manifest -outputresource:"../lib/libicuuc.dll;2"; \
+ ); \
+ (cd i18n; \
+ rm -f ../lib/libicuin.dll.manifest; \
+ if test "$(ARCH64)" = "YES"; then \
+ LINK.EXE /DLL /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
+ /IMPLIB:../lib/libicuin.lib /out:../lib/libicuin.dll \
+ *.o libicuin.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
+ else \
+ LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
+ /IMPLIB:../lib/libicuin.lib /out:../lib/libicuin.dll \
+ *.o libicuin.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
+ fi; \
+ mt.exe -nologo -manifest ../lib/libicuin.dll.manifest -outputresource:"../lib/libicuin.dll;2"; \
+ ); \
+ if test "$(ARCH64)" != "YES"; then \
+ mkdir -p lib/shim; \
+ (cd common; \
+ rm -f icuuc40shim.o; \
+ rm -f ../lib/icuuc40.dll.manifest; \
+ cl -DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) \
+ -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
+ -DU_LOCAL_SERVICE_HOOK=1 -DWIN32 -DU_COMMON_IMPLEMENTATION \
+ /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t \
+ /c /Foicuuc40shim.o icuuc40shim.cpp; \
+ rc.exe /foicuuc40shim.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
+ "-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 icuuc40shim.rc; \
+ LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
+ /IMPLIB:../lib/shim/icuuc.lib /out:../lib/icuuc40.dll \
+ icuuc40shim.o icuuc40shim.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
+ mt.exe -nologo -manifest ../lib/icuuc40.dll.manifest -outputresource:"../lib/icuuc40.dll;2"; \
+ ); \
+ (cd i18n; \
+ rm -f icuin40shim.o; \
+ rm -f ../lib/icuin40.dll.manifest; \
+ cl -DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) \
+ -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common \
+ -DU_LOCAL_SERVICE_HOOK=1 -DWIN32 -DU_I18N_IMPLEMENTATION \
+ /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t \
+ /c /Foicuin40shim.o icuin40shim.cpp; \
+ rc.exe /foicuin40shim.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common \
+ "-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 icuin40shim.rc; \
+ LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
+ /IMPLIB:../lib/shim/icuin.lib /out:../lib/icuin40.dll \
+ icuin40shim.o icuin40shim.res ../lib/libicuin.lib ../stubdata/icudt.lib advapi32.lib; \
+ mt.exe -nologo -manifest ../lib/icuin40.dll.manifest -outputresource:"../lib/icuin40.dll;2"; \
+ ); \
+ fi; \
+ fi; \
+ else \
+ if test "$(LINUX)" = "YES"; then \
+ if test "$(ARCH64)" = "YES"; then \
+ $($(ENV_$@)) $(CXX) \
+ -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden \
+ $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname,$($(INSTALLED_DYLIB_$@)) -Wl,-L/usr/lib64/ -ldl \
+ -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
+ else \
+ $($(ENV_$@)) $(CXX) \
+ -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden \
+ $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname,$($(INSTALLED_DYLIB_$@)) -ldl \
+ -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
+ fi; \
+ else \
+ tmpfile=`mktemp -t weakexternal.XXXXXX` || exit 1; \
+ $(NM) -m $(RC_ARCHS:%=-arch %) $(DYLIB_OBJS) | fgrep "weak external" | fgrep -v "undefined" | sed -e 's/.*weak external[^_]*//' | sort | uniq | cat >$$tmpfile; \
+ $($(ENV_$@)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
+ $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
+ $(CXXFLAGS) $(LDFLAGS) -single_module $(SECTORDER_FLAGS) -unexported_symbols_list $$tmpfile -dead_strip \
+ -install_name $(libdir)$($(INSTALLED_DYLIB_$@)) -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
+ if test "$@" = "icu"; then \
+ ln -fs $(INSTALLED_DYLIB) $(DYLIB); \
+ echo '# build' $(INFOTOOL) 'linked against' $(LIB_NAME) ; \
+ $($(ENV_$@)) $(CXX) $(RC_ARCHS:%=-arch %) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
+ $(LDFLAGS) -dead_strip -o ./$(INFOTOOL) $(INFOTOOL_OBJS) -L./ -l$(LIB_NAME) ; \
+ echo '# build' $(TOOLS_DYLIB) 'linked against' $(LIB_NAME) ; \
+ $($(ENV_$@)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
+ $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
+ $(CXXFLAGS) $(LDFLAGS) -single_module \
+ -install_name $(locallibdir)$(TOOLS_DYLIB) -o ./$(TOOLS_DYLIB) $(TOOLS_DYLIB_OBJS) -L./ -l$(LIB_NAME) ; \
+ echo '# build' $(ICUZDUMPTOOL) 'linked against' $(TOOLSLIB_NAME) $(LIB_NAME) ; \
+ $($(ENV_$@)) $(LINK.cc) $(RC_ARCHS:%=-arch %) -g -Os $(ISYSROOT) $(THUMB_FLAG) --std=c++0x \
+ -dead_strip -o ./$(ICUZDUMPTOOL) $(ICUZDUMPTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME) -l$(LIB_NAME); \
+ fi; \
+ fi; \
+ if test -f ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE); then \
+ ln -fs ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE); \
+ fi; \
+ if test -f ./$(DATA_BUILD_SUBDIR)/$(L_DATA_FILE); then \
+ ln -fs ./$(DATA_BUILD_SUBDIR)/$(L_DATA_FILE); \
+ else \
+ DYLD_LIBRARY_PATH=$(ICUPKGTOOLIBS) \
+ $(ICUPKGTOOL) -tl ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE) $(L_DATA_FILE); \
+ fi; \
+ printf $(TZDATA_FORMAT_STRING) > $(TZDATA_FORMAT_FILE); \
+ fi; \
+ );
+
+crossbuildhost : $(CROSSHOST_OBJROOT)/Makefile
+ echo "# make for crossbuild host";
+ (cd $(CROSSHOST_OBJROOT); \
+ $(MAKE) $($(ENV_BUILDHOST)); \
+ );
+
+# For the install-icutztoolsforsdk target, SDKROOT will always be an OSX SDK root.
+# we need to patch using crosshostpatchconfig.txt as for $(CROSSHOST_OBJROOT)/Makefile
+icutztoolsforsdk : $(OBJROOT_CURRENT)/Makefile
+ echo "# make icutztoolsforsdk";
+ (cd $(OBJROOT_CURRENT); \
+ if test ! -d $(SRCROOT)/.git ; then patch -p1 <$(SRCROOT)/crosshostpatchconfig.txt; fi; \
+ $(MAKE) $($(ENV)); \
+ echo '# build' $(TOOLS_DYLIB) 'linked against' $(LIB_NAME) ; \
+ $($(ENV)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
+ -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) \
+ $(CXXFLAGS) $(LDFLAGS) -single_module \
+ -install_name $(locallibdir)$(TOOLS_DYLIB) -o ./$(TOOLS_DYLIB) $(TOOLS_DYLIB_OBJS_FORSDK) -L./ -l$(LIB_NAME) ; \
+ echo '# build' $(ZICTOOL) 'linked against' $(TOOLSLIB_NAME) ; \
+ $($(ENV_BUILDHOST)) $(CXX) -g -Os -isysroot $(HOSTSDKPATH) \
+ $(LDFLAGS) -dead_strip -o ./$(ZICTOOL) $(ZICTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME) ; \
+ echo '# build' $(RESTOOL) 'linked against' $(TOOLSLIB_NAME) $(LIB_NAME) ; \
+ $($(ENV_BUILDHOST)) $(CXX) -g -Os -isysroot $(HOSTSDKPATH) \
+ $(LDFLAGS) -dead_strip -o ./$(RESTOOL) $(RESTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME) -l$(LIB_NAME) ; \
+ echo '# build' $(PKGTOOL) 'linked against' $(TOOLSLIB_NAME) ; \
+ $($(ENV_BUILDHOST)) $(CXX) -g -Os -isysroot $(HOSTSDKPATH) \
+ $(LDFLAGS) -dead_strip -o ./$(PKGTOOL) $(PKGTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME) ; \
+ echo '# build' $(TZ2ICUTOOL) 'linked against' $(TOOLSLIB_NAME) ; \
+ $($(ENV_BUILDHOST)) $(CXX) -g -Os -isysroot $(HOSTSDKPATH) \
+ $(LDFLAGS) -dead_strip -o ./$(TZ2ICUTOOL) $(TZ2ICUTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME) ; \
+ );
+
+check : icu
+ifneq "$(CROSS_BUILD)" "YES"
+ (cd $(OBJROOT_CURRENT); \
+ ICU_DATA=$(OBJROOT_CURRENT) $(MAKE) $(ENV) check; \
+ );
+else
+ $(warning check not supported for cross-build)
+endif
+
+check-debug: debug
+ifneq "$(CROSS_BUILD)" "YES"
+ (cd $(OBJROOT_CURRENT); \
+ ICU_DATA=$(OBJROOT_CURRENT) $(MAKE) $(ENV_DEBUG) check; \
+ );
+else
+ $(warning check not supported for cross-build)
+endif
+
+samples: icu
+ (cd $(OBJROOT_CURRENT)/samples; \
+ $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
+ );
+
+extra: icu
+ (cd $(OBJROOT_CURRENT)/extra; \
+ $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
+ );
+
+ifneq "$(CROSS_BUILD)" "YES"
+$(OBJROOT_CURRENT)/Makefile :
+else
+$(OBJROOT_CURRENT)/Makefile : crossbuildhost
+endif
+ if test ! -d $(OBJROOT_CURRENT); then \
+ mkdir -p $(OBJROOT_CURRENT); \
+ fi;
+ cp -Rpf $(SRCROOT)/icuSources/* $(OBJROOT_CURRENT)/;
+ (cd $(OBJROOT_CURRENT); \
+ if test -d $(SRCROOT)/.git ; then $(ADJUST_SOURCES); fi; \
+ if test "$(WINDOWS)" = "YES"; then \
+ echo "# configure for target"; \
+ $(ENV_CONFIGURE) ./runConfigureICU Cygwin/MSVC $(CONFIG_FLAGS); \
+ elif test "$(LINUX)" = "YES"; then \
+ echo "# configure for target"; \
+ $(ENV_CONFIGURE) ./runConfigureICU Linux $(CONFIG_FLAGS); \
+ elif test "$(CROSS_BUILD)" = "YES"; then \
+ echo "# configure for crossbuild target"; \
+ $(ENV_CONFIGURE) ./configure --host=$(TARGET_SPEC) --with-cross-build=$(CROSSHOST_OBJROOT) $(CONFIG_FLAGS); \
+ else \
+ echo "# configure for non-crossbuild target"; \
+ $(ENV_CONFIGURE) ./runConfigureICU MacOSX $(CONFIG_FLAGS); \
+ fi; \
+ );
+
+# for the tools that build the data file, cannot set UDATA_DEFAULT_ACCESS = UDATA_ONLY_PACKAGES
+# as minimalpatchconfig.txt does; need different patches for the host build. Thus
+# we have to use crosshostpatchconfig.txt to undo the udata.h changes that would have
+# been made for ICU_FOR_EMBEDDED_TRAINS builds.
+$(CROSSHOST_OBJROOT)/Makefile :
+ if test ! -d $(CROSSHOST_OBJROOT); then \
+ mkdir -p $(CROSSHOST_OBJROOT); \
+ fi;
+ cp -Rpf $(SRCROOT)/icuSources/* $(CROSSHOST_OBJROOT);
+ (cd $(CROSSHOST_OBJROOT); \
+ if test -d $(SRCROOT)/.git; then $(ADJUST_SOURCES); fi; \
+ if test "$(ICU_FOR_EMBEDDED_TRAINS)" = "YES"; then \
+ patch -p1 <$(SRCROOT)/crosshostpatchconfig.txt; \
+ fi; \
+ echo "# configure for crossbuild host"; \
+ $(ENV_CONFIGURE_BUILDHOST) ./runConfigureICU MacOSX $(CONFIG_FLAGS); \
+ );
+
+#################################
+# B&I TARGETS
+#################################
+
+# Since our sources are in icuSources (ignore the ICU subdirectory for now), we wish to