hotspot/build/windows/build.make
changeset 1 489c9b5090e2
equal deleted inserted replaced
0:fd16c54261b3 1:489c9b5090e2
       
     1 #
       
     2 # Copyright 1998-2007 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 #
       
    24 
       
    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.
       
    29 
       
    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
       
    37 
       
    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
       
    43 
       
    44 
       
    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
       
    51 
       
    52 # At this point we should be certain that ARCH has a definition
       
    53 # now determine the BUILDARCH
       
    54 #
       
    55 
       
    56 # the default BUILDARCH
       
    57 BUILDARCH=i486
       
    58 
       
    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
       
    71 
       
    72 !if "$(BUILDARCH)" != "amd64"
       
    73 !if "$(BUILDARCH)" != "ia64"
       
    74 !ifndef CC_INTERP
       
    75 FORCE_TIERED=1
       
    76 !endif
       
    77 !endif
       
    78 !endif
       
    79 
       
    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
       
    88 
       
    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=
       
    94 
       
    95 variantDir = windows_$(BUILDARCH)_$(Variant)
       
    96 
       
    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
       
   113 
       
   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"
       
   120 
       
   121 # Define HOTSPOT_VM_DISTRO based on settings in build/hotspot_distro
       
   122 # or build/closed/hotspot_distro.
       
   123 !ifndef HOTSPOT_VM_DISTRO
       
   124 !if exists($(WorkSpace)\build\closed)
       
   125 !include $(WorkSpace)\build\closed\hotspot_distro
       
   126 !else
       
   127 !include $(WorkSpace)\build\hotspot_distro
       
   128 !endif
       
   129 !endif
       
   130 
       
   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
       
   138 
       
   139 HS_FILEDESC=$(HOTSPOT_VM_DISTRO) $(ARCH_TEXT) $(VARIANT_TEXT) VM
       
   140 
       
   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
       
   159 
       
   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)
       
   167 
       
   168 !if "$(HOTSPOT_RELEASE_VERSION)" == ""
       
   169 HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)
       
   170 !endif
       
   171 
       
   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
       
   177 
       
   178 # End VERSIONINFO parameters
       
   179 
       
   180 
       
   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.
       
   191 
       
   192 checkSA::
       
   193 
       
   194 !if "$(BUILD_WIN_SA)" != "1"
       
   195 checkSA::
       
   196 	@echo     Not building SA:  BUILD_WIN_SA != 1
       
   197 
       
   198 !elseif "$(ARCH)" == "ia64"
       
   199 BUILD_WIN_SA = 0
       
   200 checkSA::
       
   201 	@echo     Not building SA:  ARCH = ia64
       
   202 
       
   203 !elseif exist("$(MSVCDIR)\PlatformSDK\Include\dbgeng.h")
       
   204 # These don't have to be set because the default
       
   205 # setting of INCLUDE and LIB already contain the needed dirs.
       
   206 SA_INCLUDE = 
       
   207 SA_LIB = 
       
   208 
       
   209 !elseif exist("$(SYSTEMROOT)\..\Program Files\Microsoft SDK\include\dbgeng.h")
       
   210 # These don't have to be set because the default
       
   211 # setting of INCLUDE and LIB already contain the needed dirs.
       
   212 SA_INCLUDE =
       
   213 SA_LIB = 
       
   214 
       
   215 !else
       
   216 checkSA::
       
   217 	@echo .
       
   218 	@echo ERROR:  Can't build SA because dbgeng.h does not exist here:
       
   219 	@echo     $(MSVCDIR)\PlatformSDK\Include\dbgeng.h
       
   220 	@echo nor here:
       
   221 	@echo     $(SYSTEMROOT)\..\Program Files\Microsoft SDK\include\dbgeng.h
       
   222 	@echo You must use Vis. Studio .Net 2003 on Win 32, and you must
       
   223 	@echo have the Microsoft SDK installed on Win amd64.
       
   224 	@echo You can disable building of SA by specifying BUILD_WIN_SA = 0
       
   225 	@echo . && false
       
   226 !endif  # ! "$(BUILD_WIN_SA)" != "1"
       
   227 
       
   228 #########################################################################
       
   229 
       
   230 # With the jvm_g.dll now being named jvm.dll, we can't build both and place
       
   231 #   the dll's in the same directory, so we only build one at a time,
       
   232 #   re-directing the output to different output directories (done by user
       
   233 #   of this makefile).
       
   234 #
       
   235 defaultTarget: product
       
   236 
       
   237 # The product or release build is an optimized build, and is the default
       
   238 
       
   239 # note that since all the build targets depend on local.make that BUILDARCH
       
   240 # and Platform_arch and Platform_arch_model will get set in local.make
       
   241 # and there is no need to pass them thru here on the command line
       
   242 #
       
   243 product release optimized: checks $(variantDir) $(variantDir)\local.make sanity
       
   244 	cd $(variantDir)
       
   245 	nmake -nologo -f $(WorkSpace)\build\windows\makefiles\top.make BUILD_FLAVOR=product ARCH=$(ARCH)
       
   246 
       
   247 # The debug or jvmg (all the same thing) is an optional build
       
   248 debug jvmg: checks $(variantDir) $(variantDir)\local.make sanity
       
   249 	cd $(variantDir)
       
   250 	nmake -nologo -f $(WorkSpace)\build\windows\makefiles\top.make BUILD_FLAVOR=debug ARCH=$(ARCH)
       
   251 fastdebug: checks $(variantDir) $(variantDir)\local.make sanity
       
   252 	cd $(variantDir)
       
   253 	nmake -nologo -f $(WorkSpace)\build\windows\makefiles\top.make BUILD_FLAVOR=fastdebug ARCH=$(ARCH)
       
   254 
       
   255 develop: checks $(variantDir) $(variantDir)\local.make sanity
       
   256 	cd $(variantDir)
       
   257 	nmake -nologo -f $(WorkSpace)\build\windows\makefiles\top.make BUILD_FLAVOR=product DEVELOP=1 ARCH=$(ARCH)
       
   258 
       
   259 sanity:
       
   260 	@ echo;
       
   261 	@ cd $(variantDir)
       
   262 	@ nmake -nologo -f $(WorkSpace)\build\windows\makefiles\sanity.make
       
   263 	@ cd ..
       
   264 	@ echo;
       
   265 
       
   266 clean: checkVariant
       
   267 	- rm -r -f $(variantDir)
       
   268 
       
   269 $(variantDir):
       
   270 	mkdir $(variantDir)
       
   271 
       
   272 $(variantDir)\local.make: checks
       
   273 	@ echo # Generated file					>  $@
       
   274 	@ echo Variant=$(realVariant)				>> $@
       
   275 	@ echo WorkSpace=$(WorkSpace)				>> $@
       
   276 	@ echo BootStrapDir=$(BootStrapDir)			>> $@
       
   277         @ if "$(USERNAME)" NEQ "" echo BuildUser=$(USERNAME)	>> $@
       
   278 	@ echo HS_VER=$(HS_VER)					>> $@
       
   279 	@ echo HS_DOTVER=$(HS_DOTVER)				>> $@
       
   280 	@ echo HS_COMPANY=$(COMPANY_NAME)			>> $@
       
   281 	@ echo HS_FILEDESC=$(HS_FILEDESC)			>> $@
       
   282 	@ echo HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO)		>> $@
       
   283 	@ echo HS_COPYRIGHT=$(HOTSPOT_VM_COPYRIGHT)		>> $@
       
   284 	@ echo HS_NAME=$(PRODUCT_NAME) $(JDK_MKTG_VERSION)	>> $@
       
   285 	@ echo HS_BUILD_VER=$(HS_BUILD_VER)			>> $@
       
   286 	@ echo BUILD_WIN_SA=$(BUILD_WIN_SA)    			>> $@
       
   287 	@ echo SA_BUILD_VERSION=$(HS_BUILD_VER)                 >> $@
       
   288 	@ echo SA_INCLUDE=$(SA_INCLUDE)      			>> $@
       
   289 	@ echo SA_LIB=$(SA_LIB)         			>> $@
       
   290 	@ echo JDK_VER=$(JDK_VER)				>> $@
       
   291 	@ echo JDK_DOTVER=$(JDK_DOTVER)				>> $@
       
   292 	@ echo JRE_RELEASE_VER=$(JRE_RELEASE_VER)		>> $@
       
   293 	@ echo BUILDARCH=$(BUILDARCH)         			>> $@
       
   294 	@ echo Platform_arch=$(Platform_arch)        		>> $@
       
   295 	@ echo Platform_arch_model=$(Platform_arch_model)	>> $@
       
   296 	@ sh $(WorkSpace)/build/windows/get_msc_ver.sh		>> $@
       
   297 
       
   298 checks: checkVariant checkWorkSpace checkSA
       
   299 
       
   300 checkVariant:
       
   301 	@ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
       
   302 	@ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "kernel" if "$(Variant)" NEQ "core" \
       
   303           echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
       
   304 
       
   305 checkWorkSpace:
       
   306 	@ if "$(WorkSpace)"=="" echo Need to specify "WorkSpace=..." && false
       
   307 
       
   308 checkBuildID:
       
   309 	@ if "$(BuildID)"=="" echo Need to specify "BuildID=..." && false