2 ## Cygwin-specific setup
3 ## Copyright (c) 2001-2010, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Commands to generate dependency files
7 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
8 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
10 ## Flags to create/use a static library
11 ifneq ($(ENABLE_SHARED),YES)
12 ## Make sure that the static libraries can be built and used
13 CPPFLAGS += -DU_STATIC_IMPLEMENTATION
15 ## Make sure that the static libraries can be built
16 STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
19 ## Flags for position independent code
22 SHAREDLIBCPPFLAGS = -DPIC
24 ## Additional flags when building libraries and with threads
25 THREADSCPPFLAGS = -D_REENTRANT
28 # Commands to link. Link with C++ in case static libraries are used.
29 LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS)
30 #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
32 ## Shared library options
33 LD_SOOPTIONS= -Wl,-Bsymbolic
35 ## Commands to make a shared library
36 # $(subst) won't work in shell script. #M# at the end omits these
37 # lines from the shell script (Make only)
38 SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(subst cyg,lib,$@).$(A)#M#
39 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(subst cyg,lib,$@).$(A)#M#
40 # the #SH# lines don't go through further postprocessing.
41 # so, they must be valid shell script starting from column 4
42 #SH#SHLIB_c="$(CC) $(CFLAGS) $(LDFLAGS) -shared "
43 #SH#SHLIB_cc="$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared "
46 ## Compiler switch to embed a runtime search path
48 LD_RPATH_PRE= -Wl,-rpath,
50 ## Compiler switch to embed a library name
53 ## Shared object suffix
55 ## Non-shared intermediate object suffix
57 LIBICU = cyg$(ICUPREFIX)
58 ## To have an import library is better on Cygwin
59 IMPORT_LIB_EXT = .dll.a
62 %.$(STATIC_O): $(srcdir)/%.c
63 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
65 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
67 %.$(STATIC_O): $(srcdir)/%.cpp
68 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
70 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
75 @echo "generating dependency information for $<"
77 @$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE)
80 @echo "generating dependency information for $<"
82 @$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE)
84 ## Versioned target for a shared library.
85 ## Since symbolic links don't work the same way on Windows,
86 ## we only use the version major number.
87 #FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
88 FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
89 MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
91 IMPORT_LIB = $(subst cyg,lib,$(FINAL_SO_TARGET)).$(A)#M#
92 MIDDLE_IMPORT_LIB = $(subst cyg,lib,$(basename $(SO_TARGET)))$(SO_TARGET_VERSION_MAJOR).$(SO).$(A)#M#
93 FINAL_IMPORT_LIB = $(IMPORT_LIB)#M#
95 # The following is for Makefile.inc's use.
96 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
98 ## Versioned libraries rules
99 #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
100 # $(RM) $@ && cp ${<F} $@
101 %.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
102 $(RM) $(subst cyg,lib,$@).$(A) && ln -s $(subst cyg,lib,${<F}).$(A) $(subst cyg,lib,$@).$(A)
104 ## Install libraries as executable
105 INSTALL-L=$(INSTALL_PROGRAM)
107 ## Bind internal references
109 # LDflags that pkgdata will use
110 BIR_LDFLAGS= -Wl,-Bsymbolic
112 # Dependencies [i.e. map files] for the final library
115 # Environment variable to set a runtime search path
116 LDLIBRARYPATH_ENVVAR = PATH
118 # The type of assembly to write for generating an object file
119 GENCCODE_ASSEMBLY=-a gcc-cygwin
121 # put this here again so it gets cyguc...
123 #SH#ICULIBS_COMMON_LIB_NAME="${LIBICU}uc${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}"
127 #SH### copied from Makefile.inc
128 #SH#ICULIBS_COMMON="-l${LIBICU}uc${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
129 #SH#ICULIBS_DATA="-l${LIBICU}${DATA_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
130 #SH#ICULIBS_I18N="-l${LIBICU}${I18N_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
131 #SH#ICULIBS_TOOLUTIL="-l${LIBICU}tu${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
132 #SH#ICULIBS_CTESTFW="-l${LIBICU}ctestfw${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
133 #SH#ICULIBS_ICUIO="-l${LIBICU}io${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
134 #SH#ICULIBS_OBSOLETE="-l${LIBICU}obsolete${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
135 #SH#ICULIBS_LAYOUT="-l${LIBICU}le${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
136 #SH#ICULIBS_LAYOUTEX="-l${LIBICU}lx${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
137 #SH#ICULIBS_BASE="${LIBS} -L${libdir}"
138 #SH#ICULIBS="${ICULIBS_BASE} ${ICULIBS_I18N} ${ICULIBS_COMMON} ${ICULIBS_DATA}"
140 ## End Cygwin-specific setup