jdk/make/common/shared/Compiler-msvc.gmk
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 8827 f0f30d988312
child 15825 cbb8bc2c35da
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8827
diff changeset
     2
# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# MSVC Compiler settings
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
  CC           = $(COMPILER_PATH)cl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
  CPP          = $(COMPILER_PATH)cl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
  CXX          = $(COMPILER_PATH)cl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
  CCC          = $(COMPILER_PATH)cl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
  LIBEXE       = $(COMPILER_PATH)lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
  LINK         = $(COMPILER_PATH)link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
  LINK32       = $(LINK)
8008
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7665
diff changeset
    38
  DUMPBIN      = $(COMPILER_PATH)dumpbin.exe
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
  # Fill in unknown values
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
  COMPILER_NAME=Unknown MSVC Compiler
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
  COMPILER_VERSION=
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
  # unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
  NMAKE          = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
308
33a1639d64a5 6482134: JDK 6 build error on Windows, Visual Studio .NET on Japanese locale
ohair
parents: 2
diff changeset
    47
  # Compiler version and type (Always get word after "Version")
33a1639d64a5 6482134: JDK 6 build error on Windows, Visual Studio .NET on Japanese locale
ohair
parents: 2
diff changeset
    48
  CC_VER  := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(SED) 's/.*\(Version.*\)/\1/' | $(NAWK) '{print $$2}')
7665
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    49
8827
f0f30d988312 7011718: VS2010, remove makefile logic with regards to use of VC6, VS2003, VS2005, VS2008
ohair
parents: 8593
diff changeset
    50
  LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
f0f30d988312 7011718: VS2010, remove makefile logic with regards to use of VC6, VS2003, VS2005, VS2008
ohair
parents: 8593
diff changeset
    51
  CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
7665
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    52
  
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    53
  # The VS2010 compiler is the same one used on both 32bit and 64bit
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    54
  ifeq ($(CC_MAJORVER), 16)
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    55
    COMPILER_NAME=Microsoft Visual Studio 10 (16.00.30319.01)
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    56
    COMPILER_VERSION=VS2010
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    57
    ifeq ($(WINDOWSSDKDIR),)
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    58
      WINDOWSSDKDIR := $(error WINDOWSSDKDIR cannot be empty here)
2186
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    59
    endif
7665
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    60
    ifeq ($(ARCH_DATA_MODEL), 32)
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    61
      _OTHER_TOOLS_BIN = $(WINDOWSSDKDIR)/Bin
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    62
    else
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    63
      ifeq ($(ARCH), ia64)
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    64
        _OTHER_TOOLS_BIN = $(WINDOWSSDKDIR)/Bin/ia64
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    65
      else
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    66
        _OTHER_TOOLS_BIN = $(WINDOWSSDKDIR)/Bin/x64
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    67
      endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    endif
8008
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7665
diff changeset
    69
    RC     = $(_OTHER_TOOLS_BIN)/RC.Exe
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7665
diff changeset
    70
    REBASE = $(_OTHER_TOOLS_BIN)/ReBase.Exe
7665
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    71
    MT     = $(_OTHER_TOOLS_BIN)/mt.exe
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    72
    MTL    = $(_OTHER_TOOLS_BIN)/midl.exe
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    73
  endif
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    74
  
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    75
  # These variables can never be empty
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    76
  ifndef COMPILER_PATH
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    77
    COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
  ifndef COMPILER_VERSION
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    COMPILER_VERSION := $(error COMPILER_VERSION cannot be empty here)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
  endif
8593
d7436373981b 7027923: Disable VS2003 use in preparation for all VS2003 make logic removal
ohair
parents: 8008
diff changeset
    82
  ifneq ($(COMPILER_VERSION),VS2010)
d7436373981b 7027923: Disable VS2003 use in preparation for all VS2003 make logic removal
ohair
parents: 8008
diff changeset
    83
    COMPILER_VERSION := $(error COMPILER_VERSION must be VS2010)
d7436373981b 7027923: Disable VS2003 use in preparation for all VS2003 make logic removal
ohair
parents: 8008
diff changeset
    84
  endif
7665
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    85
  
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
  # Shared library generation flag
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
  SHARED_LIBRARY_FLAG = -LD
7665
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    88
  # RSC is always same as RC (Not sure who uses this RSC variable)
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    89
  RSC = $(RC)
bc5dbdc44e1e 6360517: ALT_MSDEVTOOLS_PATH and rc.exe location, and rebase location
ohair
parents: 5506
diff changeset
    90
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92