duke@435: # iveresov@2138: # Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. duke@435: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: # duke@435: # This code is free software; you can redistribute it and/or modify it duke@435: # under the terms of the GNU General Public License version 2 only, as duke@435: # published by the Free Software Foundation. duke@435: # duke@435: # This code is distributed in the hope that it will be useful, but WITHOUT duke@435: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: # version 2 for more details (a copy is included in the LICENSE file that duke@435: # accompanied this code). duke@435: # duke@435: # You should have received a copy of the GNU General Public License version duke@435: # 2 along with this work; if not, write to the Free Software Foundation, duke@435: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: # trims@1907: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: # or visit www.oracle.com if you need additional information or have any trims@1907: # questions. iveresov@2138: # duke@435: # duke@435: duke@435: # Note: this makefile is invoked both from build.bat and from the J2SE duke@435: # control workspace in exactly the same manner; the required duke@435: # environment variables (Variant, WorkSpace, BootStrapDir, BuildUser, HOTSPOT_BUILD_VERSION) duke@435: # are passed in as command line arguments. duke@435: dcubed@1763: # Note: Running nmake or build.bat from the Windows command shell requires dcubed@1763: # that "sh" be accessible on the PATH. An MKS install does this. dcubed@1763: duke@435: # SA components are built if BUILD_WIN_SA=1 is specified. duke@435: # See notes in README. This produces files: duke@435: # 1. sa-jdi.jar - This is built before building jvm.dll duke@435: # 2. sawindbg[_g].dll - Native library for SA - This is built after jvm.dll duke@435: # - Also, .lib, .map, .pdb. duke@435: # duke@435: # Please refer to ./makefiles/sa.make duke@435: duke@435: # If we haven't set an ARCH yet use x86 duke@435: # create.bat and build.bat will set it, if used. duke@435: !ifndef ARCH duke@435: ARCH=x86 duke@435: !endif duke@435: duke@435: duke@435: # Must be one of these values (if value comes in from env, can't trust it) duke@435: !if "$(ARCH)" != "x86" duke@435: !if "$(ARCH)" != "ia64" duke@435: ARCH=x86 duke@435: !endif duke@435: !endif duke@435: duke@435: # At this point we should be certain that ARCH has a definition duke@435: # now determine the BUILDARCH duke@435: # duke@435: duke@435: # the default BUILDARCH duke@435: BUILDARCH=i486 duke@435: duke@435: # Allow control workspace to force Itanium or AMD64 builds with LP64 duke@435: ARCH_TEXT= duke@435: !ifdef LP64 duke@435: !if "$(LP64)" == "1" duke@435: ARCH_TEXT=64-Bit duke@435: !if "$(ARCH)" == "x86" duke@435: BUILDARCH=amd64 duke@435: !else duke@435: BUILDARCH=ia64 duke@435: !endif duke@435: !endif duke@435: !endif duke@435: duke@435: !if "$(BUILDARCH)" != "ia64" duke@435: !ifndef CC_INTERP duke@435: FORCE_TIERED=1 duke@435: !endif duke@435: !endif duke@435: duke@435: !if "$(BUILDARCH)" == "amd64" duke@435: Platform_arch=x86 duke@435: Platform_arch_model=x86_64 duke@435: !endif duke@435: !if "$(BUILDARCH)" == "i486" duke@435: Platform_arch=x86 duke@435: Platform_arch_model=x86_32 duke@435: !endif duke@435: duke@435: # Supply these from the command line or the environment duke@435: # It doesn't make sense to default this one duke@435: Variant= duke@435: # It doesn't make sense to default this one duke@435: WorkSpace= duke@435: duke@435: variantDir = windows_$(BUILDARCH)_$(Variant) duke@435: duke@435: realVariant=$(Variant) duke@435: VARIANT_TEXT=Core duke@435: !if "$(Variant)" == "compiler1" duke@435: VARIANT_TEXT=Client duke@435: !elseif "$(Variant)" == "compiler2" duke@435: !ifdef FORCE_TIERED duke@435: VARIANT_TEXT=Server duke@435: realVariant=tiered duke@435: !else duke@435: VARIANT_TEXT=Server duke@435: !endif duke@435: !elseif "$(Variant)" == "tiered" duke@435: VARIANT_TEXT=Tiered duke@435: !elseif "$(Variant)" == "kernel" duke@435: VARIANT_TEXT=Kernel duke@435: !endif duke@435: duke@435: ######################################################################### duke@435: # Parameters for VERSIONINFO resource for jvm[_g].dll. duke@435: # These can be overridden via the nmake.exe command line. duke@435: # They are overridden by RE during the control builds. duke@435: # duke@435: !include "$(WorkSpace)/make/hotspot_version" duke@435: kamg@526: # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro kamg@526: # or make/hotspot_distro. duke@435: !ifndef HOTSPOT_VM_DISTRO kamg@526: !if exists($(WorkSpace)\src\closed) kamg@526: !include $(WorkSpace)\make\hotspot_distro duke@435: !else kamg@526: !include $(WorkSpace)\make\openjdk_distro duke@435: !endif duke@435: !endif duke@435: duke@435: # Following the Web Start / Plugin model here.... duke@435: # We can have update versions like "01a", but Windows requires duke@435: # we use only integers in the file version field. So: duke@435: # JDK_UPDATE_VER = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION iveresov@2138: # duke@435: JDK_UPDATE_VER=0 duke@435: JDK_BUILD_NUMBER=0 duke@435: duke@435: HS_FILEDESC=$(HOTSPOT_VM_DISTRO) $(ARCH_TEXT) $(VARIANT_TEXT) VM duke@435: duke@435: # JDK ProductVersion: duke@435: # 1.5.0_-b will have DLL version 5.0.wx*10.yz duke@435: # Thus, 1.5.0_10-b04 will be 5.0.100.4 duke@435: # 1.6.0-b01 will be 6.0.0.1 duke@435: # 1.6.0_01a-b02 will be 6.0.11.2 duke@435: # duke@435: # JDK_* variables are defined in make/hotspot_version or on command line iveresov@2138: # duke@435: JDK_VER=$(JDK_MINOR_VER),$(JDK_MICRO_VER),$(JDK_UPDATE_VER),$(JDK_BUILD_NUMBER) duke@435: JDK_DOTVER=$(JDK_MINOR_VER).$(JDK_MICRO_VER).$(JDK_UPDATE_VER).$(JDK_BUILD_NUMBER) duke@435: !if "$(JRE_RELEASE_VERSION)" == "" duke@435: JRE_RELEASE_VER=$(JDK_MAJOR_VER).$(JDK_MINOR_VER).$(JDK_MICRO_VER) duke@435: !else duke@435: JRE_RELEASE_VER=$(JRE_RELEASE_VERSION) duke@435: !endif duke@435: !if "$(JDK_MKTG_VERSION)" == "" duke@435: JDK_MKTG_VERSION=$(JDK_MINOR_VER).$(JDK_MICRO_VER) duke@435: !endif duke@435: duke@435: # Hotspot Express VM FileVersion: duke@435: # 10.0-b will have DLL version 10.0.0.yz (need 4 numbers). iveresov@2138: # duke@435: # HS_* variables are defined in make/hotspot_version duke@435: # duke@435: HS_VER=$(HS_MAJOR_VER),$(HS_MINOR_VER),0,$(HS_BUILD_NUMBER) duke@435: HS_DOTVER=$(HS_MAJOR_VER).$(HS_MINOR_VER).0.$(HS_BUILD_NUMBER) duke@435: duke@435: !if "$(HOTSPOT_RELEASE_VERSION)" == "" duke@435: HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER) duke@435: !endif duke@435: duke@435: !if "$(HOTSPOT_BUILD_VERSION)" == "" duke@435: HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION) duke@435: !else duke@435: HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION) duke@435: !endif duke@435: duke@435: # End VERSIONINFO parameters duke@435: duke@435: duke@435: # We don't support SA on ia64, and we can't iveresov@2138: # build it if we are using a version of Vis Studio duke@435: # older than .Net 2003. duke@435: # SA_INCLUDE and SA_LIB are hold-overs from a previous duke@435: # implementation in which we could build SA using duke@435: # Debugging Tools For Windows, in which the .h/.lib files duke@435: # and the .dlls are in different places than duke@435: # they are for Vis Studio .Net 2003. duke@435: # If that code ever needs to be resurrected, these vars duke@435: # can be set here. They are used in makefiles/sa.make. duke@435: duke@435: checkSA:: duke@435: duke@435: !if "$(BUILD_WIN_SA)" != "1" duke@435: checkSA:: duke@435: @echo Not building SA: BUILD_WIN_SA != 1 duke@435: duke@435: !elseif "$(ARCH)" == "ia64" duke@435: BUILD_WIN_SA = 0 duke@435: checkSA:: duke@435: @echo Not building SA: ARCH = ia64 duke@435: duke@435: !endif # ! "$(BUILD_WIN_SA)" != "1" duke@435: duke@435: ######################################################################### duke@435: duke@435: # With the jvm_g.dll now being named jvm.dll, we can't build both and place duke@435: # the dll's in the same directory, so we only build one at a time, duke@435: # re-directing the output to different output directories (done by user duke@435: # of this makefile). duke@435: # duke@435: defaultTarget: product duke@435: duke@435: # The product or release build is an optimized build, and is the default duke@435: duke@435: # note that since all the build targets depend on local.make that BUILDARCH duke@435: # and Platform_arch and Platform_arch_model will get set in local.make duke@435: # and there is no need to pass them thru here on the command line duke@435: # duke@435: product release optimized: checks $(variantDir) $(variantDir)\local.make sanity duke@435: cd $(variantDir) kamg@526: nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=product ARCH=$(ARCH) duke@435: duke@435: # The debug or jvmg (all the same thing) is an optional build duke@435: debug jvmg: checks $(variantDir) $(variantDir)\local.make sanity duke@435: cd $(variantDir) kamg@526: nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=debug ARCH=$(ARCH) duke@435: fastdebug: checks $(variantDir) $(variantDir)\local.make sanity duke@435: cd $(variantDir) kamg@526: nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=fastdebug ARCH=$(ARCH) duke@435: duke@435: develop: checks $(variantDir) $(variantDir)\local.make sanity duke@435: cd $(variantDir) kamg@526: nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=product DEVELOP=1 ARCH=$(ARCH) duke@435: dcubed@1757: # target to create just the directory structure dcubed@1757: tree: checks $(variantDir) $(variantDir)\local.make sanity dcubed@1757: mkdir $(variantDir)\product dcubed@1757: mkdir $(variantDir)\debug dcubed@1757: mkdir $(variantDir)\fastdebug dcubed@1757: duke@435: sanity: duke@435: @ echo; duke@435: @ cd $(variantDir) kamg@526: @ nmake -nologo -f $(WorkSpace)\make\windows\makefiles\sanity.make duke@435: @ cd .. duke@435: @ echo; duke@435: duke@435: clean: checkVariant duke@435: - rm -r -f $(variantDir) duke@435: duke@435: $(variantDir): duke@435: mkdir $(variantDir) duke@435: duke@435: $(variantDir)\local.make: checks duke@435: @ echo # Generated file > $@ duke@435: @ echo Variant=$(realVariant) >> $@ duke@435: @ echo WorkSpace=$(WorkSpace) >> $@ duke@435: @ echo BootStrapDir=$(BootStrapDir) >> $@ duke@435: @ if "$(USERNAME)" NEQ "" echo BuildUser=$(USERNAME) >> $@ duke@435: @ echo HS_VER=$(HS_VER) >> $@ duke@435: @ echo HS_DOTVER=$(HS_DOTVER) >> $@ duke@435: @ echo HS_COMPANY=$(COMPANY_NAME) >> $@ duke@435: @ echo HS_FILEDESC=$(HS_FILEDESC) >> $@ duke@435: @ echo HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) >> $@ duke@435: @ echo HS_COPYRIGHT=$(HOTSPOT_VM_COPYRIGHT) >> $@ duke@435: @ echo HS_NAME=$(PRODUCT_NAME) $(JDK_MKTG_VERSION) >> $@ duke@435: @ echo HS_BUILD_VER=$(HS_BUILD_VER) >> $@ duke@435: @ echo BUILD_WIN_SA=$(BUILD_WIN_SA) >> $@ duke@435: @ echo SA_BUILD_VERSION=$(HS_BUILD_VER) >> $@ duke@435: @ echo SA_INCLUDE=$(SA_INCLUDE) >> $@ duke@435: @ echo SA_LIB=$(SA_LIB) >> $@ duke@435: @ echo JDK_VER=$(JDK_VER) >> $@ duke@435: @ echo JDK_DOTVER=$(JDK_DOTVER) >> $@ duke@435: @ echo JRE_RELEASE_VER=$(JRE_RELEASE_VER) >> $@ duke@435: @ echo BUILDARCH=$(BUILDARCH) >> $@ duke@435: @ echo Platform_arch=$(Platform_arch) >> $@ duke@435: @ echo Platform_arch_model=$(Platform_arch_model) >> $@ kamg@526: @ sh $(WorkSpace)/make/windows/get_msc_ver.sh >> $@ duke@435: duke@435: checks: checkVariant checkWorkSpace checkSA duke@435: duke@435: checkVariant: duke@435: @ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false duke@435: @ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "kernel" if "$(Variant)" NEQ "core" \ duke@435: echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false duke@435: duke@435: checkWorkSpace: duke@435: @ if "$(WorkSpace)"=="" echo Need to specify "WorkSpace=..." && false duke@435: duke@435: checkBuildID: duke@435: @ if "$(BuildID)"=="" echo Need to specify "BuildID=..." && false