Compiler-msvc.gmk revision 3798
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# This code is free software; you can redistribute it and/or modify it
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# under the terms of the GNU General Public License version 2 only, as
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# published by the Free Software Foundation. Oracle designates this
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# particular file as subject to the "Classpath" exception as provided
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# by Oracle in the LICENSE file that accompanied this code.
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# This code is distributed in the hope that it will be useful, but WITHOUT
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# version 2 for more details (a copy is included in the LICENSE file that
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# accompanied this code).
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# You should have received a copy of the GNU General Public License version
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# 2 along with this work; if not, write to the Free Software Foundation,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# or visit www.oracle.com if you need additional information or have any
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# questions.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# MSVC Compiler settings
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), windows)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CC = $(COMPILER_PATH)cl
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CPP = $(COMPILER_PATH)cl
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CXX = $(COMPILER_PATH)cl
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CCC = $(COMPILER_PATH)cl
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe LIBEXE = $(COMPILER_PATH)lib
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe LINK = $(COMPILER_PATH)link
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe LINK32 = $(LINK)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe DUMPBIN = $(COMPILER_PATH)dumpbin.exe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe # Fill in unknown values
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe COMPILER_NAME=Unknown MSVC Compiler
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe COMPILER_VERSION=
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe # unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe # Compiler version and type (Always get word after "Version")
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CC_VER := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(SED) 's/.*\(Version.*\)/\1/' | $(NAWK) '{print $$2}')
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe # The VS2010 compiler is the same one used on both 32bit and 64bit
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifeq ($(CC_MAJORVER), 16)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe COMPILER_NAME=Microsoft Visual Studio 10 (16.00.30319.01)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe COMPILER_VERSION=VS2010
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifeq ($(WINDOWSSDKDIR),)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe WINDOWSSDKDIR := $(error WINDOWSSDKDIR cannot be empty here)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifeq ($(ARCH_DATA_MODEL), 32)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe _OTHER_TOOLS_BIN = $(WINDOWSSDKDIR)/Bin
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe else
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifeq ($(ARCH), ia64)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe _OTHER_TOOLS_BIN = $(WINDOWSSDKDIR)/Bin/ia64
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe else
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe _OTHER_TOOLS_BIN = $(WINDOWSSDKDIR)/Bin/x64
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe RC = $(_OTHER_TOOLS_BIN)/RC.Exe
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov REBASE = $(_OTHER_TOOLS_BIN)/ReBase.Exe
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov MT = $(_OTHER_TOOLS_BIN)/mt.exe
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov MTL = $(_OTHER_TOOLS_BIN)/midl.exe
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov # These variables can never be empty
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifndef COMPILER_PATH
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifndef COMPILER_VERSION
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe COMPILER_VERSION := $(error COMPILER_VERSION cannot be empty here)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifneq ($(COMPILER_VERSION),VS2010)
COMPILER_VERSION := $(error COMPILER_VERSION must be VS2010)
endif
# Shared library generation flag
SHARED_LIBRARY_FLAG = -LD
# RSC is always same as RC (Not sure who uses this RSC variable)
RSC = $(RC)
endif