OLD | NEW |
1 ## Cygwin with Microsoft Visual C++ compiler specific setup | 1 ## -*-makefile-*- |
2 ## Copyright (c) 2001-2013, International Business Machines Corporation and | 2 ## MSYS with Microsoft Visual C++ compiler specific setup |
| 3 ## Copyright (c) 2014, International Business Machines Corporation and |
3 ## others. All Rights Reserved. | 4 ## others. All Rights Reserved. |
4 | 5 |
5 # We install sbin tools into the same bin directory because | 6 # We install sbin tools into the same bin directory because |
6 # pkgdata needs some of the tools in sbin, and we can't always depend on | 7 # pkgdata needs some of the tools in sbin, and we can't always depend on |
7 # icu-config working on Windows. | 8 # icu-config working on Windows. |
8 sbindir=$(bindir) | 9 sbindir=$(bindir) |
9 | 10 |
| 11 # Need this option to use / instead of - when specifying options for the |
| 12 # rc.exe command |
| 13 MSYS_RC_MODE=1 |
| 14 |
10 ## Commands to generate dependency files | 15 ## Commands to generate dependency files |
11 GEN_DEPS.c= : | 16 GEN_DEPS.c= : |
12 GEN_DEPS.cc= : | 17 GEN_DEPS.cc= : |
13 #GEN_DEPS.c=» $(COMPILE.c) /E | 18 #GEN_DEPS.c=» $(COMPILE.c) -E |
14 #GEN_DEPS.cc=» $(COMPILE.cc) /E | 19 #GEN_DEPS.cc=» $(COMPILE.cc) -E |
15 | 20 |
16 ## Flags to create/use a static library | 21 ## Flags to create/use a static library |
17 ifneq ($(ENABLE_SHARED),YES) | 22 ifneq ($(ENABLE_SHARED),YES) |
18 ## Make sure that the static libraries can be built and used | 23 ## Make sure that the static libraries can be built and used |
19 CPPFLAGS += -DU_STATIC_IMPLEMENTATION#M# | 24 CPPFLAGS += -DU_STATIC_IMPLEMENTATION#M# |
20 else | 25 else |
21 ## Make sure that the static libraries can be built | 26 ## Make sure that the static libraries can be built |
22 STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION | 27 STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION |
23 endif | 28 endif |
24 | 29 |
25 ## Flags for position independent code | 30 ## Flags for position independent code |
26 SHAREDLIBCFLAGS = | 31 SHAREDLIBCFLAGS = |
27 SHAREDLIBCXXFLAGS = | 32 SHAREDLIBCXXFLAGS = |
28 SHAREDLIBCPPFLAGS = | 33 SHAREDLIBCPPFLAGS = |
29 | 34 |
30 ## Additional flags when building libraries and with threads | 35 ## Additional flags when building libraries and with threads |
31 LIBCPPFLAGS = | 36 LIBCPPFLAGS = |
32 | 37 |
33 ifeq ($(ENABLE_RELEASE),1) | 38 ifeq ($(ENABLE_RELEASE),1) |
34 # Make sure that assertions are disabled | 39 # Make sure that assertions are disabled |
35 CPPFLAGS+=-DU_RELEASE=1#M# | 40 CPPFLAGS+=-DU_RELEASE=1#M# |
36 endif | 41 endif |
37 | 42 |
38 ifeq ($(ENABLE_DEBUG),1) | 43 ifeq ($(ENABLE_DEBUG),1) |
39 # Pass debugging flag through | 44 # Pass debugging flag through |
40 CPPFLAGS+=-D_DEBUG=1#M# | 45 CPPFLAGS+=-D_DEBUG=1#M# |
41 ICULIBSUFFIX:=$(ICULIBSUFFIX)d#M# | 46 ICULIBSUFFIX:=$(ICULIBSUFFIX)d#M# |
42 endif | 47 endif |
43 | 48 |
44 # /GF pools strings and places them into read-only memory | 49 # -GF pools strings and places them into read-only memory |
45 # /EHsc enables exception handling | 50 # -EHsc enables exception handling |
46 # /Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility. | 51 # -Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility. |
47 # -D_CRT_SECURE_NO_DEPRECATE is needed to quiet warnings about using standard C
functions. | 52 # -D_CRT_SECURE_NO_DEPRECATE is needed to quiet warnings about using standard C
functions. |
48 CFLAGS+=/GF /nologo | 53 CFLAGS+=-GF -nologo |
49 CXXFLAGS+=/GF /nologo /EHsc /Zc:wchar_t | 54 CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t |
50 CPPFLAGS+=-D_CRT_SECURE_NO_DEPRECATE | 55 CPPFLAGS+=-D_CRT_SECURE_NO_DEPRECATE |
51 DEFS+=-DWIN32 -DCYGWINMSVC | 56 DEFS+=-DWIN32 -DCYGWINMSVC |
52 LDFLAGS+=/nologo | 57 LDFLAGS+=-nologo |
53 | 58 |
54 # Commands to compile | 59 # Commands to compile |
55 COMPILE.c=» $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /c | 60 COMPILE.c=» $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c |
56 COMPILE.cc=» $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /c | 61 COMPILE.cc=» $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c |
57 | 62 |
58 # Commands to link | 63 # Commands to link |
59 LINK.c=»» LINK.EXE /subsystem:console $(LDFLAGS) | 64 LINK.c=»» LINK.EXE -subsystem:console $(LDFLAGS) |
60 LINK.cc=» LINK.EXE /subsystem:console $(LDFLAGS) | 65 LINK.cc=» LINK.EXE -subsystem:console $(LDFLAGS) |
61 | 66 |
62 ## Commands to make a shared library | 67 ## Commands to make a shared library |
63 SHLIB.c=» LINK.EXE /DLL $(LDFLAGS) | 68 SHLIB.c=» LINK.EXE -DLL $(LDFLAGS) |
64 SHLIB.cc=» LINK.EXE /DLL $(LDFLAGS) | 69 SHLIB.cc=» LINK.EXE -DLL $(LDFLAGS) |
65 | 70 |
66 ## Compiler switch to embed a runtime search path | 71 ## Compiler switch to embed a runtime search path |
67 LD_RPATH= | 72 LD_RPATH= |
68 LD_RPATH_PRE= | 73 LD_RPATH_PRE= |
69 | 74 |
70 ## Compiler switch to embed a library name | 75 ## Compiler switch to embed a library name |
71 LD_SONAME = /IMPLIB:$(SO_TARGET:.dll=.lib) | 76 LD_SONAME = -IMPLIB:$(SO_TARGET:.dll=.lib) |
72 | 77 |
73 ## Shared object suffix | 78 ## Shared object suffix |
74 SO = dll | 79 SO = dll |
75 ## Non-shared intermediate object suffix | 80 ## Non-shared intermediate object suffix |
76 STATIC_O = ao | 81 STATIC_O = ao |
77 # OUTOPT is for creating a specific output name | 82 # OUTOPT is for creating a specific output name |
78 OUTOPT = /out: | 83 OUTOPT = -out: |
79 | 84 |
80 # Static library prefix and file extension | 85 # Static library prefix and file extension |
81 LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX) | 86 LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX) |
82 A = lib | 87 A = lib |
83 | 88 |
84 # Cygwin's ar can't handle Win64 right now. So we use Microsoft's tool instead. | 89 # Cygwin's ar can't handle Win64 right now. So we use Microsoft's tool instead. |
85 AR = LIB.EXE#M# | 90 AR = LIB.EXE#M# |
86 ARFLAGS := /nologo $(ARFLAGS:r=)#M# | 91 ARFLAGS := -nologo $(ARFLAGS:r=)#M# |
87 RANLIB = ls -s#M# | 92 RANLIB = ls -s#M# |
88 AR_OUTOPT = /OUT:#M# | 93 AR_OUTOPT = -OUT:#M# |
89 | 94 |
90 ## An import library is needed for z/OS, MSVC and Cygwin | 95 ## An import library is needed for z-OS, MSVC and Cygwin |
91 IMPORT_LIB_EXT = .lib | 96 IMPORT_LIB_EXT = .lib |
92 | 97 |
93 LIBPREFIX= | 98 LIBPREFIX= |
94 DEFAULT_LIBS = advapi32.lib | 99 DEFAULT_LIBS = advapi32.lib |
95 | 100 |
96 # Change the stubnames so that poorly working FAT disks and installation program
s can work. | 101 # Change the stubnames so that poorly working FAT disks and installation program
s can work. |
97 # This is also for backwards compatibility. | 102 # This is also for backwards compatibility. |
98 DATA_STUBNAME = dt | 103 DATA_STUBNAME = dt |
99 I18N_STUBNAME = in | 104 I18N_STUBNAME = in |
100 LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) | 105 LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) |
101 | 106 |
102 ## Link commands to link to ICU libs | 107 ## Link commands to link to ICU libs |
103 ifeq ($(wildcard $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib),) | 108 ifeq ($(wildcard $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib),) |
104 LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX
).lib | 109 LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX
).lib |
105 else | 110 else |
106 LIBICUDT= $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib | 111 LIBICUDT= $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib |
107 endif | 112 endif |
108 LIBICUUC= $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).lib $(LIBIC
UDT) | 113 LIBICUUC= $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).lib $(LIBIC
UDT) |
109 LIBICUI18N= $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).lib | 114 LIBICUI18N= $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).lib |
110 LIBICULE= $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).lib | 115 LIBICULE= $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).lib |
111 LIBICULX= $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).lib | 116 LIBICULX= $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).lib |
112 LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).lib | 117 LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).lib |
113 LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICUL
IBSUFFIX).lib | 118 LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICUL
IBSUFFIX).lib |
114 LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).lib | 119 LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).lib |
115 | 120 |
116 ## These are the library specific LDFLAGS | 121 ## These are the library specific LDFLAGS |
117 LDFLAGSICUDT+=» /base:"0x4ad00000" /NOENTRY# The NOENTRY option is required for
creating a resource-only DLL. | 122 LDFLAGSICUDT+=» -base:"0x4ad00000" -NOENTRY# The NOENTRY option is required for
creating a resource-only DLL. |
118 LDFLAGSICUUC=» /base:"0x4a800000"# in-uc = 1MB | 123 LDFLAGSICUUC=» -base:"0x4a800000"# in-uc = 1MB |
119 LDFLAGSICUI18N=»/base:"0x4a900000"# io-in = 2MB | 124 LDFLAGSICUI18N=»-base:"0x4a900000"# io-in = 2MB |
120 LDFLAGSICUIO=» /base:"0x4ab00000"# le-io = 1MB | 125 LDFLAGSICUIO=» -base:"0x4ab00000"# le-io = 1MB |
121 LDFLAGSICULE=» /base:"0x4ac00000"# lx-le = 512KB | 126 LDFLAGSICULE=» -base:"0x4ac00000"# lx-le = 512KB |
122 LDFLAGSICULX=» /base:"0x4ac80000" | 127 LDFLAGSICULX=» -base:"0x4ac80000" |
123 LDFLAGSCTESTFW=# Unused for now. | 128 LDFLAGSCTESTFW=# Unused for now. |
124 LDFLAGSICUTOOLUTIL=» /base:"0x4ac00000"# Same as layout. Layout and tools pro
bably won't mix. | 129 LDFLAGSICUTOOLUTIL=» -base:"0x4ac00000"# Same as layout. Layout and tools pro
bably won't mix. |
125 | |
126 # The #M# is used to delete lines for icu-config | |
127 # Current full path directory. | |
128 CURR_FULL_DIR?=$(subst \,/,$(shell cygpath -da .))#M# -m isn't used because it d
oesn't work on Win98 | |
129 # Current full path directory for use in source code in a -D compiler option. | |
130 CURR_SRCCODE_FULL_DIR=$(subst \,\\,$(shell cygpath -da .))#M# | |
131 | |
132 ifeq ($(srcdir),.) | |
133 SOURCE_FILE=$< | |
134 else | |
135 SOURCE_FILE=$(shell cygpath -dma $<)#M# | |
136 endif | |
137 | 130 |
138 ## Compilation rules | 131 ## Compilation rules |
139 %.$(STATIC_O): $(srcdir)/%.c | 132 %.$(STATIC_O): $(srcdir)/%.c |
140 » $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $(SOURCE_FILE) | 133 » $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -Fo$@ $< |
141 %.o: $(srcdir)/%.c | 134 %.o: $(srcdir)/%.c |
142 » $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $(SOURCE_FILE) | 135 » $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -Fo$@ $< |
143 | 136 |
144 %.$(STATIC_O): $(srcdir)/%.cpp | 137 %.$(STATIC_O): $(srcdir)/%.cpp |
145 » $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $(SOURCE_FILE) | 138 » $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -Fo$@ $< |
146 %.o: $(srcdir)/%.cpp | 139 %.o: $(srcdir)/%.cpp |
147 » $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $(SOURCE_FILE) | 140 » $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -Fo$@ $< |
148 | 141 |
149 | 142 |
150 ## Dependency rules | 143 ## Dependency rules |
151 ## This is a start to how depdendencies could work | 144 ## This is a start to how depdendencies could work |
152 # The commented out rules may not properly delete the file when ^C is pressed | 145 # The commented out rules may not properly delete the file when ^C is pressed |
153 # or the compiler fails. | 146 # or the compiler fails. |
154 # make currently doesn't like rules with C:\\PROGRA~1\\.. in the depedency. | 147 # make currently doesn't like rules with C:\\PROGRA~1\\.. in the depedency. |
155 # So system headers are ignored by ignoring \\ | 148 # So system headers are ignored by ignoring \\ |
156 %.d : $(srcdir)/%.c | 149 %.d : $(srcdir)/%.c |
157 @echo "generating dependency information for $<" | 150 @echo "generating dependency information for $<" |
(...skipping 10 matching lines...) Expand all Loading... |
168 @$(GEN_DEPS.cc) $< > $@ | 161 @$(GEN_DEPS.cc) $< > $@ |
169 # @echo -n "generating dependency information for " | 162 # @echo -n "generating dependency information for " |
170 # @echo -n "$@ $(basename $<).o : " > $@ | 163 # @echo -n "$@ $(basename $<).o : " > $@ |
171 # @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ | 164 # @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ |
172 # | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \ | 165 # | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \ |
173 # | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@
\ | 166 # | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@
\ |
174 # || (rm -f $@ && echo $@ && false)' | 167 # || (rm -f $@ && echo $@ && false)' |
175 | 168 |
176 ## Compile a Windows resource file | 169 ## Compile a Windows resource file |
177 %.res : $(srcdir)/%.rc | 170 %.res : $(srcdir)/%.rc |
178 » rc.exe /fo$@ $(CPPFLAGS) $(SOURCE_FILE) | 171 » rc.exe -fo$@ $(CPPFLAGS) $< |
179 | 172 |
180 ## Versioned target for a shared library. | 173 ## Versioned target for a shared library. |
181 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | 174 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) |
182 MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) | 175 MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) |
183 | 176 |
184 ## Starting in MSVC 2005, manifest files are required. This reduces the obnoxiou
sness of this feature. | 177 ## Starting in MSVC 2005, manifest files are required. This reduces the obnoxiou
sness of this feature. |
185 POST_SO_BUILD_STEP = @([ -e $<.manifest ] && \ | 178 POST_SO_BUILD_STEP = @([ -e $<.manifest ] && \ |
186 ( echo Embedding manifest into $< && mt.exe -nologo -manifest $<.manifes
t -outputresource:"$<;2" && rm -rf $<.manifest )) \ | 179 ( echo Embedding manifest into $< && mt.exe -nologo -manifest $<.manifes
t -outputresource:"$<;2" && rm -rf $<.manifest )) \ |
187 || true | 180 || true |
188 POST_BUILD_STEP = @([ -e $@.manifest ] && \ | 181 POST_BUILD_STEP = @([ -e $@.manifest ] && \ |
189 ( echo Embedding manifest into $@ && mt.exe -nologo -manifest $@.manifes
t -outputresource:"$@;1" && rm -rf $@.manifest )) \ | 182 ( echo Embedding manifest into $@ && mt.exe -nologo -manifest $@.manifes
t -outputresource:"$@;1" && rm -rf $@.manifest )) \ |
190 || true | 183 || true |
191 | 184 |
192 ## Special pkgdata information that is needed | 185 ## Special pkgdata information that is needed |
193 PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR) | 186 PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR) |
194 ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p $(DESTDIR)$(ICUPKGDATA_DIR) ; cygpat
h -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M# | 187 ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p $(DESTDIR)$(ICUPKGDATA_DIR) ; echo $
(DESTDIR)$(ICUPKGDATA_DIR))#M# |
195 ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p $(DESTDIR)$(libdir) ; cygpath -dma
$(DESTDIR)$(libdir))#M# | 188 ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p $(DESTDIR)$(libdir) ; echo $(DESTD
IR)$(libdir))#M# |
196 | 189 |
197 ## Versioned import library names. The library names are versioned, | 190 ## Versioned import library names. The library names are versioned, |
198 ## but the import libraries do not need versioning. | 191 ## but the import libraries do not need versioning. |
199 IMPORT_LIB = $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)#M# | 192 IMPORT_LIB = $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)#M# |
200 MIDDLE_IMPORT_LIB = $(IMPORT_LIB)#M# | 193 MIDDLE_IMPORT_LIB = $(IMPORT_LIB)#M# |
201 FINAL_IMPORT_LIB = $(MIDDLE_IMPORT_LIB)#M# | 194 FINAL_IMPORT_LIB = $(MIDDLE_IMPORT_LIB)#M# |
202 | 195 |
203 # The following is for Makefile.inc's use. | 196 # The following is for Makefile.inc's use. |
204 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) | 197 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) |
205 | 198 |
(...skipping 12 matching lines...) Expand all Loading... |
218 | 211 |
219 # Environment variable to set a runtime search path | 212 # Environment variable to set a runtime search path |
220 LDLIBRARYPATH_ENVVAR = PATH | 213 LDLIBRARYPATH_ENVVAR = PATH |
221 | 214 |
222 # These are needed to allow the pkgdata nmake files to work | 215 # These are needed to allow the pkgdata nmake files to work |
223 PKGDATA_INVOKE_OPTS = MAKEFLAGS= | 216 PKGDATA_INVOKE_OPTS = MAKEFLAGS= |
224 | 217 |
225 # Include the version information in the shared library | 218 # Include the version information in the shared library |
226 ENABLE_SO_VERSION_DATA=1 | 219 ENABLE_SO_VERSION_DATA=1 |
227 | 220 |
228 ## End Cygwin-specific setup | 221 ## End MSYS-specific setup |
229 | |
OLD | NEW |