2 ## Cygwin/MinGW specific setup
3 ## Copyright (c) 2001-2012, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 # TODO: Finish the rest of this port. This platform port is incomplete.
8 # We install sbin tools into the same bin directory because
9 # pkgdata needs some of the tools in sbin, and we can't always depend on
10 # icu-config working on Windows.
13 ## Commands to generate dependency files
14 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
15 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
17 ## Flags to create/use a static library
18 ifneq ($(ENABLE_SHARED),YES)
19 ## Make sure that the static libraries can be built and used
20 CPPFLAGS += -DU_STATIC_IMPLEMENTATION
22 ## Make sure that the static libraries can be built
23 STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
26 ## Flags for position independent code
29 SHAREDLIBCPPFLAGS = -DPIC
31 ## Additional flags when building libraries and with threads
32 THREADSCFLAGS = -mthreads
33 THREADSCXXFLAGS = -mthreads
36 # Commands to link. Link with C++ in case static libraries are used.
37 LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS)
38 #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
40 ## Shared library options
41 LD_SOOPTIONS= -Wl,-Bsymbolic
43 ## Commands to make a shared library
44 SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(dir $@)lib$(notdir $(@:$(SO_TARGET_VERSION_MAJOR).$(SO)=))$(IMPORT_LIB_EXT)#M#
45 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(dir $@)lib$(notdir $(@:$(SO_TARGET_VERSION_MAJOR).$(SO)=))$(IMPORT_LIB_EXT)#M#
47 ## Compiler switch to embed a runtime search path
49 LD_RPATH_PRE= -Wl,-rpath,
51 ## Compiler switch to embed a library name
54 ## Shared object suffix
56 ## Non-shared intermediate object suffix
59 ifeq ($(ENABLE_SHARED),YES)
60 SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
62 SO_TARGET_VERSION_SUFFIX =
65 # Static library prefix and file extension
66 LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
69 ## An import library is needed for z/OS and MSVC
74 # Change the stubnames so that poorly working FAT disks and installation programs can work.
75 # This is also for backwards compatibility.
78 LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)
80 # The #M# is used to delete lines for icu-config
81 # Current full path directory.
82 #CURR_FULL_DIR=$(shell pwd -W)#M# for MSYS
83 CURR_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
84 # Current full path directory for use in source code in a -D compiler option.
85 #CURR_SRCCODE_FULL_DIR=$(subst /,\\\\,$(shell pwd -W))#M# for MSYS
86 CURR_SRCCODE_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
89 %.$(STATIC_O): $(srcdir)/%.c
90 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
92 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
94 %.$(STATIC_O): $(srcdir)/%.cpp
95 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
97 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
102 @echo "generating dependency information for $<"
104 @$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE)
107 @echo "generating dependency information for $<"
109 @$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE)
111 ## Versioned target for a shared library.
112 ## Since symbolic links don't work the same way on Windows,
113 ## we only use the version major number.
114 #FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
115 FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
116 MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
118 FINAL_IMPORT_LIB = $(dir $(SO_TARGET))lib$(notdir $(basename $(SO_TARGET)))$(IMPORT_LIB_EXT)#M#
119 IMPORT_LIB = $(FINAL_IMPORT_LIB)#M#
120 MIDDLE_IMPORT_LIB = $(FINAL_IMPORT_LIB)#M#
122 ## Special pkgdata information that is needed
123 PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
124 #ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
125 #ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M#
127 ## Versioned libraries rules
128 #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
129 # $(RM) $@ && cp ${<F} $@
130 %.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
133 # Environment variable to set a runtime search path
134 LDLIBRARYPATH_ENVVAR = PATH
136 # The type of assembly to write for generating an object file
137 GENCCODE_ASSEMBLY=-a gcc-cygwin
139 # These are needed to allow the pkgdata GNU make files to work
140 PKGDATA_DEFS = -DU_MAKE=\"$(MAKE)\"
142 ## End Cygwin/MinGW specific setup