make/windows/build.make

Thu, 04 Apr 2019 17:56:29 +0800

author
aoqi
date
Thu, 04 Apr 2019 17:56:29 +0800
changeset 9572
624a0741915c
parent 6876
710a3c8b516e
child 9637
eef07cd490d4
permissions
-rw-r--r--

Merge

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

mercurial