make/windows/create.bat

Thu, 11 Feb 2010 19:52:57 -0800

author
trims
date
Thu, 11 Feb 2010 19:52:57 -0800
changeset 1658
3940517a1f13
parent 1279
bd02caa94611
child 1763
39e409a664b3
permissions
-rw-r--r--

Added tag hs17-b04 for changeset d8dd291a362a

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

mercurial