make/windows/build.make

Sat, 25 Jan 2020 06:34:42 +0000

author
clanger
date
Sat, 25 Jan 2020 06:34:42 +0000
changeset 9823
147dfbe6ffa1
parent 9634
d1520f0c3524
child 9852
70aa912cebe5
child 9896
1b8c45b8216a
permissions
-rw-r--r--

8233995: java.vm.vendor (and potentially other properties/fields) not correctly set in Windows/Hotspot build of OpenJDK8
Reviewed-by: andrew

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

mercurial