1 #
   2 # Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #
  23 #
  24 
  25 # Note: this makefile is invoked both from build.bat and from the J2SE
  26 # control workspace in exactly the same manner; the required
  27 # environment variables (Variant, WorkSpace, BootStrapDir, BuildUser, HOTSPOT_BUILD_VERSION)
  28 # are passed in as command line arguments.
  29 
  30 # Note: Running nmake or build.bat from the Windows command shell requires
  31 # that "sh" be accessible on the PATH. An MKS install does this.
  32 
  33 # If we haven't set an ARCH yet use x86
  34 # create.bat and build.bat will set it, if used.
  35 !ifndef ARCH
  36 ARCH=x86
  37 !endif
  38 
  39 
  40 # Must be one of these values (if value comes in from env, can't trust it)
  41 !if "$(ARCH)" != "x86"
  42 !if "$(ARCH)" != "ia64"
  43 ARCH=x86
  44 !endif
  45 !endif
  46 
  47 # At this point we should be certain that ARCH has a definition
  48 # now determine the BUILDARCH
  49 #
  50 
  51 # the default BUILDARCH
  52 BUILDARCH=i486
  53 
  54 # Allow control workspace to force Itanium or AMD64 builds with LP64
  55 ARCH_TEXT=
  56 !ifdef LP64
  57 !if "$(LP64)" == "1"
  58 ARCH_TEXT=64-Bit
  59 !if "$(ARCH)" == "x86"
  60 BUILDARCH=amd64
  61 !else
  62 BUILDARCH=ia64
  63 !endif
  64 !endif
  65 !endif
  66 
  67 !if "$(BUILDARCH)" != "ia64"
  68 !ifndef CC_INTERP
  69 !ifndef FORCE_TIERED
  70 FORCE_TIERED=1
  71 !endif
  72 !endif
  73 !endif
  74 
  75 !if "$(BUILDARCH)" == "amd64"
  76 Platform_arch=x86
  77 Platform_arch_model=x86_64
  78 !endif
  79 !if "$(BUILDARCH)" == "i486"
  80 Platform_arch=x86
  81 Platform_arch_model=x86_32
  82 !endif
  83 
  84 # Supply these from the command line or the environment
  85 #  It doesn't make sense to default this one
  86 Variant=
  87 #  It doesn't make sense to default this one
  88 WorkSpace=
  89 
  90 variantDir = windows_$(BUILDARCH)_$(Variant)
  91 
  92 realVariant=$(Variant)
  93 VARIANT_TEXT=Core
  94 !if "$(Variant)" == "compiler1"
  95 VARIANT_TEXT=Client
  96 !elseif "$(Variant)" == "compiler2"
  97 !if "$(FORCE_TIERED)" == "1"
  98 VARIANT_TEXT=Server
  99 realVariant=tiered
 100 !else
 101 VARIANT_TEXT=Server
 102 !endif
 103 !elseif "$(Variant)" == "tiered"
 104 VARIANT_TEXT=Tiered
 105 !endif
 106 
 107 #########################################################################
 108 # Parameters for VERSIONINFO resource for jvm.dll.
 109 # These can be overridden via the nmake.exe command line.
 110 # They are overridden by RE during the control builds.
 111 #
 112 !include "$(WorkSpace)/make/jdk_version"
 113 
 114 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
 115 # or make/hotspot_distro.
 116 !ifndef HOTSPOT_VM_DISTRO
 117 !ifndef OPENJDK
 118 !if exists($(WorkSpace)\src\closed)
 119 !include $(WorkSpace)\make\hotspot_distro
 120 !else
 121 !include $(WorkSpace)\make\openjdk_distro
 122 !endif
 123 !else
 124 !include $(WorkSpace)\make\openjdk_distro
 125 !endif
 126 !endif
 127 
 128 HS_FILEDESC=$(HOTSPOT_VM_DISTRO) $(ARCH_TEXT) $(VARIANT_TEXT) VM
 129 
 130 # JDK ProductVersion:
 131 # 1.5.0_<wx>-b<yz> will have DLL version 5.0.wx*10.yz
 132 # Thus, 1.5.0_10-b04  will be 5.0.100.4
 133 #       1.6.0-b01     will be 6.0.0.1
 134 #       1.6.0_01a-b02 will be 6.0.11.2
 135 #
 136 # STANDALONE_JDK_* variables are defined in make/jdk_version or on command line
 137 #
 138 !if "$(JDK_VER)" == ""
 139 JDK_VER=$(STANDALONE_JDK_MAJOR_VER),$(STANDALONE_JDK_MINOR_VER),$(STANDALONE_JDK_SECURITY_VER),$(STANDALONE_JDK_PATCH_VER)
 140 !endif
 141 !if "$(JDK_DOTVER)" == ""
 142 JDK_DOTVER=$(STANDALONE_JDK_MAJOR_VER).$(STANDALONE_JDK_MINOR_VER).$(STANDALONE_JDK_SECURITY_VER).$(STANDALONE_JDK_PATCH_VER)
 143 !endif
 144 !if "$(VERSION_SHORT)" == ""
 145 VERSION_SHORT=$(STANDALONE_JDK_MAJOR_VER).$(STANDALONE_JDK_MINOR_VER).$(STANDALONE_JDK_SECURITY_VER)
 146 !endif
 147 
 148 HS_VER=$(JDK_VER)
 149 HS_DOTVER=$(JDK_DOTVER)
 150 
 151 !if "$(HOTSPOT_RELEASE_VERSION)" == ""
 152 HOTSPOT_RELEASE_VERSION=$(VERSION_STRING)
 153 !endif
 154 
 155 !if "$(HOTSPOT_VERSION_STRING)" == ""
 156 HOTSPOT_VERSION_STRING=$(HOTSPOT_RELEASE_VERSION)
 157 !endif
 158 
 159 # End VERSIONINFO parameters
 160 
 161 # if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
 162 !ifndef OPENJDK
 163 !if !exists($(WorkSpace)\src\closed)
 164 OPENJDK=true
 165 !endif
 166 !endif
 167 
 168 #########################################################################
 169 
 170 defaultTarget: product
 171 
 172 # The product or release build is an optimized build, and is the default
 173 
 174 # note that since all the build targets depend on local.make that BUILDARCH
 175 # and Platform_arch and Platform_arch_model will get set in local.make
 176 # and there is no need to pass them thru here on the command line
 177 #
 178 product release optimized: checks $(variantDir) $(variantDir)\local.make sanity
 179         cd $(variantDir)
 180         nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=product ARCH=$(ARCH)
 181 
 182 # The debug build is an optional build
 183 debug: checks $(variantDir) $(variantDir)\local.make sanity
 184         cd $(variantDir)
 185         nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=debug ARCH=$(ARCH)
 186 fastdebug: checks $(variantDir) $(variantDir)\local.make sanity
 187         cd $(variantDir)
 188         nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=fastdebug ARCH=$(ARCH)
 189 
 190 # target to create just the directory structure
 191 tree: checks $(variantDir) $(variantDir)\local.make sanity
 192         mkdir $(variantDir)\product
 193         mkdir $(variantDir)\debug
 194         mkdir $(variantDir)\fastdebug
 195 
 196 sanity:
 197         @ echo;
 198         @ cd $(variantDir)
 199         @ nmake -nologo -f $(WorkSpace)\make\windows\makefiles\sanity.make
 200         @ cd ..
 201         @ echo;
 202 
 203 clean: checkVariant
 204         - rm -r -f $(variantDir)
 205 
 206 $(variantDir):
 207         mkdir $(variantDir)
 208 
 209 $(variantDir)\local.make: checks
 210         @ echo # Generated file                                 >  $@
 211         @ echo Variant=$(realVariant)                           >> $@
 212         @ echo WorkSpace=$(WorkSpace)                           >> $@
 213         @ echo BootStrapDir=$(BootStrapDir)                     >> $@
 214         @ if "$(USERNAME)" NEQ "" echo BuildUser=$(USERNAME)    >> $@
 215         @ echo HS_VER=$(HS_VER)                                 >> $@
 216         @ echo HS_DOTVER=$(HS_DOTVER)                           >> $@
 217         @ echo HS_COMPANY=$(COMPANY_NAME)                       >> $@
 218         @ echo HS_FILEDESC=$(HS_FILEDESC)                       >> $@
 219         @ echo HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO)           >> $@
 220         @ if "$(OPENJDK)" NEQ "" echo OPENJDK=$(OPENJDK)        >> $@
 221         @ echo HS_COPYRIGHT=$(HOTSPOT_VM_COPYRIGHT)             >> $@
 222         @ echo HS_NAME=$(PRODUCT_NAME) $(VERSION_SHORT)         >> $@
 223         @ echo HOTSPOT_VERSION_STRING=$(HOTSPOT_VERSION_STRING) >> $@
 224         @ echo JDK_VER=$(JDK_VER)                               >> $@
 225         @ echo JDK_DOTVER=$(JDK_DOTVER)                         >> $@
 226         @ echo VERSION_STRING=$(VERSION_STRING)                 >> $@
 227         @ echo BUILDARCH=$(BUILDARCH)                           >> $@
 228         @ echo Platform_arch=$(Platform_arch)                   >> $@
 229         @ echo Platform_arch_model=$(Platform_arch_model)       >> $@
 230         @ echo CXX=$(CXX)                                       >> $@
 231         @ echo LD=$(LD)                                         >> $@
 232         @ echo MT=$(MT)                                         >> $@
 233         @ echo RC=$(RC)                                         >> $@
 234         @ sh $(WorkSpace)/make/windows/get_msc_ver.sh           >> $@
 235         @ if "$(ENABLE_FULL_DEBUG_SYMBOLS)" NEQ "" echo ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) >> $@
 236         @ if "$(ZIP_DEBUGINFO_FILES)" NEQ "" echo ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) >> $@
 237         @ if "$(RM)" NEQ "" echo RM=$(RM)                       >> $@
 238         @ if "$(CP)" NEQ "" echo CP=$(CP)                       >> $@
 239         @ if "$(MV)" NEQ "" echo MV=$(MV)                       >> $@
 240         @ if "$(ZIPEXE)" NEQ "" echo ZIPEXE=$(ZIPEXE)           >> $@
 241 
 242 checks: checkVariant checkWorkSpace
 243 
 244 checkVariant:
 245         @ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|core]" && false
 246         @ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "core" \
 247           echo Need to specify "Variant=[tiered|compiler2|compiler1|core]" && false
 248 
 249 checkWorkSpace:
 250         @ if "$(WorkSpace)"=="" echo Need to specify "WorkSpace=..." && false
 251 
 252 checkBuildID:
 253         @ if "$(BuildID)"=="" echo Need to specify "BuildID=..." && false