view hotspot/build/windows/build.make @ 2:16f2b6c91171 trunk

[svn] Load openjdk/jdk7/b14 into jdk/trunk.
author xiomara
date Fri, 22 Jun 2007 00:46:43 +0000
parents a4ed3fb96592
children 27e0bf49438e
line wrap: on
line source

#
# Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#  
#

# Note: this makefile is invoked both from build.bat and from the J2SE
# control workspace in exactly the same manner; the required
# environment variables (Variant, WorkSpace, BootStrapDir, BuildID)
# are passed in as command line arguments.

# SA components are built if BUILD_WIN_SA=1 is specified.
# See notes in README. This produces files:
#  1. sa-jdi.jar       - This is built before building jvm.dll
#  2. sawindbg[_g].dll - Native library for SA - This is built after jvm.dll
#                      - Also, .lib, .map, .pdb.
#
# Please refer to ./makefiles/sa.make



# Allow control workspace to force Itanium or AMD64 builds with LP64
ARCH_TEXT=
!ifdef LP64
!if "$(LP64)" == "1"
ARCH_TEXT=64-Bit
!if "$(ARCH)" == "amd64"
ARCH=amd64
!else
ARCH=ia64
!endif
!else
!endif
!endif

# If we haven't set an ARCH yet use i486
# create.bat and build.bat will set it, if used.
!ifndef ARCH
ARCH=i486
!endif

!if "$(ARCH)" != "amd64"
!if "$(ARCH)" != "ia64"
# uncomment this line to have build of compiler2 actually build tiered
FORCE_TIERED=1
!endif
!endif

# Must be one of these values (if value comes in from env, can't trust it)
!if "$(ARCH)" != "amd64"
!if "$(ARCH)" != "ia64"
!if "$(ARCH)" != "i486"
ARCH=i486
!endif
!endif
!endif

# Supply these from the command line or the environment
#  It doesn't make sense to default this one
Variant=
#  It doesn't make sense to default this one
WorkSpace=

variantDir = windows_$(ARCH)_$(Variant)

realVariant=$(Variant)
VARIANT_TEXT=Core
!if "$(Variant)" == "compiler1"
VARIANT_TEXT=Client
!elseif "$(Variant)" == "compiler2"
!ifdef FORCE_TIERED
VARIANT_TEXT=Tiered
realVariant=tiered
!else
VARIANT_TEXT=Server
!endif
!elseif "$(Variant)" == "tiered"
VARIANT_TEXT=Tiered
!elseif "$(Variant)" == "kernel"
VARIANT_TEXT=Client
!endif

#########################################################################
# Parameters for VERSIONINFO resource for jvm[_g].dll.
# These can be overridden via the nmake.exe command line.
# They are overridden by RE during the control builds.
#
!include "$(WorkSpace)/make/hotspot_version"
SA_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER).$(HS_MICRO_VER)

# Following the Web Start / Plugin model here....
# We can have update versions like "01a", but Windows requires
# we use only integers in the file version field.  So:
# HS_UPDATE_VER = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION
# 
HS_UPDATE_VER=0
HS_BUILD_NUMBER=0

HS_COMPANY=Sun Microsystems, Inc.
HS_COPYRIGHT=Copyright \xA9 2004
HS_MKTG_VERSION=$(HS_MINOR_VER).$(HS_MICRO_VER)
HS_NAME=Java(TM) 2 Platform Standard Edition $(HS_MKTG_VERSION)
HS_FILEDESC=Java HotSpot(TM) $(ARCH_TEXT) $(VARIANT_TEXT) VM

# FileVersion:
# 1.5.0_<wx>-b<yz> will have DLL version 5.0.wx*10.yz
# Thus, 1.5.0_10-b04  will be 5.0.100.4
#       1.6.0-b01     will be 6.0.0.1
#       1.6.0_01a-b02 will be 6.0.11.2
#
HS_VER=$(HS_MINOR_VER),$(HS_MICRO_VER),$(HS_UPDATE_VER),$(HS_BUILD_NUMBER)
HS_DOTVER=$(HS_MINOR_VER).$(HS_MICRO_VER).$(HS_UPDATE_VER).$(HS_BUILD_NUMBER)
!if "$(BuildID)" == ""
HS_BUILD_VER=$(HS_MAJOR_VER).$(HS_MINOR_VER).$(HS_MICRO_VER)-internal
!else
HS_BUILD_VER=$(BuildID)
!endif
HS_RELEASE_VER=$(HS_MAJOR_VER).$(HS_MINOR_VER).$(HS_MICRO_VER)
!if "$(HS_UPDATE_VER)" != "0"
HS_RELEASE_VER=$(HS_RELEASE_VER)_$(HS_UPDATE_VER)
!endif
!if "$(HS_BUILD_NUMBER)" != "0"
HS_RELEASE_VER=$(HS_RELEASE_VER)-b$(HS_BUILD_NUMBER)
!endif
# End VERSIONINFO parameters


# We don't support SA on ia64, and we can't
# build it if we are using a version of Vis Studio 
# older than .Net 2003.
# SA_INCLUDE and SA_LIB are hold-overs from a previous
# implementation in which we could build SA using
# Debugging Tools For Windows, in which the .h/.lib files
# and the .dlls are in different places than
# they are for Vis Studio .Net 2003.
# If that code ever needs to be resurrected, these vars
# can be set here.  They are used in makefiles/sa.make.

checkSA::

!if "$(BUILD_WIN_SA)" != "1"
checkSA::
	@echo     Not building SA:  BUILD_WIN_SA != 1

!elseif "$(ARCH)" == "ia64"
BUILD_WIN_SA = 0
checkSA::
	@echo     Not building SA:  ARCH = ia64

!elseif exist("$(MSVCDIR)\PlatformSDK\Include\dbgeng.h")
# These don't have to be set because the default
# setting of INCLUDE and LIB already contain the needed dirs.
SA_INCLUDE = 
SA_LIB = 

!elseif exist("$(SYSTEMROOT)\..\Program Files\Microsoft SDK\include\dbgeng.h")
# These don't have to be set because the default
# setting of INCLUDE and LIB already contain the needed dirs.
SA_INCLUDE =
SA_LIB = 

!else
checkSA::
	@echo .
	@echo ERROR:  Can't build SA because dbgeng.h does not exist here:
	@echo     $(MSVCDIR)\PlatformSDK\Include\dbgeng.h
	@echo nor here:
	@echo     $(SYSTEMROOT)\..\Program Files\Microsoft SDK\include\dbgeng.h
	@echo You must use Vis. Studio .Net 2003 on Win 32, and you must
	@echo have the Microsoft SDK installed on Win amd64.
	@echo You can disable building of SA by specifying BUILD_WIN_SA = 0
	@echo . && false
!endif  # ! "$(BUILD_WIN_SA)" != "1"

#########################################################################

# With the jvm_g.dll now being named jvm.dll, we can't build both and place
#   the dll's in the same directory, so we only build one at a time,
#   re-directing the output to different output directories (done by user
#   of this makefile).
#
defaultTarget: product

# The product or release build is an optimized build, and is the default
product release optimized: checks $(variantDir) $(variantDir)\local.make sanity
	cd $(variantDir)
	nmake -nologo -f $(WorkSpace)\build\windows\makefiles\top.make BUILD_FLAVOR=product ARCH=$(ARCH)

# The debug or jvmg (all the same thing) is an optional build
debug jvmg: checks $(variantDir) $(variantDir)\local.make sanity
	cd $(variantDir)
	nmake -nologo -f $(WorkSpace)\build\windows\makefiles\top.make BUILD_FLAVOR=debug ARCH=$(ARCH)
fastdebug: checks $(variantDir) $(variantDir)\local.make sanity
	cd $(variantDir)
	nmake -nologo -f $(WorkSpace)\build\windows\makefiles\top.make BUILD_FLAVOR=fastdebug ARCH=$(ARCH)

develop: checks $(variantDir) $(variantDir)\local.make sanity
	cd $(variantDir)
	nmake -nologo -f $(WorkSpace)\build\windows\makefiles\top.make BUILD_FLAVOR=product DEVELOP=1 ARCH=$(ARCH)

sanity:
	@ echo;
	@ cd $(variantDir)
	@ nmake -nologo -f $(WorkSpace)\build\windows\makefiles\sanity.make
	@ cd ..
	@ echo;

clean: checkVariant
	- rm -r -f $(variantDir)

$(variantDir):
	mkdir $(variantDir)

$(variantDir)\local.make: checks
	@ echo # Generated file					>  $@
	@ echo Variant=$(realVariant)				>> $@
	@ echo WorkSpace=$(WorkSpace)				>> $@
	@ echo BootStrapDir=$(BootStrapDir)			>> $@
        @ if "$(USERNAME)" NEQ "" echo BuildUser=$(USERNAME)	>> $@
	@ echo HS_VER=$(HS_VER)					>> $@
	@ echo HS_DOTVER=$(HS_DOTVER)				>> $@
	@ echo HS_RELEASE_VER=$(HS_RELEASE_VER)			>> $@
	@ echo HS_COMPANY=$(HS_COMPANY)				>> $@
	@ echo HS_FILEDESC=$(HS_FILEDESC)			>> $@
	@ echo HS_COPYRIGHT=$(HS_COPYRIGHT)			>> $@
	@ echo HS_NAME=$(HS_NAME)				>> $@
	@ echo HS_BUILD_VER=$(HS_BUILD_VER)			>> $@
	@ echo BUILD_WIN_SA=$(BUILD_WIN_SA)    			>> $@
	@ echo SA_VERSION=$(SA_VERSION)                         >> $@
	@ echo SA_INCLUDE=$(SA_INCLUDE)      			>> $@
	@ echo SA_LIB=$(SA_LIB)         			>> $@
	@ sh $(WorkSpace)/build/windows/get_msc_ver.sh		>> $@

checks: checkVariant checkWorkSpace checkSA

checkVariant:
	@ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
	@ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "kernel" if "$(Variant)" NEQ "core" \
          echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false

checkWorkSpace:
	@ if "$(WorkSpace)"=="" echo Need to specify "WorkSpace=..." && false

checkBuildID:
	@ if "$(BuildID)"=="" echo Need to specify "BuildID=..." && false