2 ## Cygwin64/MinGW64 specific setup
3 ## Copyright (c) 2012-2013, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 # TODO: Finish the rest of this port. This platform port is incomplete.
8 # This file is similar to mh-mingw
9 # Any changes made here may also need to be made in mh-mingw
11 # We install sbin tools into the same bin directory because
12 # pkgdata needs some of the tools in sbin, and we can't always depend on
13 # icu-config working on Windows.
16 ## Commands to generate dependency files
17 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
18 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
20 ## Flags to create/use a static library
21 ifneq ($(ENABLE_SHARED),YES)
22 ## Make sure that the static libraries can be built and used
23 CPPFLAGS += -DU_STATIC_IMPLEMENTATION
25 ## Make sure that the static libraries can be built
26 STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
29 ## Flags for position independent code
32 SHAREDLIBCPPFLAGS = -DPIC
34 ## Additional flags when building libraries and with threads
35 THREADSCFLAGS = -mthreads
36 THREADSCXXFLAGS = -mthreads
39 # Commands to link. Link with C++ in case static libraries are used.
40 LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS)
41 #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
43 ## Shared library options
44 LD_SOOPTIONS= -Wl,-Bsymbolic
46 ## Commands to make a shared library
47 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#
48 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#
50 ## Compiler switch to embed a runtime search path
52 LD_RPATH_PRE= -Wl,-rpath,
54 ## Compiler switch to embed a library name
57 ## Shared object suffix
59 ## Non-shared intermediate object suffix
62 ifeq ($(ENABLE_SHARED),YES)
63 SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
65 SO_TARGET_VERSION_SUFFIX =
68 # Static library prefix and file extension
69 LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
72 ## An import library is needed for z/OS and MSVC
77 # Change the stubnames so that poorly working FAT disks and installation programs can work.
78 # This is also for backwards compatibility.
81 LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)
83 # The #M# is used to delete lines for icu-config
84 # Current full path directory.
85 #CURR_FULL_DIR=$(shell pwd -W)#M# for MSYS
86 CURR_FULL_DIR?=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
87 # Current full path directory for use in source code in a -D compiler option.
88 #CURR_SRCCODE_FULL_DIR=$(subst /,\\\\,$(shell pwd -W))#M# for MSYS
89 CURR_SRCCODE_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
92 %.$(STATIC_O): $(srcdir)/%.c
93 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
95 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
97 %.$(STATIC_O): $(srcdir)/%.cpp
98 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
100 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
105 @echo "generating dependency information for $<"
107 @$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE)
110 @echo "generating dependency information for $<"
112 @$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE)
114 ## Versioned target for a shared library.
115 ## Since symbolic links don't work the same way on Windows,
116 ## we only use the version major number.
117 #FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
118 FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
119 MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
121 FINAL_IMPORT_LIB = $(dir $(SO_TARGET))$(notdir $(basename $(SO_TARGET)))$(IMPORT_LIB_EXT)#M#
122 IMPORT_LIB = $(FINAL_IMPORT_LIB)#M#
123 MIDDLE_IMPORT_LIB = $(FINAL_IMPORT_LIB)#M#
125 ## Special pkgdata information that is needed
126 PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
127 #ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
128 #ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M#
130 ## Versioned libraries rules
131 #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
132 # $(RM) $@ && cp ${<F} $@
133 %.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
136 # Environment variable to set a runtime search path
137 LDLIBRARYPATH_ENVVAR = PATH
139 # The type of assembly to write for generating an object file
140 GENCCODE_ASSEMBLY=-a gcc-mingw64
142 # These are needed to allow the pkgdata GNU make files to work
143 PKGDATA_DEFS = -DU_MAKE=\"$(MAKE)\"
145 ## End Cygwin64/MinGW64 specific setup