]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/mh-mingw
ICU-59180.0.1.tar.gz
[apple/icu.git] / icuSources / config / mh-mingw
CommitLineData
374ca955 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
374ca955 4## Cygwin/MinGW specific setup
b331163b 5## Copyright (c) 2001-2014, International Business Machines Corporation and
374ca955
A
6## others. All Rights Reserved.
7
8# TODO: Finish the rest of this port. This platform port is incomplete.
9
51004dcb
A
10# This file is similar to mh-mingw64
11# Any changes made here may also need to be made in mh-mingw64
12
374ca955
A
13# We install sbin tools into the same bin directory because
14# pkgdata needs some of the tools in sbin, and we can't always depend on
15# icu-config working on Windows.
16sbindir=$(bindir)
17
18## Commands to generate dependency files
19GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
20GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
21
22## Flags to create/use a static library
23ifneq ($(ENABLE_SHARED),YES)
24## Make sure that the static libraries can be built and used
25CPPFLAGS += -DU_STATIC_IMPLEMENTATION
26else
27## Make sure that the static libraries can be built
28STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
29endif
30
31## Flags for position independent code
32SHAREDLIBCFLAGS =
33SHAREDLIBCXXFLAGS =
34SHAREDLIBCPPFLAGS = -DPIC
35
36## Additional flags when building libraries and with threads
73c04bcf
A
37THREADSCFLAGS = -mthreads
38THREADSCXXFLAGS = -mthreads
39LIBCPPFLAGS =
374ca955
A
40
41# Commands to link. Link with C++ in case static libraries are used.
42LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS)
43#LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
44
4388f060
A
45## Shared library options
46LD_SOOPTIONS= -Wl,-Bsymbolic
47
374ca955 48## Commands to make a shared library
b331163b
A
49SHLIB.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#
50SHLIB.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#
374ca955
A
51
52## Compiler switch to embed a runtime search path
53LD_RPATH=
54LD_RPATH_PRE= -Wl,-rpath,
55
56## Compiler switch to embed a library name
57LD_SONAME =
58
59## Shared object suffix
60SO = dll
61## Non-shared intermediate object suffix
62STATIC_O = ao
4388f060
A
63
64ifeq ($(ENABLE_SHARED),YES)
374ca955 65SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
4388f060
A
66else
67SO_TARGET_VERSION_SUFFIX =
68endif
374ca955
A
69
70# Static library prefix and file extension
f3c0d7a5 71LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
4388f060 72A = a
374ca955
A
73
74## An import library is needed for z/OS and MSVC
57a6839d 75IMPORT_LIB_EXT = .dll.a
374ca955 76
f3c0d7a5 77LIBPREFIX=lib
374ca955
A
78
79# Change the stubnames so that poorly working FAT disks and installation programs can work.
80# This is also for backwards compatibility.
81DATA_STUBNAME = dt
82I18N_STUBNAME = in
83LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)
84
b331163b
A
85#SH### copied from Makefile.inc
86#SH## for icu-config to test with
87#SH#ICULIBS_COMMON_LIB_NAME="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}"
88#SH#ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}"
89
90#SH#ICULIBS_DATA="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)"
91#SH#ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)"
92#SH#
93#SH## ICULIBS is the set of libraries your application should link
94#SH## with usually. Many applications will want to add ${ICULIBS_I18N} as well.
95#SH#ICULIBS="${ICULIBS_BASE} ${ICULIBS_I18N} ${ICULIBS_COMMON} ${ICULIBS_DATA} "
96
374ca955
A
97# The #M# is used to delete lines for icu-config
98# Current full path directory.
46f4442e 99#CURR_FULL_DIR=$(shell pwd -W)#M# for MSYS
51004dcb 100CURR_FULL_DIR?=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
374ca955 101# Current full path directory for use in source code in a -D compiler option.
46f4442e 102#CURR_SRCCODE_FULL_DIR=$(subst /,\\\\,$(shell pwd -W))#M# for MSYS
729e4ab9 103CURR_SRCCODE_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
374ca955
A
104
105## Compilation rules
106%.$(STATIC_O): $(srcdir)/%.c
107 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
108%.o: $(srcdir)/%.c
109 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
110
111%.$(STATIC_O): $(srcdir)/%.cpp
112 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
113%.o: $(srcdir)/%.cpp
114 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
115
116
117## Dependency rules
118%.d: $(srcdir)/%.c
119 @echo "generating dependency information for $<"
120 @echo -n "$@ " > $@
73c04bcf 121 @$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE)
374ca955
A
122
123%.d: $(srcdir)/%.cpp
124 @echo "generating dependency information for $<"
125 @echo -n "$@ " > $@
73c04bcf 126 @$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE)
374ca955
A
127
128## Versioned target for a shared library.
129## Since symbolic links don't work the same way on Windows,
130## we only use the version major number.
131#FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
132FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
133MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
134
b331163b 135FINAL_IMPORT_LIB = $(dir $(SO_TARGET))lib$(notdir $(basename $(SO_TARGET)))$(IMPORT_LIB_EXT)#M#
4388f060
A
136IMPORT_LIB = $(FINAL_IMPORT_LIB)#M#
137MIDDLE_IMPORT_LIB = $(FINAL_IMPORT_LIB)#M#
138
374ca955
A
139## Special pkgdata information that is needed
140PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
73c04bcf
A
141#ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
142#ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M#
374ca955
A
143
144## Versioned libraries rules
145#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
146# $(RM) $@ && cp ${<F} $@
147%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
148 @echo -n
149
150# Environment variable to set a runtime search path
151LDLIBRARYPATH_ENVVAR = PATH
152
153# The type of assembly to write for generating an object file
154GENCCODE_ASSEMBLY=-a gcc-cygwin
155
156# These are needed to allow the pkgdata GNU make files to work
157PKGDATA_DEFS = -DU_MAKE=\"$(MAKE)\"
158
159## End Cygwin/MinGW specific setup
160