michael@0: ## -*-makefile-*- michael@0: ## Cygwin64/MinGW64 specific setup michael@0: ## Copyright (c) 2012-2013, International Business Machines Corporation and michael@0: ## others. All Rights Reserved. michael@0: michael@0: # TODO: Finish the rest of this port. This platform port is incomplete. michael@0: michael@0: # This file is similar to mh-mingw michael@0: # Any changes made here may also need to be made in mh-mingw michael@0: michael@0: # We install sbin tools into the same bin directory because michael@0: # pkgdata needs some of the tools in sbin, and we can't always depend on michael@0: # icu-config working on Windows. michael@0: sbindir=$(bindir) michael@0: michael@0: ## Commands to generate dependency files michael@0: GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) michael@0: GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) michael@0: michael@0: ## Flags to create/use a static library michael@0: ifneq ($(ENABLE_SHARED),YES) michael@0: ## Make sure that the static libraries can be built and used michael@0: CPPFLAGS += -DU_STATIC_IMPLEMENTATION michael@0: else michael@0: ## Make sure that the static libraries can be built michael@0: STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION michael@0: endif michael@0: michael@0: ## Flags for position independent code michael@0: SHAREDLIBCFLAGS = michael@0: SHAREDLIBCXXFLAGS = michael@0: SHAREDLIBCPPFLAGS = -DPIC michael@0: michael@0: ## Additional flags when building libraries and with threads michael@0: THREADSCFLAGS = -mthreads michael@0: THREADSCXXFLAGS = -mthreads michael@0: LIBCPPFLAGS = michael@0: michael@0: # Commands to link. Link with C++ in case static libraries are used. michael@0: LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) michael@0: #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) michael@0: michael@0: ## Shared library options michael@0: LD_SOOPTIONS= -Wl,-Bsymbolic michael@0: michael@0: ## Commands to make a shared library michael@0: SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(dir $@)$(notdir $(@:$(SO_TARGET_VERSION_MAJOR).$(SO)=))$(IMPORT_LIB_EXT)#M# michael@0: SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(dir $@)$(notdir $(@:$(SO_TARGET_VERSION_MAJOR).$(SO)=))$(IMPORT_LIB_EXT)#M# michael@0: michael@0: ## Compiler switch to embed a runtime search path michael@0: LD_RPATH= michael@0: LD_RPATH_PRE= -Wl,-rpath, michael@0: michael@0: ## Compiler switch to embed a library name michael@0: LD_SONAME = michael@0: michael@0: ## Shared object suffix michael@0: SO = dll michael@0: ## Non-shared intermediate object suffix michael@0: STATIC_O = ao michael@0: michael@0: ifeq ($(ENABLE_SHARED),YES) michael@0: SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) michael@0: else michael@0: SO_TARGET_VERSION_SUFFIX = michael@0: endif michael@0: michael@0: # Static library prefix and file extension michael@0: LIBSICU = lib$(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX) michael@0: A = a michael@0: michael@0: ## An import library is needed for z/OS and MSVC michael@0: IMPORT_LIB_EXT = .dll.a michael@0: michael@0: LIBPREFIX= michael@0: michael@0: # Change the stubnames so that poorly working FAT disks and installation programs can work. michael@0: # This is also for backwards compatibility. michael@0: DATA_STUBNAME = dt michael@0: I18N_STUBNAME = in michael@0: LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) michael@0: michael@0: # The #M# is used to delete lines for icu-config michael@0: # Current full path directory. michael@0: #CURR_FULL_DIR=$(shell pwd -W)#M# for MSYS michael@0: CURR_FULL_DIR?=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell michael@0: # Current full path directory for use in source code in a -D compiler option. michael@0: #CURR_SRCCODE_FULL_DIR=$(subst /,\\\\,$(shell pwd -W))#M# for MSYS michael@0: CURR_SRCCODE_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell michael@0: michael@0: ## Compilation rules michael@0: %.$(STATIC_O): $(srcdir)/%.c michael@0: $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.c michael@0: $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< michael@0: michael@0: %.$(STATIC_O): $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< michael@0: michael@0: michael@0: ## Dependency rules michael@0: %.d: $(srcdir)/%.c michael@0: @echo "generating dependency information for $<" michael@0: @echo -n "$@ " > $@ michael@0: @$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE) michael@0: michael@0: %.d: $(srcdir)/%.cpp michael@0: @echo "generating dependency information for $<" michael@0: @echo -n "$@ " > $@ michael@0: @$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE) michael@0: michael@0: ## Versioned target for a shared library. michael@0: ## Since symbolic links don't work the same way on Windows, michael@0: ## we only use the version major number. michael@0: #FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) michael@0: FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) michael@0: MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) michael@0: michael@0: FINAL_IMPORT_LIB = $(dir $(SO_TARGET))$(notdir $(basename $(SO_TARGET)))$(IMPORT_LIB_EXT)#M# michael@0: IMPORT_LIB = $(FINAL_IMPORT_LIB)#M# michael@0: MIDDLE_IMPORT_LIB = $(FINAL_IMPORT_LIB)#M# michael@0: michael@0: ## Special pkgdata information that is needed michael@0: PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR) michael@0: #ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M# michael@0: #ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M# michael@0: michael@0: ## Versioned libraries rules michael@0: #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) michael@0: # $(RM) $@ && cp ${