make/windows/build.make

Tue, 26 Apr 2011 16:20:22 -0700

author
ohair
date
Tue, 26 Apr 2011 16:20:22 -0700
changeset 2796
4ca65400aa33
parent 2273
34bd82eba3bb
child 2842
69e41359aef0
permissions
-rw-r--r--

6631003: Add hg tip changeset to build image
Reviewed-by: mduigou

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

mercurial