corba/make/common/Defs-windows.gmk
author ohair
Tue, 25 May 2010 15:52:11 -0700
changeset 5555 b2b5ed3f0d0d
parent 5385 8308e15f228e
child 6551 476ed8653670
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
#
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 5385
diff changeset
     2
# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
#
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 5385
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 5385
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
#
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 5385
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 5385
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 5385
diff changeset
    23
# questions.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
# Makefile to specify compiler flags for programs and libraries
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
# targeted to Windows builds.  Should not contain any rules.
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
# Get shared JDK settings
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
include $(BUILDDIR)/common/shared/Defs.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
# CC compiler object code output directive flag value
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
CC_OBJECT_OUTPUT_FLAG = -Fo
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
CC_PROGRAM_OUTPUT_FLAG = -Fe
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
# The suffix applied to the library name for FDLIBM
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
FDDLIBM_SUFFIX = lib
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
# The suffix applied to scripts (.bat for windows, nothing for unix)
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
SCRIPT_SUFFIX = .bat
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
HPIS = windows
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
# LIB_LOCATION, which for windows identifies where .exe files go, may be
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
# set by each GNUmakefile. The default is BINDIR.
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
ifndef LIB_LOCATION
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
  LIB_LOCATION = $(BINDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
endif # LIB_LOCATION
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
ifndef PLATFORM_SRC
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
  PLATFORM_SRC  = $(TOPDIR)/src/windows
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
endif # PLATFORM_SRC
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
# for backwards compatability, the old "win32" is used here instead of 
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
# the more proper "windows"
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
PLATFORM_INCLUDE_NAME = win32
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
# The following DLL's are considered MS runtime libraries and should
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
#     not to be REBASEd, see deploy/make/common/Release.gmk.
1347
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    61
#     msvcrt.dll, msvcrnn.dll [msvcr71 or msvcr80 or msvcr90] : Microsoft runtimes
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
MS_RUNTIME_LIBRARIES = msvcrt.dll
1347
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    63
MSVCRNN_DLL =
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
ifeq ($(ARCH_DATA_MODEL), 32)
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
  ifeq ($(COMPILER_VERSION), VS2003)
1347
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    66
    MSVCRNN_DLL = msvcr71.dll
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    67
    MSVCPNN_DLL = msvcp71.dll
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    68
    MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    69
  endif
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    70
  ifeq ($(COMPILER_VERSION), VS2005)
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    71
    MSVCRNN_DLL = msvcr80.dll
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    72
    MSVCPNN_DLL = msvcp80.dll
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    73
    MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    74
  endif
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    75
  ifeq ($(COMPILER_VERSION), VS2008)
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    76
    MSVCRNN_DLL = msvcr90.dll
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    77
    MSVCPNN_DLL = msvcp90.dll
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
    78
    MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
  endif
5385
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
    80
  ifeq ($(COMPILER_VERSION), VS2010)
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
    81
    MSVCRNN_DLL = msvcr100.dll
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
    82
    MSVCPNN_DLL = msvcp100.dll
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
    83
    MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
    84
  endif
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
# C Compiler flag definitions
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
# Default optimization
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
ifeq ($(CC_VERSION),msvc)
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
  # Visual Studio .NET 2003 or VS2003 compiler option definitions:
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
  #   -O1      Favors reduced size over speed (-Og     -Os -Oy -Ob2 -Gs -GF -Gy)
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
  #   -O2      Favors speed over reduced size (-Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy)
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
  #   -Ox      Full optimization (use -O2)    (-Og -Oi -Ot -Oy -Ob2)
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
  #              (Removed in Visual Studio 2005 or VS2005)
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
  #   -Ob2     More aggressive inlining
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
  #   -Og      Global optimizations
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
  #   -Oi      Replace some functions with intrinsic or special forms
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
  #   -Op      Improve floating point calculations (disables some optimizations)
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
  #              (Replaced with -fp:precise in VS2005, /Op is default now)
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
  #   -Os      Favor small code
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
  #   -Ot      Favor faster code
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
  #   -Oy      Frame pointer omission
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
  #   -GB      Optimize for pentium (old VC6 option?)
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
  #   -G6      VS2003 version of -GB?
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
  #   -GF      Pool strings in read-only memory
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
  #   -Gf      Pool strings in read-write memory (the default)
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
  #   -Gs      Controls stack probess
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
  #   -GS      Adds buffer overflow checks on stacks
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
  #              (Default in VS2005)
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
  #   -GX      Enables exception handling 
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
  #              (Replaced with /EHsc in VS2005)
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
  #   -Gy      Function level linking only
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
  #
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
  # NOTE: With VC6, -Ox included -Gs.
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
  # NOTE: With VC6, -Ox, -O1, and -O2 used -Ob1, not -Ob2.
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
  # NOTE: With VC6, -O1 and -O2 used -Gf, not -GF.
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
  #
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
  ifeq ($(COMPILER_VERSION), VC6)
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
    # VC6 (6.2) msvc compiler (the way Tiger and early Mustang were built)
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
    # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
    AUTOMATIC_PCH_OPTION =
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
    GX_OPTION = -GX
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
    ifeq ($(ARCH_DATA_MODEL), 32)
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
      CC_HIGHEST_OPT = -Ox -Gy -Os -GB
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
      CC_HIGHER_OPT  = -Ox -Gy -Os -GB
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
      CC_LOWER_OPT   = -Ox -Gy -Os -GB
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
    else
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
      CC_HIGHEST_OPT = -Ox -Gy -Op
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
      CC_HIGHER_OPT  = -Ox -Gy -Op
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
      CC_LOWER_OPT   = -Ox -Gy -Op
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
    endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
  ifeq ($(COMPILER_VERSION), VS2003)
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
    # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
    AUTOMATIC_PCH_OPTION = -YX
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
    # Also known as VC7 compiler
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
    GX_OPTION = -GX
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
    ifeq ($(ARCH_DATA_MODEL), 32)
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
      # Lowered opt level to try and reduce footprint, dll size especially.
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
      #     Was: CC_HIGHEST_OPT = -O2 -G6
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
      #     Was: CC_HIGHER_OPT  = -O2
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
      CC_HIGHEST_OPT = -O2
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
      CC_HIGHER_OPT  = -O1
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
      CC_LOWER_OPT   = -O1
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
    else
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
      CC_HIGHEST_OPT = -O2 -Op
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
      CC_HIGHER_OPT  = -O2 -Op
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
      CC_LOWER_OPT   = -O1 -Op
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
    endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
  ifeq ($(COMPILER_VERSION), VS2005)
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
    # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
    AUTOMATIC_PCH_OPTION =
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
    # VS2005 compiler, only with Platform SDK right now?
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
    GX_OPTION = -EHsc
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
    ifeq ($(ARCH_DATA_MODEL), 32)
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
      CC_HIGHEST_OPT = -O2
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
      CC_HIGHER_OPT  = -O1
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
      CC_LOWER_OPT   = -O1
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
    else
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
      CC_HIGHEST_OPT = -O2
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
      CC_HIGHER_OPT  = -O1
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
      CC_LOWER_OPT   = -O1
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
    endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
  endif
1347
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   169
  ifeq ($(COMPILER_VERSION), VS2008)
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   170
    # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   171
    AUTOMATIC_PCH_OPTION =
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   172
    GX_OPTION = -EHsc
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   173
    ifeq ($(ARCH_DATA_MODEL), 32)
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   174
      CC_HIGHEST_OPT = -O2
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   175
      CC_HIGHER_OPT  = -O1
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   176
      CC_LOWER_OPT   = -O1
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   177
    else
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   178
      CC_HIGHEST_OPT = -O2
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   179
      CC_HIGHER_OPT  = -O1
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   180
      CC_LOWER_OPT   = -O1
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   181
    endif
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   182
  endif
5385
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   183
  ifeq ($(COMPILER_VERSION), VS2010)
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   184
    # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   185
    AUTOMATIC_PCH_OPTION =
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   186
    GX_OPTION = -EHsc
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   187
    ifeq ($(ARCH_DATA_MODEL), 32)
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   188
      CC_HIGHEST_OPT = -O2
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   189
      CC_HIGHER_OPT  = -O1
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   190
      CC_LOWER_OPT   = -O1
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   191
    else
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   192
      CC_HIGHEST_OPT = -O2
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   193
      CC_HIGHER_OPT  = -O1
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   194
      CC_LOWER_OPT   = -O1
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   195
    endif
8308e15f228e 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 3124
diff changeset
   196
  endif
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
  CC_NO_OPT      = -Od
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
else # CC_VERSION
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
  # GCC not supported, but left for historical reference...
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
  CC_HIGHEST_OPT = -O3
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
  CC_HIGHER_OPT  = -O2
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
  CC_LOWER_OPT   = -O2
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
  CC_NO_OPT      = 
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
# If NO_OPTIMIZATIONS is defined in the environment, turn all optimzations off
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
ifdef NO_OPTIMIZATIONS
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
  CC_HIGHEST_OPT = $(CC_NO_OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
  CC_HIGHER_OPT  = $(CC_NO_OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
  CC_LOWER_OPT   = $(CC_NO_OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
ifeq ($(PRODUCT), java)
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
    _OPT = $(CC_HIGHER_OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
    _OPT = $(CC_LOWER_OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
# Select the runtime support library carefully, need to be consistent
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
# VS2003 compiler option definitions:
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
#   -MD        Use dynamic multi-threaded runtime library
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
#   -MDd       Use debug version (don't use, doesn't mix with -MD DLL's)
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
#   -MT        Use static multi-threaded runtime library (-ML is going away)
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
#   -MTd       Use static debug version (better than -MDd, no runtime issues)
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
#   -D_DEBUG   Change use of malloc/free/etc to use special debug ones (-MTd)
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
#
1347
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   228
#      NOTE: We also will use /D _STATIC_CPPLIB  so we don't need msvcpnn.dll
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
ifeq ($(MS_RUNTIME_STATIC),true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
  MS_RUNTIME_OPTION=-MT
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
  MS_RUNTIME_OPTION=-MD
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
# The _DEBUG macro option (changes things like malloc to use debug version)
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
MS_RUNTIME_DEBUG_OPTION=
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
MS_RC_DEBUG_OPTION=
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
# Externally set environment variable can force any build to use the debug vers
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
ifeq ($(MFC_DEBUG), true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
  ifeq ($(MS_RUNTIME_STATIC),true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
    MS_RUNTIME_OPTION=-MTd
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
  else
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
    # This MS debugging flag forces a dependence on the debug
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
    #     version of the runtime library (MSVCRTD.DLL), as does -MDd.
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
    #     We cannot re-distribute this debug runtime.
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
    MS_RUNTIME_OPTION=-MDd
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
  MS_RUNTIME_DEBUG_OPTION= -D_DEBUG
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
  MS_RC_DEBUG_OPTION= -d _DEBUG
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
# Always add _STATIC_CPPLIB definition
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
ifeq ($(CC_VERSION),msvc)
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
  # VS2003 compiler option definitions:
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
  #   -Zi      Cause *.pdb file to be created, full debug information
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
  #   -Z7      Full debug inside the .obj, no .pdb
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
  #   -Zd      Basic debug, no local variables? In the .obj
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
  #   -Zl      Don't add runtime library name to obj file?
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
  #   -Od      Turns off optimization and speeds compilation
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
  #   -YX -Fp/.../foobar.pch   Use precompiled headers (try someday?)
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
  #   -nologo  Don't print out startup message
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
  #   /D _STATIC_CPPLIB  
1347
1b32e0d45be0 6759959: VS2008 errors compiling corba sources
tbell
parents: 4
diff changeset
   266
  #            Use static link for the C++ runtime (so msvcpnn.dll not needed)
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
  #   
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
  CFLAGS_COMMON  += -Zi -nologo
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
  CFLAGS_OPT      = $(POPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
  CFLAGS_DBG      = -Od $(MS_RUNTIME_DEBUG_OPTION)
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
  # Starting from VS2005 the wchar_t is handled as a built-in C/C++ data type
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
  # by default. However, we expect the wchar_t to be a typedef to the
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
  # unsigned short data type. The -Zc:wchar_t- option restores the old
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
  # behavior (as seen in VS2003) to avoid massive code modifications.
02bb8761fcce Initial load
duke
parents:
diff changeset
   276
  # When/if our code will be "C/C++ Standard"-compliant (at least in the area
02bb8761fcce Initial load
duke
parents:
diff changeset
   277
  # of handling the wchar_t type), the option won't be necessary.
02bb8761fcce Initial load
duke
parents:
diff changeset
   278
  ifeq ($(ARCH_DATA_MODEL), 32)
02bb8761fcce Initial load
duke
parents:
diff changeset
   279
    CFLAGS_VS2005 += -Zc:wchar_t-
02bb8761fcce Initial load
duke
parents:
diff changeset
   280
  else
02bb8761fcce Initial load
duke
parents:
diff changeset
   281
    # The 64bit Platform SDK we use (April 2005) doesn't like this option
02bb8761fcce Initial load
duke
parents:
diff changeset
   282
    ifneq ($(CC_VER), 14.00.40310.41)
02bb8761fcce Initial load
duke
parents:
diff changeset
   283
      CFLAGS_VS2005 += -Zc:wchar_t-
02bb8761fcce Initial load
duke
parents:
diff changeset
   284
    endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   285
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   286
02bb8761fcce Initial load
duke
parents:
diff changeset
   287
  # All builds get the same runtime setting
02bb8761fcce Initial load
duke
parents:
diff changeset
   288
  CFLAGS_COMMON += $(MS_RUNTIME_OPTION) $(CFLAGS_$(COMPILER_VERSION))
02bb8761fcce Initial load
duke
parents:
diff changeset
   289
  
02bb8761fcce Initial load
duke
parents:
diff changeset
   290
02bb8761fcce Initial load
duke
parents:
diff changeset
   291
  LDEBUG = /debug
02bb8761fcce Initial load
duke
parents:
diff changeset
   292
  
02bb8761fcce Initial load
duke
parents:
diff changeset
   293
  ifeq ($(VTUNE_SUPPORT), true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   294
    OTHER_CFLAGS = -Z7 -Ox 
02bb8761fcce Initial load
duke
parents:
diff changeset
   295
    LDEBUG += /pdb:NONE
02bb8761fcce Initial load
duke
parents:
diff changeset
   296
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   297
  
02bb8761fcce Initial load
duke
parents:
diff changeset
   298
  # The new Platform SDK and VS2005 has /GS as a default and requires 
02bb8761fcce Initial load
duke
parents:
diff changeset
   299
  #    bufferoverflowU.lib on the link command line, otherwise 
02bb8761fcce Initial load
duke
parents:
diff changeset
   300
  #    we get missing __security_check_cookie externals at link time. 
02bb8761fcce Initial load
duke
parents:
diff changeset
   301
  BUFFEROVERFLOWLIB = bufferoverflowU.lib
02bb8761fcce Initial load
duke
parents:
diff changeset
   302
  # Always add bufferoverflowU.lib to VS2005 link commands (pack uses LDDFLAGS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   303
  LFLAGS_VS2005 = $(BUFFEROVERFLOWLIB)
02bb8761fcce Initial load
duke
parents:
diff changeset
   304
02bb8761fcce Initial load
duke
parents:
diff changeset
   305
  # LFLAGS are the flags given to $(LINK) and used to build the actual DLL file
02bb8761fcce Initial load
duke
parents:
diff changeset
   306
  BASELFLAGS = -nologo /opt:REF /incremental:no
02bb8761fcce Initial load
duke
parents:
diff changeset
   307
  LFLAGS = $(BASELFLAGS) $(LDEBUG) $(EXTRA_LFLAGS) $(LFLAGS_$(COMPILER_VERSION))
02bb8761fcce Initial load
duke
parents:
diff changeset
   308
  LDDFLAGS += $(LFLAGS_$(COMPILER_VERSION))
02bb8761fcce Initial load
duke
parents:
diff changeset
   309
  
02bb8761fcce Initial load
duke
parents:
diff changeset
   310
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   311
02bb8761fcce Initial load
duke
parents:
diff changeset
   312
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   313
# Preprocessor macro definitions
02bb8761fcce Initial load
duke
parents:
diff changeset
   314
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   315
CPPFLAGS_COMMON = -DWIN32 -DIAL -D_LITTLE_ENDIAN
02bb8761fcce Initial load
duke
parents:
diff changeset
   316
ifeq ($(ARCH), amd64)
02bb8761fcce Initial load
duke
parents:
diff changeset
   317
  CPPFLAGS_COMMON += -D_AMD64_ -Damd64
02bb8761fcce Initial load
duke
parents:
diff changeset
   318
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   319
  CPPFLAGS_COMMON += -DWIN32 -D_X86_ -Dx86 
02bb8761fcce Initial load
duke
parents:
diff changeset
   320
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   321
CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN
02bb8761fcce Initial load
duke
parents:
diff changeset
   322
02bb8761fcce Initial load
duke
parents:
diff changeset
   323
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   324
# Output options (use specific filenames to avoid parallel compile errors)
02bb8761fcce Initial load
duke
parents:
diff changeset
   325
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   326
CFLAGS_COMMON += -Fd$(OBJDIR)/$(basename $(@F)).pdb -Fm$(OBJDIR)/$(basename $(@F)).map
02bb8761fcce Initial load
duke
parents:
diff changeset
   327
02bb8761fcce Initial load
duke
parents:
diff changeset
   328
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   329
# Add warnings and extra on 64bit issues
02bb8761fcce Initial load
duke
parents:
diff changeset
   330
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   331
ifeq ($(ARCH_DATA_MODEL), 64)
02bb8761fcce Initial load
duke
parents:
diff changeset
   332
  CFLAGS_COMMON += -Wp64 
02bb8761fcce Initial load
duke
parents:
diff changeset
   333
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   334
CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL)
02bb8761fcce Initial load
duke
parents:
diff changeset
   335
02bb8761fcce Initial load
duke
parents:
diff changeset
   336
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   337
# Treat compiler warnings as errors, if requested
02bb8761fcce Initial load
duke
parents:
diff changeset
   338
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   339
ifeq ($(COMPILER_WARNINGS_FATAL),true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   340
  CFLAGS_COMMON += -WX
02bb8761fcce Initial load
duke
parents:
diff changeset
   341
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   342
02bb8761fcce Initial load
duke
parents:
diff changeset
   343
CPPFLAGS_OPT    = 
02bb8761fcce Initial load
duke
parents:
diff changeset
   344
CPPFLAGS_DBG    = -DDEBUG -DLOGGING
02bb8761fcce Initial load
duke
parents:
diff changeset
   345
02bb8761fcce Initial load
duke
parents:
diff changeset
   346
CXXFLAGS_COMMON = $(CFLAGS_COMMON)
02bb8761fcce Initial load
duke
parents:
diff changeset
   347
CXXFLAGS_OPT    = $(CFLAGS_OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   348
CXXFLAGS_DBG    = $(CFLAGS_DBG)
02bb8761fcce Initial load
duke
parents:
diff changeset
   349
02bb8761fcce Initial load
duke
parents:
diff changeset
   350
ifneq ($(LIBRARY),fdlibm)
02bb8761fcce Initial load
duke
parents:
diff changeset
   351
  EXTRA_LIBS += advapi32.lib
02bb8761fcce Initial load
duke
parents:
diff changeset
   352
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   353
02bb8761fcce Initial load
duke
parents:
diff changeset
   354
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   355
# Path and option to link against the VM, if you have to. 
02bb8761fcce Initial load
duke
parents:
diff changeset
   356
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   357
JVMLIB	= $(BOOTDIR)/lib/jvm.lib
02bb8761fcce Initial load
duke
parents:
diff changeset
   358
JAVALIB =
02bb8761fcce Initial load
duke
parents:
diff changeset
   359
02bb8761fcce Initial load
duke
parents:
diff changeset
   360
ifeq ($(CC_VERSION), msvc)
02bb8761fcce Initial load
duke
parents:
diff changeset
   361
  CC_DEPEND        = -FD
02bb8761fcce Initial load
duke
parents:
diff changeset
   362
  CC_DEPEND_FILTER = 
02bb8761fcce Initial load
duke
parents:
diff changeset
   363
else # CC_VERSION
02bb8761fcce Initial load
duke
parents:
diff changeset
   364
# not supported, but left for historical reference...
02bb8761fcce Initial load
duke
parents:
diff changeset
   365
  CC_DEPEND        = -MM
02bb8761fcce Initial load
duke
parents:
diff changeset
   366
  CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)&!g'
02bb8761fcce Initial load
duke
parents:
diff changeset
   367
endif # CC_VERSION
02bb8761fcce Initial load
duke
parents:
diff changeset
   368
02bb8761fcce Initial load
duke
parents:
diff changeset
   369
LIBRARY_SUFFIX = dll
02bb8761fcce Initial load
duke
parents:
diff changeset
   370
LIB_SUFFIX     = lib
02bb8761fcce Initial load
duke
parents:
diff changeset
   371
02bb8761fcce Initial load
duke
parents:
diff changeset
   372
# Settings for the VERSIONINFO tap on windows. 
02bb8761fcce Initial load
duke
parents:
diff changeset
   373
VERSIONINFO_RESOURCE = $(TOPDIR)/src/windows/resource/version.rc
02bb8761fcce Initial load
duke
parents:
diff changeset
   374
02bb8761fcce Initial load
duke
parents:
diff changeset
   375
RC_FLAGS = /l 0x409 /r
02bb8761fcce Initial load
duke
parents:
diff changeset
   376
02bb8761fcce Initial load
duke
parents:
diff changeset
   377
ifeq ($(VARIANT), OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   378
  RC_FLAGS += -d NDEBUG 
02bb8761fcce Initial load
duke
parents:
diff changeset
   379
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   380
  RC_FLAGS += $(MS_RC_DEBUG_OPTION)
02bb8761fcce Initial load
duke
parents:
diff changeset
   381
endif 
02bb8761fcce Initial load
duke
parents:
diff changeset
   382
02bb8761fcce Initial load
duke
parents:
diff changeset
   383
ifndef COPYRIGHT_YEAR
02bb8761fcce Initial load
duke
parents:
diff changeset
   384
    COPYRIGHT_YEAR = 2007 
02bb8761fcce Initial load
duke
parents:
diff changeset
   385
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   386
3124
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2192
diff changeset
   387
RC_FLAGS += -d "JDK_BUILD_ID=$(FULL_VERSION)" \
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2192
diff changeset
   388
            -d "JDK_COMPANY=$(COMPANY_NAME)" \
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2192
diff changeset
   389
            -d "JDK_COMPONENT=$(PRODUCT_NAME) Platform SE binary" \
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2192
diff changeset
   390
            -d "JDK_VER=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)" \
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2192
diff changeset
   391
            -d "JDK_COPYRIGHT=Copyright \xA9 $(COPYRIGHT_YEAR)" \
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2192
diff changeset
   392
            -d "JDK_NAME=$(PRODUCT_NAME) Platform SE $(JDK_MINOR_VERSION) $(JDK_UPDATE_META_TAG)" \
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2192
diff changeset
   393
            -d "JDK_FVER=$(JDK_VERSION)"