]>
Commit | Line | Data |
---|---|---|
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. | |
16 | sbindir=$(bindir) | |
17 | ||
18 | ## Commands to generate dependency files | |
19 | GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) | |
20 | GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) | |
21 | ||
22 | ## Flags to create/use a static library | |
23 | ifneq ($(ENABLE_SHARED),YES) | |
24 | ## Make sure that the static libraries can be built and used | |
25 | CPPFLAGS += -DU_STATIC_IMPLEMENTATION | |
26 | else | |
27 | ## Make sure that the static libraries can be built | |
28 | STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION | |
29 | endif | |
30 | ||
31 | ## Flags for position independent code | |
32 | SHAREDLIBCFLAGS = | |
33 | SHAREDLIBCXXFLAGS = | |
34 | SHAREDLIBCPPFLAGS = -DPIC | |
35 | ||
36 | ## Additional flags when building libraries and with threads | |
73c04bcf A |
37 | THREADSCFLAGS = -mthreads |
38 | THREADSCXXFLAGS = -mthreads | |
39 | LIBCPPFLAGS = | |
374ca955 A |
40 | |
41 | # Commands to link. Link with C++ in case static libraries are used. | |
42 | LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
43 | #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
44 | ||
4388f060 A |
45 | ## Shared library options |
46 | LD_SOOPTIONS= -Wl,-Bsymbolic | |
47 | ||
374ca955 | 48 | ## Commands to make a shared library |
b331163b A |
49 | 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# |
50 | 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# | |
374ca955 A |
51 | |
52 | ## Compiler switch to embed a runtime search path | |
53 | LD_RPATH= | |
54 | LD_RPATH_PRE= -Wl,-rpath, | |
55 | ||
56 | ## Compiler switch to embed a library name | |
57 | LD_SONAME = | |
58 | ||
59 | ## Shared object suffix | |
60 | SO = dll | |
61 | ## Non-shared intermediate object suffix | |
62 | STATIC_O = ao | |
4388f060 A |
63 | |
64 | ifeq ($(ENABLE_SHARED),YES) | |
374ca955 | 65 | SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) |
4388f060 A |
66 | else |
67 | SO_TARGET_VERSION_SUFFIX = | |
68 | endif | |
374ca955 A |
69 | |
70 | # Static library prefix and file extension | |
f3c0d7a5 | 71 | LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX) |
4388f060 | 72 | A = a |
374ca955 A |
73 | |
74 | ## An import library is needed for z/OS and MSVC | |
57a6839d | 75 | IMPORT_LIB_EXT = .dll.a |
374ca955 | 76 | |
f3c0d7a5 | 77 | LIBPREFIX=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. | |
81 | DATA_STUBNAME = dt | |
82 | I18N_STUBNAME = in | |
83 | LIBICU = $(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 | 100 | CURR_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 | 103 | CURR_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) | |
132 | FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
133 | MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) | |
134 | ||
b331163b | 135 | FINAL_IMPORT_LIB = $(dir $(SO_TARGET))lib$(notdir $(basename $(SO_TARGET)))$(IMPORT_LIB_EXT)#M# |
4388f060 A |
136 | IMPORT_LIB = $(FINAL_IMPORT_LIB)#M# |
137 | MIDDLE_IMPORT_LIB = $(FINAL_IMPORT_LIB)#M# | |
138 | ||
374ca955 A |
139 | ## Special pkgdata information that is needed |
140 | PKGDATA_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 | |
151 | LDLIBRARYPATH_ENVVAR = PATH | |
152 | ||
153 | # The type of assembly to write for generating an object file | |
154 | GENCCODE_ASSEMBLY=-a gcc-cygwin | |
155 | ||
156 | # These are needed to allow the pkgdata GNU make files to work | |
157 | PKGDATA_DEFS = -DU_MAKE=\"$(MAKE)\" | |
158 | ||
159 | ## End Cygwin/MinGW specific setup | |
160 |