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