+
+.PHONY : icu check installsrc installhdrs installhdrsint clean install debug debug-install crossbuildhost
+.DELETE_ON_ERROR :
+
+icu debug profile : $(OBJROOT)/Makefile
+ (cd $(OBJROOT); \
+ $(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 \
+ mkdir -p lib/shim; \
+ (cd common; \
+ rm -f icuuc40shim.o; \
+ rm -f ../lib/libicuuc.dll.manifest; \
+ rm -f ../lib/icuuc40.dll.manifest; \
+ LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF \
+ /IMPLIB:../lib/libicuuc.lib /out:../lib/libicuuc.dll \
+ *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
+ mt.exe -nologo -manifest ../lib/libicuuc.dll.manifest -outputresource:"../lib/libicuuc.dll;2"; \
+ 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 \
+ /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/libicuin.dll.manifest; \
+ rm -f ../lib/icuin40.dll.manifest; \
+ LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF \
+ /IMPLIB:../lib/libicuin.lib /out:../lib/libicuin.dll \
+ *.o libicuin.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
+ mt.exe -nologo -manifest ../lib/libicuin.dll.manifest -outputresource:"../lib/libicuin.dll;2"; \
+ 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 \
+ /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; \
+ 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 %) $(SET_MACOSX_MIN_VER) -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); \
+ $($(ENV_$@)) $(CXX) $(RC_ARCHS:%=-arch %) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
+ $(LDFLAGS) -Wl,-S -Wl,-x -dead_strip -o ./$(INFOTOOL) $(INFOTOOL_OBJS) -L./ -l$(LIB_NAME) ; \
+ fi; \
+ fi; \
+ if test -f ./$(ICU_DATA_DIR)/$(B_DATA_FILE); then \
+ ln -fs ./$(ICU_DATA_DIR)/$(B_DATA_FILE); \
+ fi; \
+ if test -f ./$(ICU_DATA_DIR)/$(L_DATA_FILE); then \
+ ln -fs ./$(ICU_DATA_DIR)/$(L_DATA_FILE); \
+ else \
+ DYLD_LIBRARY_PATH=$(ICUPKGTOOLIBS) \
+ $(ICUPKGTOOL) -tl ./$(ICU_DATA_DIR)/$(B_DATA_FILE) $(L_DATA_FILE); \
+ fi; \
+ fi; \
+ );
+
+crossbuildhost : $(CROSSHOST_OBJROOT)/Makefile
+ (cd $(CROSSHOST_OBJROOT); \
+ $(MAKE) $($(ENV_BUILDHOST)); \
+ );
+
+check : icu
+ifneq "$(CROSS_BUILD)" "YES"
+ (cd $(OBJROOT); \
+ ICU_DATA=$(OBJROOT) $(MAKE) $(ENV) check; \
+ );
+else
+ $(warning check not supported for cross-build)
+endif
+
+check-debug: debug
+ifneq "$(CROSS_BUILD)" "YES"
+ (cd $(OBJROOT); \
+ ICU_DATA=$(OBJROOT) $(MAKE) $(ENV_DEBUG) check; \
+ );
+else
+ $(warning check not supported for cross-build)
+endif
+
+samples: icu
+ (cd $(OBJROOT)/samples; \
+ $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
+ );
+
+extra: icu
+ (cd $(OBJROOT)/extra; \
+ $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
+ );
+
+ifneq "$(CROSS_BUILD)" "YES"
+$(OBJROOT)/Makefile :
+else
+$(OBJROOT)/Makefile : crossbuildhost
+endif
+ if test ! -d $(OBJROOT); then \
+ mkdir -p $(OBJROOT); \
+ fi;
+ if test "$(WINDOWS)" = "YES"; then \
+ cp -Rpf $(SRCROOT)/icuSources/* $(OBJROOT); \
+ (cd $(OBJROOT)/data/unidata; mv base_unidata/*.txt .;); \
+ (cd $(OBJROOT)/data/unidata/norm2; mv base_norm2/*.txt .;); \
+ (cd $(OBJROOT)/data/in; mv base_in/*.nrm .; mv base_in/*.icu .;); \
+ (cd $(OBJROOT); $(ENV_CONFIGURE) ./runConfigureICU Cygwin/MSVC $(CONFIG_FLAGS);) \
+ elif test "$(LINUX)" = "YES"; then \
+ cp -Rpf $(SRCROOT)/icuSources/* $(OBJROOT); \
+ (cd $(OBJROOT)/data/unidata; mv base_unidata/*.txt .;); \
+ (cd $(OBJROOT)/data/unidata/norm2; mv base_norm2/*.txt .;); \
+ (cd $(OBJROOT)/data/in; mv base_in/*.nrm .; mv base_in/*.icu .;); \
+ (cd $(OBJROOT); $(ENV_CONFIGURE) ./runConfigureICU Linux $(CONFIG_FLAGS);) \
+ elif test "$(CROSS_BUILD)" = "YES"; then \
+ (cd $(OBJROOT); $(ENV_CONFIGURE) $(SRCROOT)/icuSources/configure --host=$(TARGET_SPEC) --with-cross-build=$(CROSSHOST_OBJROOT) $(CONFIG_FLAGS);) \
+ else \
+ (cd $(OBJROOT); $(ENV_CONFIGURE) $(SRCROOT)/icuSources/runConfigureICU MacOSX $(CONFIG_FLAGS);) \
+ fi;
+ if test "$(APPLE_EMBEDDED)" = "YES"; then \
+ (cd $(OBJROOT)/common/unicode/; \
+ cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \
+ cp $(SRCROOT)/icuSources/common/unicode/udata.h . ; \
+ cp $(SRCROOT)/icuSources/common/unicode/utypes.h . ; \
+ patch <$(SRCROOT)/minimalpatchconfig.txt;) \
+ elif test "$(WINDOWS)" = "YES"; then \
+ (cd $(OBJROOT)/common/unicode/; \
+ cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \
+ cp $(SRCROOT)/icuSources/common/unicode/utypes.h . ; \
+ patch <$(SRCROOT)/windowspatchconfig.txt;) \
+ else \
+ (cd $(OBJROOT)/common/unicode/; \
+ cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \
+ cp $(SRCROOT)/icuSources/common/unicode/utypes.h . ; \
+ patch <$(SRCROOT)/patchconfig.txt;) \
+ fi; \
+ if test -f $(SRCROOT)/icuSources/common/Makefile.local; then \
+ cp -p $(SRCROOT)/icuSources/common/Makefile.local $(OBJROOT)/common/ ; \
+ fi;
+ if test -f $(SRCROOT)/icuSources/i18n/Makefile.local; then \
+ cp -p $(SRCROOT)/icuSources/i18n/Makefile.local $(OBJROOT)/i18n/ ; \
+ 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.
+$(CROSSHOST_OBJROOT)/Makefile :
+ if test ! -d $(CROSSHOST_OBJROOT); then \
+ mkdir -p $(CROSSHOST_OBJROOT); \
+ fi;
+ (cd $(CROSSHOST_OBJROOT); $(ENV_CONFIGURE_BUILDHOST) $(SRCROOT)/icuSources/runConfigureICU MacOSX $(CONFIG_FLAGS);)
+ (cd $(CROSSHOST_OBJROOT)/common/unicode/; \
+ cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \
+ cp $(SRCROOT)/icuSources/common/unicode/utypes.h . ; \
+ patch <$(SRCROOT)/crosshostpatchconfig.txt;)
+ if test -f $(SRCROOT)/icuSources/common/Makefile.local; then \
+ cp -p $(SRCROOT)/icuSources/common/Makefile.local $(CROSSHOST_OBJROOT)/common/ ; \
+ fi;
+ if test -f $(SRCROOT)/icuSources/i18n/Makefile.local; then \
+ cp -p $(SRCROOT)/icuSources/i18n/Makefile.local $(CROSSHOST_OBJROOT)/i18n/ ; \
+ fi;
+
+#################################
+# B&I TARGETS
+#################################
+