annotate make/windows/build.make @ 3510:dd467a878e9e

7197100: new hotspot build - hs23.6-b03 Reviewed-by: johnc
author jcoomes
date Sat, 08 Sep 2012 08:30:24 -0700
parents 69e41359aef0
children
rev   line source
duke@0 1 #
dcubed@3187 2 # Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
duke@0 7 # published by the Free Software Foundation.
duke@0 8 #
duke@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 # accompanied this code).
duke@0 14 #
duke@0 15 # You should have received a copy of the GNU General Public License version
duke@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 #
trims@1489 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1489 20 # or visit www.oracle.com if you need additional information or have any
trims@1489 21 # questions.
iveresov@1681 22 #
duke@0 23 #
duke@0 24
duke@0 25 # Note: this makefile is invoked both from build.bat and from the J2SE
duke@0 26 # control workspace in exactly the same manner; the required
duke@0 27 # environment variables (Variant, WorkSpace, BootStrapDir, BuildUser, HOTSPOT_BUILD_VERSION)
duke@0 28 # are passed in as command line arguments.
duke@0 29
dcubed@1335 30 # Note: Running nmake or build.bat from the Windows command shell requires
dcubed@1335 31 # that "sh" be accessible on the PATH. An MKS install does this.
dcubed@1335 32
duke@0 33 # SA components are built if BUILD_WIN_SA=1 is specified.
duke@0 34 # See notes in README. This produces files:
duke@0 35 # 1. sa-jdi.jar - This is built before building jvm.dll
duke@0 36 # 2. sawindbg[_g].dll - Native library for SA - This is built after jvm.dll
duke@0 37 # - Also, .lib, .map, .pdb.
duke@0 38 #
duke@0 39 # Please refer to ./makefiles/sa.make
duke@0 40
duke@0 41 # If we haven't set an ARCH yet use x86
duke@0 42 # create.bat and build.bat will set it, if used.
duke@0 43 !ifndef ARCH
duke@0 44 ARCH=x86
duke@0 45 !endif
duke@0 46
duke@0 47
duke@0 48 # Must be one of these values (if value comes in from env, can't trust it)
duke@0 49 !if "$(ARCH)" != "x86"
duke@0 50 !if "$(ARCH)" != "ia64"
duke@0 51 ARCH=x86
duke@0 52 !endif
duke@0 53 !endif
duke@0 54
duke@0 55 # At this point we should be certain that ARCH has a definition
duke@0 56 # now determine the BUILDARCH
duke@0 57 #
duke@0 58
duke@0 59 # the default BUILDARCH
duke@0 60 BUILDARCH=i486
duke@0 61
duke@0 62 # Allow control workspace to force Itanium or AMD64 builds with LP64
duke@0 63 ARCH_TEXT=
duke@0 64 !ifdef LP64
duke@0 65 !if "$(LP64)" == "1"
duke@0 66 ARCH_TEXT=64-Bit
duke@0 67 !if "$(ARCH)" == "x86"
duke@0 68 BUILDARCH=amd64
duke@0 69 !else
duke@0 70 BUILDARCH=ia64
duke@0 71 !endif
duke@0 72 !endif
duke@0 73 !endif
duke@0 74
duke@0 75 !if "$(BUILDARCH)" != "ia64"
duke@0 76 !ifndef CC_INTERP
iveresov@1805 77 !ifndef FORCE_TIERED
duke@0 78 FORCE_TIERED=1
duke@0 79 !endif
duke@0 80 !endif
iveresov@1805 81 !endif
duke@0 82
duke@0 83 !if "$(BUILDARCH)" == "amd64"
duke@0 84 Platform_arch=x86
duke@0 85 Platform_arch_model=x86_64
duke@0 86 !endif
duke@0 87 !if "$(BUILDARCH)" == "i486"
duke@0 88 Platform_arch=x86
duke@0 89 Platform_arch_model=x86_32
duke@0 90 !endif
duke@0 91
duke@0 92 # Supply these from the command line or the environment
duke@0 93 # It doesn't make sense to default this one
duke@0 94 Variant=
duke@0 95 # It doesn't make sense to default this one
duke@0 96 WorkSpace=
duke@0 97
duke@0 98 variantDir = windows_$(BUILDARCH)_$(Variant)
duke@0 99
duke@0 100 realVariant=$(Variant)
duke@0 101 VARIANT_TEXT=Core
duke@0 102 !if "$(Variant)" == "compiler1"
duke@0 103 VARIANT_TEXT=Client
duke@0 104 !elseif "$(Variant)" == "compiler2"
iveresov@1805 105 !if "$(FORCE_TIERED)" == "1"
duke@0 106 VARIANT_TEXT=Server
duke@0 107 realVariant=tiered
duke@0 108 !else
duke@0 109 VARIANT_TEXT=Server
duke@0 110 !endif
duke@0 111 !elseif "$(Variant)" == "tiered"
duke@0 112 VARIANT_TEXT=Tiered
duke@0 113 !elseif "$(Variant)" == "kernel"
duke@0 114 VARIANT_TEXT=Kernel
duke@0 115 !endif
duke@0 116
duke@0 117 #########################################################################
duke@0 118 # Parameters for VERSIONINFO resource for jvm[_g].dll.
duke@0 119 # These can be overridden via the nmake.exe command line.
duke@0 120 # They are overridden by RE during the control builds.
duke@0 121 #
duke@0 122 !include "$(WorkSpace)/make/hotspot_version"
duke@0 123
kamg@104 124 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
kamg@104 125 # or make/hotspot_distro.
duke@0 126 !ifndef HOTSPOT_VM_DISTRO
kamg@104 127 !if exists($(WorkSpace)\src\closed)
zgu@2419 128
zgu@2419 129 # if the build is for JDK6 or earlier version, it should include jdk6_hotspot_distro,
zgu@2419 130 # instead of hotspot_distro.
zgu@2419 131 JDK6_OR_EARLIER=0
zgu@2419 132 !if "$(JDK_MAJOR_VERSION)" != "" && "$(JDK_MINOR_VERSION)" != "" && "$(JDK_MICRO_VERSION)" != ""
zgu@2419 133 !if $(JDK_MAJOR_VERSION) == 1 && $(JDK_MINOR_VERSION) < 7
zgu@2419 134 JDK6_OR_EARLIER=1
zgu@2419 135 !endif
zgu@2419 136 !else
zgu@2419 137 !if $(JDK_MAJOR_VER) == 1 && $(JDK_MINOR_VER) < 7
zgu@2419 138 JDK6_OR_EARLIER=1
zgu@2419 139 !endif
zgu@2419 140 !endif
zgu@2419 141
zgu@2419 142 !if $(JDK6_OR_EARLIER) == 1
zgu@2419 143 !include $(WorkSpace)\make\jdk6_hotspot_distro
zgu@2419 144 !else
kamg@104 145 !include $(WorkSpace)\make\hotspot_distro
zgu@2419 146 !endif
duke@0 147 !else
kamg@104 148 !include $(WorkSpace)\make\openjdk_distro
duke@0 149 !endif
duke@0 150 !endif
duke@0 151
duke@0 152 # Following the Web Start / Plugin model here....
duke@0 153 # We can have update versions like "01a", but Windows requires
duke@0 154 # we use only integers in the file version field. So:
duke@0 155 # JDK_UPDATE_VER = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION
iveresov@1681 156 #
duke@0 157 JDK_UPDATE_VER=0
duke@0 158 JDK_BUILD_NUMBER=0
duke@0 159
duke@0 160 HS_FILEDESC=$(HOTSPOT_VM_DISTRO) $(ARCH_TEXT) $(VARIANT_TEXT) VM
duke@0 161
duke@0 162 # JDK ProductVersion:
duke@0 163 # 1.5.0_<wx>-b<yz> will have DLL version 5.0.wx*10.yz
duke@0 164 # Thus, 1.5.0_10-b04 will be 5.0.100.4
duke@0 165 # 1.6.0-b01 will be 6.0.0.1
duke@0 166 # 1.6.0_01a-b02 will be 6.0.11.2
duke@0 167 #
duke@0 168 # JDK_* variables are defined in make/hotspot_version or on command line
iveresov@1681 169 #
duke@0 170 JDK_VER=$(JDK_MINOR_VER),$(JDK_MICRO_VER),$(JDK_UPDATE_VER),$(JDK_BUILD_NUMBER)
duke@0 171 JDK_DOTVER=$(JDK_MINOR_VER).$(JDK_MICRO_VER).$(JDK_UPDATE_VER).$(JDK_BUILD_NUMBER)
duke@0 172 !if "$(JRE_RELEASE_VERSION)" == ""
duke@0 173 JRE_RELEASE_VER=$(JDK_MAJOR_VER).$(JDK_MINOR_VER).$(JDK_MICRO_VER)
duke@0 174 !else
duke@0 175 JRE_RELEASE_VER=$(JRE_RELEASE_VERSION)
duke@0 176 !endif
duke@0 177 !if "$(JDK_MKTG_VERSION)" == ""
duke@0 178 JDK_MKTG_VERSION=$(JDK_MINOR_VER).$(JDK_MICRO_VER)
duke@0 179 !endif
duke@0 180
duke@0 181 # Hotspot Express VM FileVersion:
duke@0 182 # 10.0-b<yz> will have DLL version 10.0.0.yz (need 4 numbers).
iveresov@1681 183 #
duke@0 184 # HS_* variables are defined in make/hotspot_version
duke@0 185 #
duke@0 186 HS_VER=$(HS_MAJOR_VER),$(HS_MINOR_VER),0,$(HS_BUILD_NUMBER)
duke@0 187 HS_DOTVER=$(HS_MAJOR_VER).$(HS_MINOR_VER).0.$(HS_BUILD_NUMBER)
duke@0 188
duke@0 189 !if "$(HOTSPOT_RELEASE_VERSION)" == ""
duke@0 190 HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)
duke@0 191 !endif
duke@0 192
duke@0 193 !if "$(HOTSPOT_BUILD_VERSION)" == ""
duke@0 194 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)
duke@0 195 !else
duke@0 196 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
duke@0 197 !endif
duke@0 198
duke@0 199 # End VERSIONINFO parameters
duke@0 200
duke@0 201
duke@0 202 # We don't support SA on ia64, and we can't
iveresov@1681 203 # build it if we are using a version of Vis Studio
duke@0 204 # older than .Net 2003.
duke@0 205 # SA_INCLUDE and SA_LIB are hold-overs from a previous
duke@0 206 # implementation in which we could build SA using
duke@0 207 # Debugging Tools For Windows, in which the .h/.lib files
duke@0 208 # and the .dlls are in different places than
duke@0 209 # they are for Vis Studio .Net 2003.
duke@0 210 # If that code ever needs to be resurrected, these vars
duke@0 211 # can be set here. They are used in makefiles/sa.make.
duke@0 212
duke@0 213 checkSA::
duke@0 214
duke@0 215 !if "$(BUILD_WIN_SA)" != "1"
duke@0 216 checkSA::
duke@0 217 @echo Not building SA: BUILD_WIN_SA != 1
duke@0 218
duke@0 219 !elseif "$(ARCH)" == "ia64"
duke@0 220 BUILD_WIN_SA = 0
duke@0 221 checkSA::
duke@0 222 @echo Not building SA: ARCH = ia64
duke@0 223
duke@0 224 !endif # ! "$(BUILD_WIN_SA)" != "1"
duke@0 225
duke@0 226 #########################################################################
duke@0 227
duke@0 228 # With the jvm_g.dll now being named jvm.dll, we can't build both and place
duke@0 229 # the dll's in the same directory, so we only build one at a time,
duke@0 230 # re-directing the output to different output directories (done by user
duke@0 231 # of this makefile).
duke@0 232 #
duke@0 233 defaultTarget: product
duke@0 234
duke@0 235 # The product or release build is an optimized build, and is the default
duke@0 236
duke@0 237 # note that since all the build targets depend on local.make that BUILDARCH
duke@0 238 # and Platform_arch and Platform_arch_model will get set in local.make
duke@0 239 # and there is no need to pass them thru here on the command line
duke@0 240 #
duke@0 241 product release optimized: checks $(variantDir) $(variantDir)\local.make sanity
duke@0 242 cd $(variantDir)
kamg@104 243 nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=product ARCH=$(ARCH)
duke@0 244
duke@0 245 # The debug or jvmg (all the same thing) is an optional build
duke@0 246 debug jvmg: checks $(variantDir) $(variantDir)\local.make sanity
duke@0 247 cd $(variantDir)
kamg@104 248 nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=debug ARCH=$(ARCH)
duke@0 249 fastdebug: checks $(variantDir) $(variantDir)\local.make sanity
duke@0 250 cd $(variantDir)
kamg@104 251 nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=fastdebug ARCH=$(ARCH)
duke@0 252
duke@0 253 develop: checks $(variantDir) $(variantDir)\local.make sanity
duke@0 254 cd $(variantDir)
kamg@104 255 nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=product DEVELOP=1 ARCH=$(ARCH)
duke@0 256
dcubed@1329 257 # target to create just the directory structure
dcubed@1329 258 tree: checks $(variantDir) $(variantDir)\local.make sanity
dcubed@1329 259 mkdir $(variantDir)\product
dcubed@1329 260 mkdir $(variantDir)\debug
dcubed@1329 261 mkdir $(variantDir)\fastdebug
dcubed@1329 262
duke@0 263 sanity:
duke@0 264 @ echo;
duke@0 265 @ cd $(variantDir)
kamg@104 266 @ nmake -nologo -f $(WorkSpace)\make\windows\makefiles\sanity.make
duke@0 267 @ cd ..
duke@0 268 @ echo;
duke@0 269
duke@0 270 clean: checkVariant
duke@0 271 - rm -r -f $(variantDir)
duke@0 272
duke@0 273 $(variantDir):
duke@0 274 mkdir $(variantDir)
duke@0 275
duke@0 276 $(variantDir)\local.make: checks
duke@0 277 @ echo # Generated file > $@
duke@0 278 @ echo Variant=$(realVariant) >> $@
duke@0 279 @ echo WorkSpace=$(WorkSpace) >> $@
duke@0 280 @ echo BootStrapDir=$(BootStrapDir) >> $@
zgu@2419 281 @ if "$(USERNAME)" NEQ "" echo BuildUser=$(USERNAME) >> $@
duke@0 282 @ echo HS_VER=$(HS_VER) >> $@
duke@0 283 @ echo HS_DOTVER=$(HS_DOTVER) >> $@
duke@0 284 @ echo HS_COMPANY=$(COMPANY_NAME) >> $@
duke@0 285 @ echo HS_FILEDESC=$(HS_FILEDESC) >> $@
duke@0 286 @ echo HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) >> $@
duke@0 287 @ echo HS_COPYRIGHT=$(HOTSPOT_VM_COPYRIGHT) >> $@
duke@0 288 @ echo HS_NAME=$(PRODUCT_NAME) $(JDK_MKTG_VERSION) >> $@
duke@0 289 @ echo HS_BUILD_VER=$(HS_BUILD_VER) >> $@
duke@0 290 @ echo BUILD_WIN_SA=$(BUILD_WIN_SA) >> $@
duke@0 291 @ echo SA_BUILD_VERSION=$(HS_BUILD_VER) >> $@
duke@0 292 @ echo SA_INCLUDE=$(SA_INCLUDE) >> $@
duke@0 293 @ echo SA_LIB=$(SA_LIB) >> $@
duke@0 294 @ echo JDK_VER=$(JDK_VER) >> $@
duke@0 295 @ echo JDK_DOTVER=$(JDK_DOTVER) >> $@
duke@0 296 @ echo JRE_RELEASE_VER=$(JRE_RELEASE_VER) >> $@
duke@0 297 @ echo BUILDARCH=$(BUILDARCH) >> $@
duke@0 298 @ echo Platform_arch=$(Platform_arch) >> $@
duke@0 299 @ echo Platform_arch_model=$(Platform_arch_model) >> $@
kamg@104 300 @ sh $(WorkSpace)/make/windows/get_msc_ver.sh >> $@
dcubed@3187 301 @ if "$(ENABLE_FULL_DEBUG_SYMBOLS)" NEQ "" echo ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) >> $@
dcubed@3187 302 @ if "$(ZIP_DEBUGINFO_FILES)" NEQ "" echo ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) >> $@
dcubed@3187 303 @ if "$(RM)" NEQ "" echo RM=$(RM) >> $@
dcubed@3187 304 @ if "$(ZIPEXE)" NEQ "" echo ZIPEXE=$(ZIPEXE) >> $@
duke@0 305
duke@0 306 checks: checkVariant checkWorkSpace checkSA
duke@0 307
duke@0 308 checkVariant:
duke@0 309 @ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
duke@0 310 @ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "kernel" if "$(Variant)" NEQ "core" \
duke@0 311 echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
duke@0 312
duke@0 313 checkWorkSpace:
duke@0 314 @ if "$(WorkSpace)"=="" echo Need to specify "WorkSpace=..." && false
duke@0 315
duke@0 316 checkBuildID:
duke@0 317 @ if "$(BuildID)"=="" echo Need to specify "BuildID=..." && false