]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/mh-cygwin
ICU-461.12.tar.gz
[apple/icu.git] / icuSources / config / mh-cygwin
CommitLineData
b75a7d8f
A
1## -*-makefile-*-
2## Cygwin-specific setup
729e4ab9 3## Copyright (c) 2001-2010, International Business Machines Corporation and
b75a7d8f 4## others. All Rights Reserved.
b75a7d8f
A
5
6## Commands to generate dependency files
7GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
8GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
9
374ca955
A
10## Flags to create/use a static library
11ifneq ($(ENABLE_SHARED),YES)
12## Make sure that the static libraries can be built and used
13CPPFLAGS += -DU_STATIC_IMPLEMENTATION
14else
15## Make sure that the static libraries can be built
16STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
17endif
18
b75a7d8f
A
19## Flags for position independent code
20SHAREDLIBCFLAGS =
21SHAREDLIBCXXFLAGS =
22SHAREDLIBCPPFLAGS = -DPIC
23
24## Additional flags when building libraries and with threads
b75a7d8f 25THREADSCPPFLAGS = -D_REENTRANT
73c04bcf 26LIBCPPFLAGS =
b75a7d8f 27
374ca955
A
28# Commands to link. Link with C++ in case static libraries are used.
29LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS)
30#LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
31
729e4ab9
A
32## Shared library options
33LD_SOOPTIONS= -Wl,-Bsymbolic
34
b75a7d8f 35## Commands to make a shared library
729e4ab9
A
36# $(subst) won't work in shell script. #M# at the end omits these
37# lines from the shell script (Make only)
38SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(subst cyg,lib,$@).$(A)#M#
39SHLIB.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 "
44
b75a7d8f
A
45
46## Compiler switch to embed a runtime search path
47LD_RPATH=
48LD_RPATH_PRE= -Wl,-rpath,
49
50## Compiler switch to embed a library name
374ca955 51LD_SONAME =
b75a7d8f
A
52
53## Shared object suffix
54SO = dll
55## Non-shared intermediate object suffix
374ca955
A
56STATIC_O = ao
57LIBICU = cyg$(ICUPREFIX)
729e4ab9
A
58## To have an import library is better on Cygwin
59IMPORT_LIB_EXT = .dll.a
b75a7d8f
A
60
61## Compilation rules
62%.$(STATIC_O): $(srcdir)/%.c
63 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
64%.o: $(srcdir)/%.c
65 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
66
67%.$(STATIC_O): $(srcdir)/%.cpp
68 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
69%.o: $(srcdir)/%.cpp
70 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
71
b75a7d8f
A
72
73## Dependency rules
74%.d: $(srcdir)/%.c
75 @echo "generating dependency information for $<"
374ca955 76 @echo -n "$@ " > $@
73c04bcf 77 @$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE)
b75a7d8f
A
78
79%.d: $(srcdir)/%.cpp
80 @echo "generating dependency information for $<"
374ca955 81 @echo -n "$@ " > $@
73c04bcf 82 @$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE)
b75a7d8f
A
83
84## Versioned target for a shared library.
374ca955
A
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)
88FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
89MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
b75a7d8f 90
729e4ab9
A
91IMPORT_LIB = $(subst cyg,lib,$(FINAL_SO_TARGET)).$(A)#M#
92MIDDLE_IMPORT_LIB = $(subst cyg,lib,$(basename $(SO_TARGET)))$(SO_TARGET_VERSION_MAJOR).$(SO).$(A)#M#
93FINAL_IMPORT_LIB = $(IMPORT_LIB)#M#
94
73c04bcf
A
95# The following is for Makefile.inc's use.
96ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
97
b75a7d8f 98## Versioned libraries rules
374ca955
A
99#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
100# $(RM) $@ && cp ${<F} $@
101%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
729e4ab9 102 $(RM) $(subst cyg,lib,$@).$(A) && ln -s $(subst cyg,lib,${<F}).$(A) $(subst cyg,lib,$@).$(A)
b75a7d8f 103
73c04bcf
A
104## Install libraries as executable
105INSTALL-L=$(INSTALL_PROGRAM)
106
b75a7d8f
A
107## Bind internal references
108
109# LDflags that pkgdata will use
110BIR_LDFLAGS= -Wl,-Bsymbolic
111
b75a7d8f
A
112# Dependencies [i.e. map files] for the final library
113BIR_DEPS=
114
115# Environment variable to set a runtime search path
116LDLIBRARYPATH_ENVVAR = PATH
117
374ca955
A
118# The type of assembly to write for generating an object file
119GENCCODE_ASSEMBLY=-a gcc-cygwin
120
73c04bcf
A
121# put this here again so it gets cyguc...
122
123#SH#ICULIBS_COMMON_LIB_NAME="${LIBICU}uc${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}"
124
125# for icu-config
126
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}"
139
b75a7d8f
A
140## End Cygwin-specific setup
141