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