source: trunk/openjdk/hotspot/make/windows/create.bat

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: 7.7 KB
Line 
1@echo off
2REM
3REM Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
4REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5REM
6REM This code is free software; you can redistribute it and/or modify it
7REM under the terms of the GNU General Public License version 2 only, as
8REM published by the Free Software Foundation.
9REM
10REM This code is distributed in the hope that it will be useful, but WITHOUT
11REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13REM version 2 for more details (a copy is included in the LICENSE file that
14REM accompanied this code).
15REM
16REM You should have received a copy of the GNU General Public License version
17REM 2 along with this work; if not, write to the Free Software Foundation,
18REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19REM
20REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21REM or visit www.oracle.com if you need additional information or have any
22REM questions.
23REM
24REM
25
26REM This is the interactive build setup script (as opposed to the batch
27REM build execution script). It creates $HotSpotBuildSpace if necessary,
28REM copies the appropriate files out of $HotSpotWorkSpace into it, and
29REM builds and runs ProjectCreator in it. This has the side-effect of creating
30REM the vm.vcproj file in the buildspace, which is then used in Visual C++.
31
32REM
33REM Since we don't have uname and we could be cross-compiling,
34REM Use the compiler to determine which ARCH we are building
35REM
36REM Note: Running this batch file from the Windows command shell requires
37REM that "grep" be accessible on the PATH. An MKS install does this.
38REM
39
40cl 2>NUL >NUL
41if %errorlevel% == 0 goto nexttest
42echo Make sure cl.exe is in your PATH before running this script.
43goto end
44
45:nexttest
46grep -V 2>NUL >NUL
47if %errorlevel% == 0 goto testit
48echo Make sure grep.exe is in your PATH before running this script. Either cygwin or MKS should work.
49goto end
50
51
52:testit
53cl 2>&1 | grep "IA-64" >NUL
54if %errorlevel% == 0 goto isia64
55cl 2>&1 | grep "AMD64" >NUL
56if %errorlevel% == 0 goto amd64
57set ARCH=x86
58set BUILDARCH=i486
59set Platform_arch=x86
60set Platform_arch_model=x86_32
61goto done
62:amd64
63set ARCH=x86
64set BUILDARCH=amd64
65set Platform_arch=x86
66set Platform_arch_model=x86_64
67goto done
68:isia64
69set ARCH=ia64
70set BUILDARCH=ia64
71set Platform_arch=ia64
72set Platform_arch_model=ia64
73:done
74
75setlocal
76
77if "%1" == "" goto usage
78
79if not "%2" == "" goto usage
80
81REM Set HotSpotWorkSpace to the directy two steps above this script
82for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi)
83set HotSpotBuildRoot=%HotSpotWorkSpace%build
84set HotSpotBuildSpace=%HotSpotBuildRoot%\vs
85set HotSpotJDKDist=%1
86
87
88REM figure out MSC version
89for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i
90
91echo **************************************************************
92set ProjectFile=jvm.vcproj
93if "%MSC_VER%" == "1200" (
94set ProjectFile=jvm.dsp
95echo Will generate VC6 project {unsupported}
96) else (
97if "%MSC_VER%" == "1400" (
98echo Will generate VC8 {Visual Studio 2005}
99) else (
100if "%MSC_VER%" == "1500" (
101echo Will generate VC9 {Visual Studio 2008}
102) else (
103if "%MSC_VER%" == "1600" (
104echo Detected Visual Studio 2010, but
105echo will generate VC9 {Visual Studio 2008}
106echo Use conversion wizard in VS 2010.
107) else (
108echo Will generate VC7 project {Visual Studio 2003 .NET}
109)
110)
111)
112)
113echo %ProjectFile%
114echo **************************************************************
115
116REM Test all variables to see whether the directories they
117REM reference exist
118
119if exist %HotSpotWorkSpace% goto test1
120
121echo Error: directory pointed to by HotSpotWorkSpace
122echo does not exist, or the variable is not set.
123echo.
124goto usage
125
126:test1
127if exist %HotSpotBuildSpace% goto test2
128if not "%HotSpotBuildSpace%" == "" mkdir %HotSpotBuildSpace%
129if exist %HotSpotBuildSpace% goto test2
130echo Error: directory pointed to by HotSpotBuildSpace
131echo does not exist, or the variable is not set.
132echo.
133goto usage
134
135:test2
136if exist %HotSpotJDKDist% goto test3
137echo Error: directory pointed to by %HotSpotJDKDist%
138echo does not exist, or the variable is not set.
139echo.
140goto usage
141
142:test3
143if not "%HOTSPOTMKSHOME%" == "" goto makedir
144if exist c:\cygwin\bin set HOTSPOTMKSHOME=c:\cygwin\bin
145if not "%HOTSPOTMKSHOME%" == "" goto makedir
146echo Warning: please set variable HOTSPOTMKSHOME to place where
147echo your MKS/Cygwin installation is
148echo.
149goto usage
150
151:makedir
152echo NOTE: Using the following settings:
153echo HotSpotWorkSpace=%HotSpotWorkSpace%
154echo HotSpotBuildSpace=%HotSpotBuildSpace%
155echo HotSpotJDKDist=%HotSpotJDKDist%
156
157
158REM This is now safe to do.
159:copyfiles
160for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
161if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
162copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
163)
164
165REM force regneration of ProjectFile
166if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile%
167
168for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
169echo -- %%i --
170echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
171echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
172echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make
173echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make
174echo. >> %HotSpotBuildSpace%\%%i\local.make
175echo Variant=%%i >> %HotSpotBuildSpace%\%%i\local.make
176echo WorkSpace=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make
177echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make
178echo HOTSPOTBUILDROOT=%HotSpotBuildRoot% >> %HotSpotBuildSpace%\%%i\local.make
179echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make
180echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make
181echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make
182echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make
183echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make
184echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make
185
186for /D %%j in (debug, fastdebug, product) do (
187if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j
188)
189
190pushd %HotSpotBuildSpace%\%%i\generated
191nmake /nologo
192popd
193
194)
195
196pushd %HotSpotBuildRoot%
197
198REM It doesn't matter which variant we use here, "compiler1" is as good as any of the others - we need the common variables
199nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %HotSpotBuildRoot%/%ProjectFile%
200
201popd
202
203goto end
204
205:usage
206echo Usage: create HotSpotJDKDist
207echo.
208echo This is the VS build setup script (as opposed to the batch
209echo build execution script). It creates a build directory if necessary,
210echo copies the appropriate files out of the workspace into it, and
211echo builds and runs ProjectCreator in it. This has the side-effect of creating
212echo the %ProjectFile% file in the build space, which is then used in Visual C++.
213echo.
214echo The HotSpotJDKDist defines the JDK that should be used when running the JVM.
215echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection.
216echo.
217echo NOTE that it is now NOT safe to modify any of the files in the build
218echo space, since they may be overwritten whenever this script is run or
219echo nmake is run in that directory.
220
221:end
222
223endlocal
Note: See TracBrowser for help on using the repository browser.