compile.make revision 427
0N/A#
196N/A# Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
0N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A# CA 95054 USA or visit www.sun.com if you need additional information or
0N/A# have any questions.
0N/A#
0N/A#
0N/A
0N/A# Generic compiler settings
0N/ACPP=cl.exe
0N/A
0N/A# CPP Flags: (these vary slightly from VC6->VS2003->VS2005 compilers)
0N/A# /nologo Supress copyright message at every cl.exe startup
0N/A# /W3 Warning level 3
0N/A# /Zi Include debugging information
0N/A# /WX Treat any warning error as a fatal error
427N/A# /MD Use dynamic multi-threaded runtime (msvcrt.dll or msvc*NN.dll)
0N/A# /MTd Use static multi-threaded runtime debug versions
0N/A# /O1 Optimize for size (/Os), skips /Oi
0N/A# /O2 Optimize for speed (/Ot), adds /Oi to /O1
0N/A# /Ox Old "all optimizations flag" for VC6 (in /O1)
0N/A# /Oy Use frame pointer register as GP reg (in /Ox and /O1)
0N/A# /GF Merge string constants and put in read-only memory (in /O1)
0N/A# /Gy Func level link (in /O1, allows for link-time func ordering)
0N/A# /Gs Inserts stack probes (in /O1)
0N/A# /GS Inserts security stack checks in some functions (VS2005 default)
0N/A# /Oi Use intrinsics (in /O2)
0N/A# /Od Disable all optimizations
0N/A#
0N/A# NOTE: Normally following any of the above with a '-' will turn off that flag
57N/A#
57N/A# 6655385: For VS2003/2005 we now specify /Oy- (disable frame pointer
57N/A# omission.) This has little to no effect on performance while vastly
57N/A# improving the quality of crash log stack traces involving jvm.dll.
0N/A
0N/A# These are always used in all compiles
0N/ACPP_FLAGS=/nologo /W3 /WX
0N/A
0N/A# Let's add debug information always too.
0N/ACPP_FLAGS=$(CPP_FLAGS) /Zi
0N/A
0N/A# Based on BUILDARCH we add some flags and select the default compiler name
0N/A!if "$(BUILDARCH)" == "ia64"
0N/AMACHINE=IA64
0N/ADEFAULT_COMPILER_NAME=VS2003
0N/ACPP_FLAGS=$(CPP_FLAGS) /D "CC_INTERP" /D "_LP64" /D "IA64"
0N/A!endif
0N/A
0N/A!if "$(BUILDARCH)" == "amd64"
0N/AMACHINE=AMD64
0N/ADEFAULT_COMPILER_NAME=VS2005
0N/ACPP_FLAGS=$(CPP_FLAGS) /D "_LP64" /D "AMD64"
0N/ALP64=1
0N/A!endif
0N/A
0N/A!if "$(BUILDARCH)" == "i486"
0N/AMACHINE=I386
0N/ADEFAULT_COMPILER_NAME=VS2003
0N/ACPP_FLAGS=$(CPP_FLAGS) /D "IA32"
0N/A!endif
0N/A
0N/A# Sanity check, this is the default if not amd64, ia64, or i486
0N/A!ifndef DEFAULT_COMPILER_NAME
0N/ACPP=ARCH_ERROR
0N/A!endif
0N/A
427N/A# MSC_VER is a 4 digit number that tells us what compiler is being used
427N/A# and is generated when the local.make file is created by build.make
427N/A# via the script get_msc_ver.sh
427N/A#
0N/A# If MSC_VER is set, it overrides the above default setting.
0N/A# But it should be set.
0N/A# Possible values:
0N/A# 1200 is for VC6
0N/A# 1300 and 1310 is VS2003 or VC7
0N/A# 1399 is our fake number for the VS2005 compiler that really isn't 1400
0N/A# 1400 is for VS2005
427N/A# 1500 is for VS2008
0N/A# Do not confuse this MSC_VER with the predefined macro _MSC_VER that the
0N/A# compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.
0N/A# Normally they are the same, but a pre-release of the VS2005 compilers
0N/A# in the Windows 64bit Platform SDK said it was 1400 when it was really
0N/A# closer to VS2003 in terms of option spellings, so we use 1399 for that
0N/A# 1400 version that really isn't 1400.
427N/A# See the file get_msc_ver.sh for more info.
0N/A!if "x$(MSC_VER)" == "x"
0N/ACOMPILER_NAME=$(DEFAULT_COMPILER_NAME)
0N/A!else
0N/A!if "$(MSC_VER)" == "1200"
0N/ACOMPILER_NAME=VC6
0N/A!endif
0N/A!if "$(MSC_VER)" == "1300"
0N/ACOMPILER_NAME=VS2003
0N/A!endif
0N/A!if "$(MSC_VER)" == "1310"
0N/ACOMPILER_NAME=VS2003
0N/A!endif
0N/A!if "$(MSC_VER)" == "1399"
0N/A# Compiler might say 1400, but if it's 14.00.30701, it isn't really VS2005
0N/ACOMPILER_NAME=VS2003
0N/A!endif
0N/A!if "$(MSC_VER)" == "1400"
0N/ACOMPILER_NAME=VS2005
0N/A!endif
427N/A!if "$(MSC_VER)" == "1500"
427N/ACOMPILER_NAME=VS2008
427N/A!endif
0N/A!endif
0N/A
0N/A# Add what version of the compiler we think this is to the compile line
0N/ACPP_FLAGS=$(CPP_FLAGS) /D "MSC_VER=$(MSC_VER)"
0N/A
0N/A# By default, we do not want to use the debug version of the msvcrt.dll file
0N/A# but if MFC_DEBUG is defined in the environment it will be used.
0N/AMS_RUNTIME_OPTION = /MD
0N/A!if "$(MFC_DEBUG)" == "true"
0N/AMS_RUNTIME_OPTION = /MTd /D "_DEBUG"
0N/A!endif
0N/A
0N/A# Always add the _STATIC_CPPLIB flag
0N/ASTATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB
0N/AMS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION)
0N/ACPP_FLAGS=$(CPP_FLAGS) $(MS_RUNTIME_OPTION)
0N/A
0N/A# How /GX option is spelled
0N/AGX_OPTION = /GX
0N/A
0N/A# Optimization settings for various versions of the compilers and types of
0N/A# builds. Three basic sets of settings: product, fastdebug, and debug.
0N/A# These get added into CPP_FLAGS as needed by other makefiles.
0N/A!if "$(COMPILER_NAME)" == "VC6"
0N/APRODUCT_OPT_OPTION = /Ox /Os /Gy /GF
0N/AFASTDEBUG_OPT_OPTION = /Ox /Os /Gy /GF
0N/ADEBUG_OPT_OPTION = /Od
0N/A!endif
0N/A
0N/A!if "$(COMPILER_NAME)" == "VS2003"
57N/APRODUCT_OPT_OPTION = /O2 /Oy-
57N/AFASTDEBUG_OPT_OPTION = /O2 /Oy-
0N/ADEBUG_OPT_OPTION = /Od
0N/A!endif
0N/A
0N/A!if "$(COMPILER_NAME)" == "VS2005"
57N/APRODUCT_OPT_OPTION = /O2 /Oy-
57N/AFASTDEBUG_OPT_OPTION = /O2 /Oy-
0N/ADEBUG_OPT_OPTION = /Od
0N/AGX_OPTION = /EHsc
0N/A# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib
0N/A# on the link command line, otherwise we get missing __security_check_cookie
0N/A# externals at link time. Even with /GS-, you need bufferoverflowU.lib.
0N/A# NOTE: Currently we decided to not use /GS-
0N/ABUFFEROVERFLOWLIB = bufferoverflowU.lib
427N/ALINK_FLAGS = /manifest $(LINK_FLAGS) $(BUFFEROVERFLOWLIB)
427N/A# Manifest Tool - used in VS2005 and later to adjust manifests stored
427N/A# as resources inside build artifacts.
427N/AMT=mt.exe
427N/A!if "$(BUILDARCH)" == "i486"
427N/A# VS2005 on x86 restricts the use of certain libc functions without this
427N/ACPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_DEPRECATE
427N/A!endif
427N/A!endif
427N/A
427N/A!if "$(COMPILER_NAME)" == "VS2008"
427N/APRODUCT_OPT_OPTION = /O2 /Oy-
427N/AFASTDEBUG_OPT_OPTION = /O2 /Oy-
427N/ADEBUG_OPT_OPTION = /Od
427N/AGX_OPTION = /EHsc
427N/ALINK_FLAGS = /manifest $(LINK_FLAGS)
427N/A# Manifest Tool - used in VS2005 and later to adjust manifests stored
427N/A# as resources inside build artifacts.
427N/AMT=mt.exe
0N/A!if "$(BUILDARCH)" == "i486"
0N/A# VS2005 on x86 restricts the use of certain libc functions without this
0N/ACPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_DEPRECATE
0N/A!endif
0N/A!endif
0N/A
0N/A# Compile for space above time.
0N/A!if "$(Variant)" == "kernel"
57N/APRODUCT_OPT_OPTION = /O1 /Oy-
57N/AFASTDEBUG_OPT_OPTION = /O1 /Oy-
0N/ADEBUG_OPT_OPTION = /Od
0N/A!endif
0N/A
0N/A# If NO_OPTIMIZATIONS is defined in the environment, turn everything off
0N/A!ifdef NO_OPTIMIZATIONS
0N/APRODUCT_OPT_OPTION = $(DEBUG_OPT_OPTION)
0N/AFASTDEBUG_OPT_OPTION = $(DEBUG_OPT_OPTION)
0N/A!endif
0N/A
0N/A# Generic linker settings
0N/ALINK=link.exe
0N/ALINK_FLAGS= $(LINK_FLAGS) kernel32.lib user32.lib gdi32.lib winspool.lib \
0N/A comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
0N/A uuid.lib Wsock32.lib winmm.lib /nologo /machine:$(MACHINE) /opt:REF \
0N/A /opt:ICF,8 /map /debug
0N/A
0N/A# Resource compiler settings
0N/ARC=rc.exe
0N/ARC_FLAGS=/D "HS_VER=$(HS_VER)" \
0N/A /D "HS_DOTVER=$(HS_DOTVER)" \
0N/A /D "HS_BUILD_ID=$(HS_BUILD_ID)" \
0N/A /D "JDK_VER=$(JDK_VER)" \
0N/A /D "JDK_DOTVER=$(JDK_DOTVER)" \
0N/A /D "HS_COMPANY=$(HS_COMPANY)" \
0N/A /D "HS_FILEDESC=$(HS_FILEDESC)" \
0N/A /D "HS_COPYRIGHT=$(HS_COPYRIGHT)" \
0N/A /D "HS_FNAME=$(HS_FNAME)" \
0N/A /D "HS_INTERNAL_NAME=$(HS_INTERNAL_NAME)" \
0N/A /D "HS_NAME=$(HS_NAME)"
0N/A
0N/A# Need this to match the CPP_FLAGS settings
0N/A!if "$(MFC_DEBUG)" == "true"
0N/ARC_FLAGS = $(RC_FLAGS) /D "_DEBUG"
0N/A!endif
0N/A