make/windows/makefiles/compile.make

changeset 5417
33c52908bcdb
parent 5046
0380df7c3cd0
child 5842
febab3a8f203
child 5877
7638e35cabc6
equal deleted inserted replaced
5416:ee9e76adced3 5417:33c52908bcdb
1 # 1 #
2 # Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2 # Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 # 4 #
5 # This code is free software; you can redistribute it and/or modify it 5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as 6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. 7 # published by the Free Software Foundation.
108 # 1300 and 1310 is VS2003 or VC7 108 # 1300 and 1310 is VS2003 or VC7
109 # 1399 is our fake number for the VS2005 compiler that really isn't 1400 109 # 1399 is our fake number for the VS2005 compiler that really isn't 1400
110 # 1400 is for VS2005 110 # 1400 is for VS2005
111 # 1500 is for VS2008 111 # 1500 is for VS2008
112 # 1600 is for VS2010 112 # 1600 is for VS2010
113 # 1700 is for VS2012
113 # Do not confuse this MSC_VER with the predefined macro _MSC_VER that the 114 # Do not confuse this MSC_VER with the predefined macro _MSC_VER that the
114 # compiler provides, when MSC_VER==1399, _MSC_VER will be 1400. 115 # compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.
115 # Normally they are the same, but a pre-release of the VS2005 compilers 116 # Normally they are the same, but a pre-release of the VS2005 compilers
116 # in the Windows 64bit Platform SDK said it was 1400 when it was really 117 # in the Windows 64bit Platform SDK said it was 1400 when it was really
117 # closer to VS2003 in terms of option spellings, so we use 1399 for that 118 # closer to VS2003 in terms of option spellings, so we use 1399 for that
140 COMPILER_NAME=VS2008 141 COMPILER_NAME=VS2008
141 !endif 142 !endif
142 !if "$(MSC_VER)" == "1600" 143 !if "$(MSC_VER)" == "1600"
143 COMPILER_NAME=VS2010 144 COMPILER_NAME=VS2010
144 !endif 145 !endif
146 !if "$(MSC_VER)" == "1700"
147 COMPILER_NAME=VS2012
148 !endif
145 !endif 149 !endif
146 150
147 # By default, we do not want to use the debug version of the msvcrt.dll file 151 # By default, we do not want to use the debug version of the msvcrt.dll file
148 # but if MFC_DEBUG is defined in the environment it will be used. 152 # but if MFC_DEBUG is defined in the environment it will be used.
149 MS_RUNTIME_OPTION = /MD 153 MS_RUNTIME_OPTION = /MD
150 !if "$(MFC_DEBUG)" == "true" 154 !if "$(MFC_DEBUG)" == "true"
151 MS_RUNTIME_OPTION = /MTd /D "_DEBUG" 155 MS_RUNTIME_OPTION = /MTd /D "_DEBUG"
152 !endif 156 !endif
153 157
158 # VS2012 and later won't work with:
159 # /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
160 !if "$(MSC_VER)" < "1700"
154 # Always add the _STATIC_CPPLIB flag 161 # Always add the _STATIC_CPPLIB flag
155 STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB 162 STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
156 MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION) 163 MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION)
164 !endif
157 CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION) 165 CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION)
158 166
159 # How /GX option is spelled 167 # How /GX option is spelled
160 GX_OPTION = /GX 168 GX_OPTION = /GX
161 169
204 MT=mt.exe 212 MT=mt.exe
205 !endif 213 !endif
206 !endif 214 !endif
207 215
208 !if "$(COMPILER_NAME)" == "VS2010" 216 !if "$(COMPILER_NAME)" == "VS2010"
217 PRODUCT_OPT_OPTION = /O2 /Oy-
218 FASTDEBUG_OPT_OPTION = /O2 /Oy-
219 DEBUG_OPT_OPTION = /Od
220 GX_OPTION = /EHsc
221 LD_FLAGS = /manifest $(LD_FLAGS)
222 # Manifest Tool - used in VS2005 and later to adjust manifests stored
223 # as resources inside build artifacts.
224 !if "x$(MT)" == "x"
225 MT=mt.exe
226 !endif
227 !if "$(BUILDARCH)" == "i486"
228 LD_FLAGS = /SAFESEH $(LD_FLAGS)
229 !endif
230 !endif
231
232 !if "$(COMPILER_NAME)" == "VS2012"
209 PRODUCT_OPT_OPTION = /O2 /Oy- 233 PRODUCT_OPT_OPTION = /O2 /Oy-
210 FASTDEBUG_OPT_OPTION = /O2 /Oy- 234 FASTDEBUG_OPT_OPTION = /O2 /Oy-
211 DEBUG_OPT_OPTION = /Od 235 DEBUG_OPT_OPTION = /Od
212 GX_OPTION = /EHsc 236 GX_OPTION = /EHsc
213 LD_FLAGS = /manifest $(LD_FLAGS) 237 LD_FLAGS = /manifest $(LD_FLAGS)

mercurial