source: trunk/openjdk/hotspot/make/windows/build.make

Last change on this file was 309, checked in by dmik, 14 years ago

trunk: Merged in openjdk6 b24 from branches/vendor/oracle.

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