make/windows/makefiles/compile.make

Print this page




  93 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_ARCH_$(Platform_arch)
  94 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model)
  95 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch)
  96 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)
  97 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_COMPILER_visCPP
  98 
  99 
 100 # MSC_VER is a 4 digit number that tells us what compiler is being used
 101 #    and is generated when the local.make file is created by build.make
 102 #    via the script get_msc_ver.sh
 103 #
 104 #    If MSC_VER is set, it overrides the above default setting.
 105 #    But it should be set.
 106 #    Possible values:
 107 #      1200 is for VC6
 108 #      1300 and 1310 is VS2003 or VC7
 109 #      1399 is our fake number for the VS2005 compiler that really isn't 1400
 110 #      1400 is for VS2005
 111 #      1500 is for VS2008
 112 #      1600 is for VS2010

 113 #    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 #    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 #    closer to VS2003 in terms of option spellings, so we use 1399 for that
 118 #    1400 version that really isn't 1400.
 119 #    See the file get_msc_ver.sh for more info.
 120 !if "x$(MSC_VER)" == "x"
 121 COMPILER_NAME=$(DEFAULT_COMPILER_NAME)
 122 !else
 123 !if "$(MSC_VER)" == "1200"
 124 COMPILER_NAME=VC6
 125 !endif
 126 !if "$(MSC_VER)" == "1300"
 127 COMPILER_NAME=VS2003
 128 !endif
 129 !if "$(MSC_VER)" == "1310"
 130 COMPILER_NAME=VS2003
 131 !endif
 132 !if "$(MSC_VER)" == "1399"
 133 # Compiler might say 1400, but if it's 14.00.30701, it isn't really VS2005
 134 COMPILER_NAME=VS2003
 135 !endif
 136 !if "$(MSC_VER)" == "1400"
 137 COMPILER_NAME=VS2005
 138 !endif
 139 !if "$(MSC_VER)" == "1500"
 140 COMPILER_NAME=VS2008
 141 !endif
 142 !if "$(MSC_VER)" == "1600"
 143 COMPILER_NAME=VS2010
 144 !endif


 145 !endif

 146 
 147 # 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.
 149 MS_RUNTIME_OPTION = /MD
 150 !if "$(MFC_DEBUG)" == "true"
 151 MS_RUNTIME_OPTION = /MTd /D "_DEBUG"
 152 !endif
 153 



 154 # Always add the _STATIC_CPPLIB flag
 155 STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
 156 MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION)

 157 CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION)
 158 
 159 # How /GX option is spelled
 160 GX_OPTION = /GX
 161 
 162 # Optimization settings for various versions of the compilers and types of
 163 #    builds. Three basic sets of settings: product, fastdebug, and debug.
 164 #    These get added into CXX_FLAGS as needed by other makefiles.
 165 !if "$(COMPILER_NAME)" == "VC6"
 166 PRODUCT_OPT_OPTION   = /Ox /Os /Gy /GF
 167 FASTDEBUG_OPT_OPTION = /Ox /Os /Gy /GF
 168 DEBUG_OPT_OPTION     = /Od
 169 !endif
 170 
 171 !if "$(COMPILER_NAME)" == "VS2003"
 172 PRODUCT_OPT_OPTION   = /O2 /Oy-
 173 FASTDEBUG_OPT_OPTION = /O2 /Oy-
 174 DEBUG_OPT_OPTION     = /Od
 175 !endif
 176 


 191 MT=mt.exe
 192 !endif
 193 !endif
 194 
 195 !if "$(COMPILER_NAME)" == "VS2008"
 196 PRODUCT_OPT_OPTION   = /O2 /Oy-
 197 FASTDEBUG_OPT_OPTION = /O2 /Oy-
 198 DEBUG_OPT_OPTION     = /Od
 199 GX_OPTION = /EHsc
 200 LD_FLAGS = /manifest $(LD_FLAGS)
 201 # Manifest Tool - used in VS2005 and later to adjust manifests stored
 202 # as resources inside build artifacts.
 203 !if "x$(MT)" == "x"
 204 MT=mt.exe
 205 !endif
 206 !endif
 207 
 208 !if "$(COMPILER_NAME)" == "VS2010"
 209 PRODUCT_OPT_OPTION   = /O2 /Oy-
 210 FASTDEBUG_OPT_OPTION = /O2 /Oy-
















 211 DEBUG_OPT_OPTION     = /Od
 212 GX_OPTION = /EHsc
 213 LD_FLAGS = /manifest $(LD_FLAGS)
 214 # Manifest Tool - used in VS2005 and later to adjust manifests stored
 215 # as resources inside build artifacts.
 216 !if "x$(MT)" == "x"
 217 MT=mt.exe
 218 !endif
 219 !if "$(BUILDARCH)" == "i486"
 220 LD_FLAGS = /SAFESEH $(LD_FLAGS)
 221 !endif
 222 !endif
 223 
 224 # If NO_OPTIMIZATIONS is defined in the environment, turn everything off
 225 !ifdef NO_OPTIMIZATIONS
 226 PRODUCT_OPT_OPTION   = $(DEBUG_OPT_OPTION)
 227 FASTDEBUG_OPT_OPTION = $(DEBUG_OPT_OPTION)
 228 !endif
 229 
 230 # Generic linker settings




  93 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_ARCH_$(Platform_arch)
  94 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model)
  95 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch)
  96 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)
  97 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_COMPILER_visCPP
  98 
  99 
 100 # MSC_VER is a 4 digit number that tells us what compiler is being used
 101 #    and is generated when the local.make file is created by build.make
 102 #    via the script get_msc_ver.sh
 103 #
 104 #    If MSC_VER is set, it overrides the above default setting.
 105 #    But it should be set.
 106 #    Possible values:
 107 #      1200 is for VC6
 108 #      1300 and 1310 is VS2003 or VC7
 109 #      1399 is our fake number for the VS2005 compiler that really isn't 1400
 110 #      1400 is for VS2005
 111 #      1500 is for VS2008
 112 #      1600 is for VS2010
 113 #      1700 is for VS2012
 114 #    Do not confuse this MSC_VER with the predefined macro _MSC_VER that the
 115 #    compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.
 116 #    Normally they are the same, but a pre-release of the VS2005 compilers
 117 #    in the Windows 64bit Platform SDK said it was 1400 when it was really
 118 #    closer to VS2003 in terms of option spellings, so we use 1399 for that
 119 #    1400 version that really isn't 1400.
 120 #    See the file get_msc_ver.sh for more info.
 121 !if "x$(MSC_VER)" == "x"
 122 COMPILER_NAME=$(DEFAULT_COMPILER_NAME)
 123 !else
 124 !if "$(MSC_VER)" == "1200"
 125 COMPILER_NAME=VC6
 126 !endif
 127 !if "$(MSC_VER)" == "1300"
 128 COMPILER_NAME=VS2003
 129 !endif
 130 !if "$(MSC_VER)" == "1310"
 131 COMPILER_NAME=VS2003
 132 !endif
 133 !if "$(MSC_VER)" == "1399"
 134 # Compiler might say 1400, but if it's 14.00.30701, it isn't really VS2005
 135 COMPILER_NAME=VS2003
 136 !endif
 137 !if "$(MSC_VER)" == "1400"
 138 COMPILER_NAME=VS2005
 139 !endif
 140 !if "$(MSC_VER)" == "1500"
 141 COMPILER_NAME=VS2008
 142 !endif
 143 !if "$(MSC_VER)" == "1600"
 144 COMPILER_NAME=VS2010
 145 !endif
 146 !if "$(MSC_VER)" == "1700"
 147 COMPILER_NAME=VS2012
 148 !endif
 149 !endif
 150 
 151 # By default, we do not want to use the debug version of the msvcrt.dll file
 152 #   but if MFC_DEBUG is defined in the environment it will be used.
 153 MS_RUNTIME_OPTION = /MD
 154 !if "$(MFC_DEBUG)" == "true"
 155 MS_RUNTIME_OPTION = /MTd /D "_DEBUG"
 156 !endif
 157 
 158 # VS2012 and later won't work with:
 159 #     /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
 160 !if "$(MSC_VER)" < "1700"
 161 # Always add the _STATIC_CPPLIB flag
 162 STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
 163 MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION)
 164 !endif
 165 CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION)
 166 
 167 # How /GX option is spelled
 168 GX_OPTION = /GX
 169 
 170 # Optimization settings for various versions of the compilers and types of
 171 #    builds. Three basic sets of settings: product, fastdebug, and debug.
 172 #    These get added into CXX_FLAGS as needed by other makefiles.
 173 !if "$(COMPILER_NAME)" == "VC6"
 174 PRODUCT_OPT_OPTION   = /Ox /Os /Gy /GF
 175 FASTDEBUG_OPT_OPTION = /Ox /Os /Gy /GF
 176 DEBUG_OPT_OPTION     = /Od
 177 !endif
 178 
 179 !if "$(COMPILER_NAME)" == "VS2003"
 180 PRODUCT_OPT_OPTION   = /O2 /Oy-
 181 FASTDEBUG_OPT_OPTION = /O2 /Oy-
 182 DEBUG_OPT_OPTION     = /Od
 183 !endif
 184 


 199 MT=mt.exe
 200 !endif
 201 !endif
 202 
 203 !if "$(COMPILER_NAME)" == "VS2008"
 204 PRODUCT_OPT_OPTION   = /O2 /Oy-
 205 FASTDEBUG_OPT_OPTION = /O2 /Oy-
 206 DEBUG_OPT_OPTION     = /Od
 207 GX_OPTION = /EHsc
 208 LD_FLAGS = /manifest $(LD_FLAGS)
 209 # Manifest Tool - used in VS2005 and later to adjust manifests stored
 210 # as resources inside build artifacts.
 211 !if "x$(MT)" == "x"
 212 MT=mt.exe
 213 !endif
 214 !endif
 215 
 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"
 233 PRODUCT_OPT_OPTION   = /O2 /Oy-
 234 FASTDEBUG_OPT_OPTION = /O2 /Oy-
 235 DEBUG_OPT_OPTION     = /Od
 236 GX_OPTION = /EHsc
 237 LD_FLAGS = /manifest $(LD_FLAGS)
 238 # Manifest Tool - used in VS2005 and later to adjust manifests stored
 239 # as resources inside build artifacts.
 240 !if "x$(MT)" == "x"
 241 MT=mt.exe
 242 !endif
 243 !if "$(BUILDARCH)" == "i486"
 244 LD_FLAGS = /SAFESEH $(LD_FLAGS)
 245 !endif
 246 !endif
 247 
 248 # If NO_OPTIMIZATIONS is defined in the environment, turn everything off
 249 !ifdef NO_OPTIMIZATIONS
 250 PRODUCT_OPT_OPTION   = $(DEBUG_OPT_OPTION)
 251 FASTDEBUG_OPT_OPTION = $(DEBUG_OPT_OPTION)
 252 !endif
 253 
 254 # Generic linker settings