Vishal Bhoj | 82c8071 | 2015-12-15 21:13:33 +0530 | [diff] [blame] | 1 | @REM @file
|
| 2 | @REM Windows batch file to set up the Microsoft Visual Studio environment
|
| 3 | @REM
|
| 4 | @REM This script is used to set up one of the Microsoft Visual Studio
|
| 5 | @REM environments, VS2008x86, VS2010x86, VS2012x86 or VS2013x86 for
|
| 6 | @REM building the Nt32Pkg/Nt32Pkg.dsc emulation environment to run on
|
| 7 | @REM an X64 version of Windows.
|
| 8 | @REM The system environment variables in this script are set by the
|
| 9 | @rem Edk2Setup.bat script (that will be renamed to edksetup.bat).
|
| 10 | @REM
|
| 11 | @REM This script can also be used to build the Win32 binaries
|
| 12 | @REM
|
| 13 | @REM Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
| 14 | @REM This program and the accompanying materials
|
| 15 | @REM are licensed and made available under the terms and conditions of the BSD License
|
| 16 | @REM which accompanies this distribution. The full text of the license may be found at
|
| 17 | @REM http://opensource.org/licenses/bsd-license.php
|
| 18 | @REM
|
| 19 | @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
| 20 | @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
| 21 | @REM
|
| 22 | @echo off
|
| 23 | @if defined NT32_X64 @goto CheckLatest
|
| 24 | @if "%REBUILD_TOOLS%"=="TRUE" @goto RebuildTools
|
| 25 |
|
| 26 | :CheckLatest
|
| 27 | echo.
|
| 28 | @if defined VS120COMNTOOLS (
|
| 29 | @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64"
|
| 30 | @goto SetVs
|
| 31 | )
|
| 32 |
|
| 33 | @if defined VS110COMNTOOLS (
|
| 34 | @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64"
|
| 35 | @goto SetVs
|
| 36 | )
|
| 37 |
|
| 38 | @if defined VS100COMNTOOLS (
|
| 39 | @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64"
|
| 40 | @goto SetVs
|
| 41 | )
|
| 42 |
|
| 43 | @if defined VS90COMNTOOLS (
|
| 44 | @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\x86_amd64"
|
| 45 | @goto SetVs
|
| 46 | )
|
| 47 | @echo.
|
| 48 | @echo No version of Microsoft Visual Studio was found on this system
|
| 49 | @echo.
|
| 50 | @exit /B 1
|
| 51 |
|
| 52 | @REM Set up the X64 environment for building Nt32Pkg/Nt32Pkg.dsc to run on an X64 platform
|
| 53 | :SetVs
|
| 54 | if exist "%COMMONTOOLSx64%\vcvarsx86_amd64.bat" (
|
| 55 | @call "%COMMONTOOLSx64%\vcvarsx86_amd64.bat"
|
| 56 | @if errorlevel 1 (
|
| 57 | @echo. ERROR setting Microsoft Visual Studio %1
|
| 58 | @set COMMONTOOLSx64=
|
| 59 | @exit /B 1
|
| 60 | )
|
| 61 | )
|
| 62 | if not exist "%COMMONTOOLSx64%\vcvarsx86_amd64.bat" (
|
| 63 | @echo ERROR : This script does not exist: "%COMMONTOOLSx64%\vcvarsx86_amd64.bat"
|
| 64 | @set COMMONTOOLSx64=
|
| 65 | @exit /B 1
|
| 66 | )
|
| 67 | @set COMMONTOOLSx64=
|
| 68 | @goto End
|
| 69 |
|
| 70 | :RebuildTools
|
| 71 | @call python "%WORKSPACE%\BaseTools\Scripts\UpdateBuildVersions.py"
|
| 72 | @set "BIN_DIR=%EDK_TOOLS_PATH%\Bin\Win32"
|
| 73 | if not exist "%BIN_DIR%" @mkdir "%BIN_DIR%"
|
| 74 | @echo Removing temporary and binary files
|
| 75 | @cd "%BASE_TOOLS_PATH%"
|
| 76 | @call nmake cleanall
|
| 77 | @echo Rebuilding the EDK II BaseTools
|
| 78 | @cd "%BASE_TOOLS_PATH%\Source\C"
|
| 79 | @call nmake -nologo -a -f Makefile
|
| 80 | @if errorlevel 1 (
|
| 81 | @echo Error building the C-based BaseTools
|
| 82 | @cd "%WORKSPACE%"
|
| 83 | @exit /B1
|
| 84 | )
|
| 85 | @cd %BASE_TOOLS_PATH%\Source\Python
|
| 86 | @call nmake -nologo -a -f Makefile
|
| 87 | @if errorlevel 1 (
|
| 88 | @echo Error building the Python-based BaseTools
|
| 89 | @cd %WORKSPACE%
|
| 90 | @exit /B1
|
| 91 | )
|
| 92 | @cd %WORKSPACE%
|
| 93 |
|
| 94 | @goto End
|
| 95 |
|
| 96 | :VersionNotFound
|
| 97 | @echo.
|
| 98 | @echo This Microsoft Visual Studio version is in not installed on this system: %1
|
| 99 | @echo.
|
| 100 | @exit /B 1
|
| 101 |
|
| 102 | :End
|
| 103 | @exit /B 0
|