annotate make/windows/create.bat @ 1408:0ba67bb5392c

added c1x build directory, added MSVC Win64 project support
author lstadler
date Wed, 12 May 2010 15:01:05 +0200
parents 39e409a664b3
children 2d26b0046e0d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 @echo off
a61af66fc99e Initial load
duke
parents:
diff changeset
2 REM
844
bd02caa94611 6862919: Update copyright year
xdono
parents: 659
diff changeset
3 REM Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
4 REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
5 REM
a61af66fc99e Initial load
duke
parents:
diff changeset
6 REM This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
7 REM under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
8 REM published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
9 REM
a61af66fc99e Initial load
duke
parents:
diff changeset
10 REM This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
11 REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
12 REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
13 REM version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
14 REM accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
15 REM
a61af66fc99e Initial load
duke
parents:
diff changeset
16 REM You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
17 REM 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
18 REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
19 REM
a61af66fc99e Initial load
duke
parents:
diff changeset
20 REM Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
21 REM CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
22 REM have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
23 REM
a61af66fc99e Initial load
duke
parents:
diff changeset
24 REM
a61af66fc99e Initial load
duke
parents:
diff changeset
25
a61af66fc99e Initial load
duke
parents:
diff changeset
26 REM This is the interactive build setup script (as opposed to the batch
a61af66fc99e Initial load
duke
parents:
diff changeset
27 REM build execution script). It creates $HotSpotBuildSpace if necessary,
a61af66fc99e Initial load
duke
parents:
diff changeset
28 REM copies the appropriate files out of $HotSpotWorkSpace into it, and
a61af66fc99e Initial load
duke
parents:
diff changeset
29 REM builds and runs MakeDeps in it. This has the side-effect of creating
a61af66fc99e Initial load
duke
parents:
diff changeset
30 REM the vm.vcproj file in the buildspace, which is then used in Visual C++.
a61af66fc99e Initial load
duke
parents:
diff changeset
31 REM
a61af66fc99e Initial load
duke
parents:
diff changeset
32 REM The generated project file depends upon the include databases. If
a61af66fc99e Initial load
duke
parents:
diff changeset
33 REM those are changed then MakeDeps is rerun.
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 REM
a61af66fc99e Initial load
duke
parents:
diff changeset
36 REM Since we don't have uname and we could be cross-compiling,
a61af66fc99e Initial load
duke
parents:
diff changeset
37 REM Use the compiler to determine which ARCH we are building
a61af66fc99e Initial load
duke
parents:
diff changeset
38 REM
1328
39e409a664b3 6938185: 3/4 6923488 breaks Windows command shell builds
dcubed
parents: 844
diff changeset
39 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
40 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
41 REM
0
a61af66fc99e Initial load
duke
parents:
diff changeset
42 cl 2>&1 | grep "IA-64" >NUL
a61af66fc99e Initial load
duke
parents:
diff changeset
43 if %errorlevel% == 0 goto isia64
a61af66fc99e Initial load
duke
parents:
diff changeset
44 cl 2>&1 | grep "AMD64" >NUL
a61af66fc99e Initial load
duke
parents:
diff changeset
45 if %errorlevel% == 0 goto amd64
1408
0ba67bb5392c added c1x build directory, added MSVC Win64 project support
lstadler
parents: 1328
diff changeset
46 cl 2>&1 | grep "x64" >NUL
0ba67bb5392c added c1x build directory, added MSVC Win64 project support
lstadler
parents: 1328
diff changeset
47 if %errorlevel% == 0 goto amd64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
48 set ARCH=x86
a61af66fc99e Initial load
duke
parents:
diff changeset
49 set BUILDARCH=i486
a61af66fc99e Initial load
duke
parents:
diff changeset
50 set Platform_arch=x86
a61af66fc99e Initial load
duke
parents:
diff changeset
51 set Platform_arch_model=x86_32
a61af66fc99e Initial load
duke
parents:
diff changeset
52 goto end
a61af66fc99e Initial load
duke
parents:
diff changeset
53 :amd64
a61af66fc99e Initial load
duke
parents:
diff changeset
54 set ARCH=x86
a61af66fc99e Initial load
duke
parents:
diff changeset
55 set BUILDARCH=amd64
a61af66fc99e Initial load
duke
parents:
diff changeset
56 set Platform_arch=x86
a61af66fc99e Initial load
duke
parents:
diff changeset
57 set Platform_arch_model=x86_64
a61af66fc99e Initial load
duke
parents:
diff changeset
58 goto end
a61af66fc99e Initial load
duke
parents:
diff changeset
59 :isia64
a61af66fc99e Initial load
duke
parents:
diff changeset
60 set ARCH=ia64
a61af66fc99e Initial load
duke
parents:
diff changeset
61 set BUILDARCH=ia64
a61af66fc99e Initial load
duke
parents:
diff changeset
62 set Platform_arch=ia64
a61af66fc99e Initial load
duke
parents:
diff changeset
63 set Platform_arch_model=ia64
a61af66fc99e Initial load
duke
parents:
diff changeset
64 :end
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 setlocal
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68 if "%1" == "" goto usage
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 if not "%4" == "" goto usage
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 set HotSpotWorkSpace=%1
a61af66fc99e Initial load
duke
parents:
diff changeset
73 set HotSpotBuildSpace=%2
a61af66fc99e Initial load
duke
parents:
diff changeset
74 set HotSpotJDKDist=%3
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 REM figure out MSC version
91
a294fd0c4b38 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 0
diff changeset
77 for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i
0
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 echo **************************************************************
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
80 set ProjectFile=vm.vcproj
0
a61af66fc99e Initial load
duke
parents:
diff changeset
81 if "%MSC_VER%" == "1200" (
a61af66fc99e Initial load
duke
parents:
diff changeset
82 set ProjectFile=vm.dsp
a61af66fc99e Initial load
duke
parents:
diff changeset
83 echo Will generate VC6 project {unsupported}
a61af66fc99e Initial load
duke
parents:
diff changeset
84 ) else (
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
85 if "%MSC_VER%" == "1400" (
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
86 echo Will generate VC8 {Visual Studio 2005}
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
87 ) else (
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
88 if "%MSC_VER%" == "1500" (
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
89 echo Will generate VC9 {Visual Studio 2008}
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
90 ) else (
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
91 echo Will generate VC7 project {Visual Studio 2003 .NET}
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
92 )
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 196
diff changeset
93 )
0
a61af66fc99e Initial load
duke
parents:
diff changeset
94 )
a61af66fc99e Initial load
duke
parents:
diff changeset
95 echo %ProjectFile%
a61af66fc99e Initial load
duke
parents:
diff changeset
96 echo **************************************************************
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 REM Test all variables to see whether the directories they
a61af66fc99e Initial load
duke
parents:
diff changeset
99 REM reference exist
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 if exist %HotSpotWorkSpace% goto test1
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 echo Error: directory pointed to by HotSpotWorkSpace
a61af66fc99e Initial load
duke
parents:
diff changeset
104 echo does not exist, or the variable is not set.
a61af66fc99e Initial load
duke
parents:
diff changeset
105 echo.
a61af66fc99e Initial load
duke
parents:
diff changeset
106 goto usage
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 :test1
a61af66fc99e Initial load
duke
parents:
diff changeset
109 if exist %HotSpotBuildSpace% goto test2
a61af66fc99e Initial load
duke
parents:
diff changeset
110 if not "%HotSpotBuildSpace%" == "" mkdir %HotSpotBuildSpace%
a61af66fc99e Initial load
duke
parents:
diff changeset
111 if exist %HotSpotBuildSpace% goto test2
a61af66fc99e Initial load
duke
parents:
diff changeset
112 echo Error: directory pointed to by HotSpotBuildSpace
a61af66fc99e Initial load
duke
parents:
diff changeset
113 echo does not exist, or the variable is not set.
a61af66fc99e Initial load
duke
parents:
diff changeset
114 echo.
a61af66fc99e Initial load
duke
parents:
diff changeset
115 goto usage
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 :test2
a61af66fc99e Initial load
duke
parents:
diff changeset
118 if exist %HotSpotJDKDist% goto test3
a61af66fc99e Initial load
duke
parents:
diff changeset
119 echo Error: directory pointed to by %HotSpotJDKDist%
a61af66fc99e Initial load
duke
parents:
diff changeset
120 echo does not exist, or the variable is not set.
a61af66fc99e Initial load
duke
parents:
diff changeset
121 echo.
a61af66fc99e Initial load
duke
parents:
diff changeset
122 goto usage
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 :test3
a61af66fc99e Initial load
duke
parents:
diff changeset
125 if not "%HOTSPOTMKSHOME%" == "" goto makedir
a61af66fc99e Initial load
duke
parents:
diff changeset
126 echo Warning: please set variable HOTSPOTMKSHOME to place where
a61af66fc99e Initial load
duke
parents:
diff changeset
127 echo your MKS/Cygwin installation is
a61af66fc99e Initial load
duke
parents:
diff changeset
128 echo.
a61af66fc99e Initial load
duke
parents:
diff changeset
129 goto usage
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 :makedir
a61af66fc99e Initial load
duke
parents:
diff changeset
132 echo NOTE: Using the following settings:
a61af66fc99e Initial load
duke
parents:
diff changeset
133 echo HotSpotWorkSpace=%HotSpotWorkSpace%
a61af66fc99e Initial load
duke
parents:
diff changeset
134 echo HotSpotBuildSpace=%HotSpotBuildSpace%
a61af66fc99e Initial load
duke
parents:
diff changeset
135 echo HotSpotJDKDist=%HotSpotJDKDist%
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 REM This is now safe to do.
a61af66fc99e Initial load
duke
parents:
diff changeset
139 :copyfiles
a61af66fc99e Initial load
duke
parents:
diff changeset
140 for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
a61af66fc99e Initial load
duke
parents:
diff changeset
141 if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i
91
a294fd0c4b38 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 0
diff changeset
142 copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL
0
a61af66fc99e Initial load
duke
parents:
diff changeset
143 )
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 REM force regneration of ProjectFile
a61af66fc99e Initial load
duke
parents:
diff changeset
146 if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile%
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
151 echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
152 echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
153 echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
154 echo. >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
155 echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
156 echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
157 echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
158 echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
159 echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
160 echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
161 echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 REM build config specific stuff
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 pushd %HotSpotBuildSpace%\%%i
a61af66fc99e Initial load
duke
parents:
diff changeset
166 nmake /nologo
a61af66fc99e Initial load
duke
parents:
diff changeset
167 popd
a61af66fc99e Initial load
duke
parents:
diff changeset
168 )
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 goto end
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 :usage
a61af66fc99e Initial load
duke
parents:
diff changeset
173 echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist
a61af66fc99e Initial load
duke
parents:
diff changeset
174 echo.
a61af66fc99e Initial load
duke
parents:
diff changeset
175 echo This is the interactive build setup script (as opposed to the batch
a61af66fc99e Initial load
duke
parents:
diff changeset
176 echo build execution script). It creates HotSpotBuildSpace if necessary,
a61af66fc99e Initial load
duke
parents:
diff changeset
177 echo copies the appropriate files out of HotSpotWorkSpace into it, and
a61af66fc99e Initial load
duke
parents:
diff changeset
178 echo builds and runs MakeDeps in it. This has the side-effect of creating
a61af66fc99e Initial load
duke
parents:
diff changeset
179 echo the %ProjectFile% file in the build space, which is then used in Visual C++.
a61af66fc99e Initial load
duke
parents:
diff changeset
180 echo The HotSpotJDKDist defines place where JVM binaries should be placed.
a61af66fc99e Initial load
duke
parents:
diff changeset
181 echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection.
a61af66fc99e Initial load
duke
parents:
diff changeset
182 echo.
a61af66fc99e Initial load
duke
parents:
diff changeset
183 echo The generated project file depends upon the include databases. If
a61af66fc99e Initial load
duke
parents:
diff changeset
184 echo those are changed then MakeDeps is rerun.
a61af66fc99e Initial load
duke
parents:
diff changeset
185 echo.
a61af66fc99e Initial load
duke
parents:
diff changeset
186 echo NOTE that it is now NOT safe to modify any of the files in the build
a61af66fc99e Initial load
duke
parents:
diff changeset
187 echo space, since they may be overwritten whenever this script is run or
a61af66fc99e Initial load
duke
parents:
diff changeset
188 echo nmake is run in that directory.
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 :end
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 endlocal