0N/A#
6040N/A# Copyright (c) 1999, 2013, Oracle and/or its affiliates. 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
2362N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
2362N/A# by Oracle in the LICENSE file that accompanied this code.
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#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
0N/A#
0N/A
0N/A#
0N/A# Makefile to specify compiler flags for programs and libraries
0N/A# targeted to Windows builds. Should not contain any rules.
0N/A#
0N/A# WARNING: This file is shared with other workspaces.
0N/A# So when it includes other files, it must use JDK_TOPDIR.
0N/A#
0N/A
0N/A# Get shared JDK settings
0N/Ainclude $(JDK_MAKE_SHARED_DIR)/Defs.gmk
0N/A
0N/A# CC compiler object code output directive flag value
0N/ACC_OBJECT_OUTPUT_FLAG = -Fo
0N/ACC_PROGRAM_OUTPUT_FLAG = -Fe
0N/A
0N/A# The suffix applied to the library name for FDLIBM
0N/AFDDLIBM_SUFFIX = lib
0N/A# The suffix applied to scripts (.bat for windows, nothing for unix)
0N/ASCRIPT_SUFFIX = .bat
0N/A
0N/A# LIB_LOCATION, which for windows identifies where .exe files go, may be
0N/A# set by each GNUmakefile. The default is BINDIR.
0N/Aifndef LIB_LOCATION
0N/A LIB_LOCATION = $(BINDIR)
0N/Aendif # LIB_LOCATION
0N/A
0N/Aifndef PLATFORM_SRC
7N/A PLATFORM_SRC = $(BUILDDIR)/../src/windows
0N/Aendif # PLATFORM_SRC
0N/A
4924N/A# Location of the various .properties files specific to Windows platform
4924N/Aifndef PLATFORM_PROPERTIES
4924N/A PLATFORM_PROPERTIES = $(BUILDDIR)/../src/windows/lib
4924N/Aendif # PLATFORM_SRC
4924N/A
0N/A# Platform specific closed sources
0N/Aifndef OPENJDK
0N/A ifndef CLOSED_PLATFORM_SRC
7N/A CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/windows
0N/A endif
0N/Aendif
0N/A
0N/A# for backwards compatability, the old "win32" is used here instead of
0N/A# the more proper "windows"
0N/APLATFORM_INCLUDE_NAME = win32
0N/APLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
0N/A
0N/A# The following DLL's are considered MS runtime libraries and should
0N/A# not to be REBASEd, see deploy/make/common/Release.gmk.
3429N/A# msvcr*.dll: Microsoft runtimes
3798N/Aifeq ($(COMPILER_VERSION), VS2010)
3798N/A MSVCRNN_DLL = msvcr100.dll
3798N/A MSVCPNN_DLL = msvcp100.dll
3798N/A MS_RUNTIME_LIBRARIES = $(MSVCRNN_DLL)
942N/Aendif
0N/A
0N/AEXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH)
0N/A
4907N/A# Full Debug Symbols has been enabled on Windows since JDK1.4.1.
4915N/A# The Full Debug Symbols (FDS) default for VARIANT == OPT builds is
4915N/A# enabled with debug info files ZIP'ed to save space. For VARIANT !=
4915N/A# OPT builds, FDS is always enabled, after all a debug build without
4915N/A# debug info isn't very useful. The ZIP_DEBUGINFO_FILES option only has
4915N/A# meaning when FDS is enabled.
4915N/A#
4915N/A# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
4915N/A# disabled for a VARIANT == OPT build.
4915N/A#
4915N/A# Note: Use of a different variable name for the FDS override option
4915N/A# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
4915N/A# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
4915N/A# in options via environment variables, use of distinct variables
4915N/A# prevents strange behaviours. For example, in a VARIANT != OPT build,
4915N/A# the FULL_DEBUG_SYMBOLS environment variable will be 0, but the
4915N/A# ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If the same
4915N/A# variable name is used, then different values can be picked up by
4915N/A# different parts of the build. Just to be clear, we only need two
4915N/A# variable names because the incoming option value can be overridden
4915N/A# in some situations, e.g., a VARIANT != OPT build.
4907N/A
4915N/Aifeq ($(VARIANT), OPT)
4915N/A FULL_DEBUG_SYMBOLS ?= 1
4915N/A ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
4915N/Aelse
4915N/A # debug variants always get Full Debug Symbols (if available)
4915N/A ENABLE_FULL_DEBUG_SYMBOLS = 1
4915N/Aendif
4915N/A_JUNK_ := $(shell \
4915N/A echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
4907N/A
4907N/Aifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
4964N/A ZIP_DEBUGINFO_FILES ?= 1
4907N/Aelse
4907N/A ZIP_DEBUGINFO_FILES=0
4907N/Aendif
4915N/A_JUNK_ := $(shell echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
4907N/A
0N/A# C Compiler flag definitions
0N/A
0N/A#
0N/A# Default optimization
0N/A#
460N/A
460N/Aifndef OPTIMIZATION_LEVEL
460N/A ifeq ($(PRODUCT), java)
460N/A OPTIMIZATION_LEVEL = HIGHER
460N/A else
460N/A OPTIMIZATION_LEVEL = LOWER
460N/A endif
460N/Aendif
1006N/Aifndef FASTDEBUG_OPTIMIZATION_LEVEL
1006N/A FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
1006N/Aendif
460N/A
0N/Aifeq ($(CC_VERSION),msvc)
3798N/A # Visual Studio compiler option definitions:
0N/A # -O1 Favors reduced size over speed (-Og -Os -Oy -Ob2 -Gs -GF -Gy)
0N/A # -O2 Favors speed over reduced size (-Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy)
0N/A # -Ob2 More aggressive inlining
0N/A # -Og Global optimizations
0N/A # -Oi Replace some functions with intrinsic or special forms
3798N/A # -fp:precise (should be the default)
3798N/A # Improve floating point calculations (disables some optimizations)
0N/A # -Os Favor small code
0N/A # -Ot Favor faster code
0N/A # -Oy Frame pointer omission
3798N/A # -G6 Used to be -GB?
0N/A # -GF Pool strings in read-only memory
0N/A # -Gf Pool strings in read-write memory (the default)
0N/A # -Gs Controls stack probess
3798N/A # -GS Adds buffer overflow checks on stacks (the default)
3798N/A # -EHsc Enables exception handling
0N/A # -Gy Function level linking only
0N/A #
460N/A
460N/A CC_OPT/NONE = -Od
460N/A CC_OPT/LOWER = -O2
460N/A CC_OPT/HIGHER = -O3
460N/A CC_OPT/HIGHEST = -O3
460N/A
2324N/A ifeq ($(COMPILER_VERSION), VS2010)
2324N/A # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
2324N/A AUTOMATIC_PCH_OPTION =
2324N/A GX_OPTION = -EHsc
2324N/A GZ_OPTION = -RTC1
795N/A ifeq ($(ARCH_DATA_MODEL), 32)
795N/A CC_OPT/HIGHEST = -O2
795N/A CC_OPT/HIGHER = -O1
795N/A CC_OPT/LOWER = -O1
795N/A else
795N/A CC_OPT/HIGHEST = -O2
795N/A CC_OPT/HIGHER = -O1
795N/A CC_OPT/LOWER = -O1
795N/A endif
795N/A endif
460N/A
0N/Aelse # CC_VERSION
0N/A # GCC not supported, but left for historical reference...
460N/A CC_OPT/NONE =
460N/A CC_OPT/LOWER = -O2
460N/A CC_OPT/HIGHER = -O2
460N/A CC_OPT/HIGHEST = -O3
460N/A
0N/Aendif
0N/A
460N/ACC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
0N/A
0N/A# Select the runtime support library carefully, need to be consistent
0N/A#
3798N/A# Visual Studio Runtime compiler option definitions:
0N/A# -MD Use dynamic multi-threaded runtime library
0N/A# -MDd Use debug version (don't use, doesn't mix with -MD DLL's)
0N/A# -MT Use static multi-threaded runtime library (-ML is going away)
0N/A# -MTd Use static debug version (better than -MDd, no runtime issues)
0N/A# -D_DEBUG Change use of malloc/free/etc to use special debug ones (-MTd)
0N/A#
795N/A# NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcpnn.dll
0N/A#
3798N/A# If MS_RUNTIME_STATIC is requested we may have a problem, it is no longer
3798N/A# supported by VS2010
3798N/Aifneq ($(MS_RUNTIME_STATIC),true)
0N/A MS_RUNTIME_OPTION=-MD
0N/Aendif
0N/A# The _DEBUG macro option (changes things like malloc to use debug version)
0N/AMS_RUNTIME_DEBUG_OPTION=
0N/AMS_RC_DEBUG_OPTION=
0N/A# Externally set environment variable can force any build to use the debug vers
0N/Aifeq ($(MFC_DEBUG), true)
0N/A ifeq ($(MS_RUNTIME_STATIC),true)
0N/A MS_RUNTIME_OPTION=-MTd
0N/A else
0N/A # This MS debugging flag forces a dependence on the debug
3429N/A # version of the runtime library (MSVCR*D.DLL), as does -MDd.
0N/A # We cannot re-distribute this debug runtime.
0N/A MS_RUNTIME_OPTION=-MDd
0N/A endif
0N/A MS_RUNTIME_DEBUG_OPTION= -D_DEBUG
0N/A MS_RC_DEBUG_OPTION= -d _DEBUG
0N/Aendif
0N/A
0N/A# Always add _STATIC_CPPLIB definition
0N/ASTATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB
3262N/A
3262N/A# Silence the warning about using _STATIC_CPPLIB
3262N/Aifneq ($(SHOW_ALL_WARNINGS),true)
3262N/A # Needed with VS2010 to turn off the deprecated warning.
3262N/A STATIC_CPPLIB_OPTION += /D _DISABLE_DEPRECATE_STATIC_CPPLIB
3262N/Aendif
3262N/A
0N/AMS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)
0N/A
0N/Aifeq ($(CC_VERSION),msvc)
3798N/A # Visual Studio compiler option definitions:
0N/A # -Zi Cause *.pdb file to be created, full debug information
0N/A # -Z7 Full debug inside the .obj, no .pdb
0N/A # -Zd Basic debug, no local variables? In the .obj
0N/A # -Zl Don't add runtime library name to obj file?
0N/A # -Od Turns off optimization and speeds compilation
0N/A # -YX -Fp/.../foobar.pch Use precompiled headers (try someday?)
0N/A # -nologo Don't print out startup message
3262N/A # /D _STATIC_CPPLIB
795N/A # Use static link for the C++ runtime (so msvcpnn.dll not needed)
0N/A #
4907N/A ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
4907N/A CFLAGS_COMMON += -Zi
4907N/A endif
4907N/A CFLAGS_COMMON += -nologo
460N/A CFLAGS_OPT = $(CC_OPT)
0N/A CFLAGS_DBG = -Od $(MS_RUNTIME_DEBUG_OPTION)
0N/A
2324N/A CFLAGS_VS2010 += -Zc:wchar_t-
0N/A
0N/A # All builds get the same runtime setting
0N/A CFLAGS_COMMON += $(MS_RUNTIME_OPTION) $(CFLAGS_$(COMPILER_VERSION))
0N/A
4915N/A ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
4915N/A LDEBUG = /debug
4915N/A endif
0N/A
0N/A ifeq ($(VTUNE_SUPPORT), true)
0N/A OTHER_CFLAGS = -Z7 -Ox
0N/A LDEBUG += /pdb:NONE
0N/A endif
0N/A
3524N/A # VS2010, always need safe exception handlers, not needed on 64bit
3524N/A ifeq ($(ARCH_DATA_MODEL), 32)
3798N/A LFLAGS_VS2010 += -SAFESEH
3524N/A endif
795N/A
0N/A # LFLAGS are the flags given to $(LINK) and used to build the actual DLL file
0N/A BASELFLAGS = -nologo /opt:REF /incremental:no
795N/A
0N/A LFLAGS = $(BASELFLAGS) $(LDEBUG) $(EXTRA_LFLAGS) $(LFLAGS_$(COMPILER_VERSION))
0N/A LDDFLAGS += $(LFLAGS_$(COMPILER_VERSION))
0N/A
0N/Aendif
0N/A
0N/A#
0N/A# Preprocessor macro definitions
0N/A#
0N/ACPPFLAGS_COMMON = -DWIN32 -DIAL -D_LITTLE_ENDIAN
0N/Aifeq ($(ARCH), amd64)
0N/A CPPFLAGS_COMMON += -D_AMD64_ -Damd64
0N/Aelse
422N/A CPPFLAGS_COMMON += -D_X86_ -Dx86
0N/Aendif
0N/ACPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN
0N/A
0N/A#
0N/A# Output options (use specific filenames to avoid parallel compile errors)
0N/A#
4915N/Aifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
4915N/A CFLAGS_COMMON += -Fd$(OBJDIR)/$(basename $(@F)).pdb -Fm$(OBJDIR)/$(basename $(@F)).map
4915N/Aendif
0N/A
0N/A#
422N/A# Use -wdNNNN to disable warning NNNN.
422N/A# C4800 is a warning about bool performance casts (can't make go away)
422N/A#
422N/ACOMPILER_WARNINGS_TO_IGNORE = 4800
422N/ACFLAGS_COMMON += $(COMPILER_WARNINGS_TO_IGNORE:%=-wd%)
422N/A
422N/A#
0N/A# Treat compiler warnings as errors, if requested
0N/A#
422N/ACFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL)
0N/Aifeq ($(COMPILER_WARNINGS_FATAL),true)
0N/A CFLAGS_COMMON += -WX
0N/Aendif
0N/A
3262N/A# Turn off some warnings by default, enable them all if asked.
3262N/Aifneq ($(SHOW_ALL_WARNINGS),true)
3262N/A # The -D _CRT_SECURE_NO_DEPRECATE turns off security/deprecated warnings on
3262N/A # the standard C library functions like strcpy.
3262N/A CFLAGS_COMMON += -D _CRT_SECURE_NO_DEPRECATE
3262N/A # The -D _CRT_NONSTDC_NO_DEPRECATE turns off deprecation warnings about using
3262N/A # non-standard C POSIX functions.
3262N/A CFLAGS_COMMON += -D _CRT_NONSTDC_NO_DEPRECATE
3262N/Aendif
3262N/A
1388N/ACPPFLAGS_OPT = -DNDEBUG
0N/ACPPFLAGS_DBG = -DDEBUG -DLOGGING
0N/A
0N/ACXXFLAGS_COMMON = $(CFLAGS_COMMON)
0N/ACXXFLAGS_OPT = $(CFLAGS_OPT)
0N/ACXXFLAGS_DBG = $(CFLAGS_DBG)
0N/A
0N/Aifneq ($(LIBRARY),fdlibm)
0N/A EXTRA_LIBS += advapi32.lib
0N/Aendif
0N/A
0N/A#
0N/A# Path and option to link against the VM, if you have to.
0N/A#
0N/AJVMLIB = $(LIBDIR)/jvm.lib
0N/AJAVALIB = $(LIBDIR)/java.lib
0N/A
0N/Aifeq ($(CC_VERSION), msvc)
0N/A CC_DEPEND = -FD
0N/A CC_DEPEND_FILTER =
0N/Aelse # CC_VERSION
0N/A# not supported, but left for historical reference...
0N/A CC_DEPEND = -MM
0N/A CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)&!g'
0N/Aendif # CC_VERSION
0N/A
0N/ALIBRARY_SUFFIX = dll
0N/ALIB_SUFFIX = lib
0N/A
0N/A# Settings for the JDI - Serviceability Agent binding.
0N/AHOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/bin
0N/ASALIB_NAME = $(LIB_PREFIX)sawindbg.$(LIBRARY_SUFFIX)
0N/ASAMAP_NAME = $(LIB_PREFIX)sawindbg.map
0N/ASAPDB_NAME = $(LIB_PREFIX)sawindbg.pdb
4907N/ASA_DIZ_NAME = $(LIB_PREFIX)sawindbg.diz
0N/A
0N/Aifeq ($(ARCH), ia64)
0N/A # SA will never be supported here.
0N/A INCLUDE_SA = false
0N/Aelse
891N/A INCLUDE_SA = true
0N/Aendif
0N/A
0N/A# Settings for the VERSIONINFO tap on windows.
7N/AVERSIONINFO_RESOURCE = $(BUILDDIR)/../src/windows/resource/version.rc
0N/A
0N/Aifneq ($(JDK_BUILD_NUMBER),)
0N/A COOKED_BUILD_NUMBER = $(shell $(ECHO) $(JDK_BUILD_NUMBER) | $(SED) -e 's/^b//' -e 's/^0//')
0N/Aelse
0N/A COOKED_BUILD_NUMBER = 0
0N/Aendif
0N/A
0N/A# If the update version contains non-numeric characters, we need
0N/A# to massage it into a numeric format.
0N/A# We use the following formula:
0N/A# JDK_UPDATE_VER = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION
0N/A#
0N/A# Here are some examples:
0N/A# 1.5.0 b01 -> 5,0,0,1
0N/A# 1.5.0_10 b01 -> 5,0,100,1
0N/A# 1.4.2 b01 -> 4,2,0,1
0N/A# 1.4.2_02 b01 -> 4,2,20,1
0N/A# 1.4.2_02a b01 -> 4,2,21,1
0N/A# 1.4.2_02b b01 -> 4,2,22,1
0N/Aifdef JDK_UPDATE_VERSION
0N/A VTMP := $(shell $(ECHO) $(JDK_UPDATE_VERSION) | $(TR) "abcde" "12345")
0N/A CAB_CHAR1 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 1, 1);}')
0N/A CAB_CHAR2 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 2, 1);}')
0N/A CAB_CHAR3 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 3, 1);}')
0N/A JDK_UPDATE_META_TAG := U$(MARKETING_NUMBER)
0N/A ifeq ($(CAB_CHAR3),)
0N/A CAB_CHAR3 := 0
0N/A endif
0N/A ifeq ($(CAB_CHAR1), 0)
0N/A JDK_UPDATE_VER := $(CAB_CHAR2)$(CAB_CHAR3)
0N/A else
0N/A JDK_UPDATE_VER := $(CAB_CHAR1)$(CAB_CHAR2)$(CAB_CHAR3)
0N/A endif
0N/Aelse
0N/A JDK_UPDATE_VER := 0
0N/Aendif
0N/A
0N/ARC_FLAGS = /l 0x409 /r
0N/A
0N/Aifeq ($(VARIANT), OPT)
0N/A RC_FLAGS += -d NDEBUG
0N/Aelse
0N/A RC_FLAGS += $(MS_RC_DEBUG_OPTION)
0N/Aendif
0N/A
420N/A# Values for the RC variables defined in RC_FLAGS
420N/AJDK_RC_BUILD_ID = $(FULL_VERSION)
420N/AJDK_RC_COMPANY = $(COMPANY_NAME)
420N/AJDK_RC_COMPONENT = $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) binary
420N/AJDK_RC_VER = \
420N/A $(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
420N/AJDK_RC_COPYRIGHT = Copyright \xA9 $(COPYRIGHT_YEAR)
420N/AJDK_RC_NAME = \
420N/A $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) $(JDK_MINOR_VERSION) $(JDK_UPDATE_META_TAG)
420N/AJDK_RC_FVER = \
420N/A $(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER)
0N/A
1365N/A# JDK name required here
1365N/ARC_FLAGS += -d "JDK_BUILD_ID=$(JDK_RC_BUILD_ID)" \
1365N/A -d "JDK_COMPANY=$(JDK_RC_COMPANY)" \
1365N/A -d "JDK_COMPONENT=$(JDK_RC_COMPONENT)" \
1365N/A -d "JDK_VER=$(JDK_RC_VER)" \
1365N/A -d "JDK_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \
1365N/A -d "JDK_NAME=$(JDK_RC_NAME)" \
1365N/A -d "JDK_FVER=$(JDK_RC_FVER)"