make/windows/build.make

Thu, 11 Feb 2010 19:52:57 -0800

author
trims
date
Thu, 11 Feb 2010 19:52:57 -0800
changeset 1658
3940517a1f13
parent 891
b6272ef4a18f
child 1757
21141e23627a
permissions
-rw-r--r--

Added tag hs17-b04 for changeset d8dd291a362a

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

mercurial