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