make/windows/build.make

Tue, 16 Mar 2010 17:47:03 -0600

author
dcubed
date
Tue, 16 Mar 2010 17:47:03 -0600
changeset 1757
21141e23627a
parent 891
b6272ef4a18f
child 1763
39e409a664b3
permissions
-rw-r--r--

6923488: 4/4 need minor tweaks to HotSpot build for Cygwin
Summary: Clean up get_msc_ver, build.bat and build.make in general and for Cygwin.
Reviewed-by: ohair

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

mercurial