]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Scripts/SetVisualStudio.bat
BaseTools: Replace BSD License with BSD+Patent License
[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
2e351cbe 14@REM SPDX-License-Identifier: BSD-2-Clause-Patent\r
bd63012c 15@REM\r
16@echo off\r
17@if defined NT32_X64 @goto CheckLatest\r
18@if "%REBUILD_TOOLS%"=="TRUE" @goto RebuildTools\r
19\r
20:CheckLatest\r
21echo.\r
4e06673d
LG
22@if defined VS140COMNTOOLS (\r
23 @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64"\r
24 @goto SetVs\r
25)\r
26\r
bd63012c 27@if defined VS120COMNTOOLS (\r
28 @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64"\r
29 @goto SetVs\r
30)\r
31\r
32@if defined VS110COMNTOOLS (\r
33 @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64"\r
34 @goto SetVs\r
35)\r
36\r
37@if defined VS100COMNTOOLS (\r
38 @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64"\r
39 @goto SetVs\r
40)\r
41\r
42@if defined VS90COMNTOOLS (\r
43 @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\x86_amd64"\r
44 @goto SetVs\r
45)\r
46@echo.\r
47@echo No version of Microsoft Visual Studio was found on this system\r
48@echo.\r
49@exit /B 1\r
50\r
51@REM Set up the X64 environment for building Nt32Pkg/Nt32Pkg.dsc to run on an X64 platform\r
52:SetVs\r
53if exist "%COMMONTOOLSx64%\vcvarsx86_amd64.bat" (\r
54 @call "%COMMONTOOLSx64%\vcvarsx86_amd64.bat"\r
55 @if errorlevel 1 (\r
56 @echo. ERROR setting Microsoft Visual Studio %1\r
57 @set COMMONTOOLSx64=\r
58 @exit /B 1\r
59 )\r
60)\r
61if not exist "%COMMONTOOLSx64%\vcvarsx86_amd64.bat" (\r
62 @echo ERROR : This script does not exist: "%COMMONTOOLSx64%\vcvarsx86_amd64.bat"\r
63 @set COMMONTOOLSx64=\r
64 @exit /B 1\r
65)\r
66@set COMMONTOOLSx64=\r
67@goto End\r
68\r
69:RebuildTools\r
485eb3a2 70@call python "%BASE_TOOLS_PATH%\Scripts\UpdateBuildVersions.py"\r
bd63012c 71@set "BIN_DIR=%EDK_TOOLS_PATH%\Bin\Win32"\r
72if not exist "%BIN_DIR%" @mkdir "%BIN_DIR%"\r
73@echo Removing temporary and binary files\r
74@cd "%BASE_TOOLS_PATH%"\r
75@call nmake cleanall\r
76@echo Rebuilding the EDK II BaseTools\r
77@cd "%BASE_TOOLS_PATH%\Source\C"\r
78@call nmake -nologo -a -f Makefile\r
79@if errorlevel 1 (\r
80@echo Error building the C-based BaseTools\r
81@cd "%WORKSPACE%"\r
82@exit /B1\r
83)\r
84@cd %BASE_TOOLS_PATH%\Source\Python\r
85@call nmake -nologo -a -f Makefile\r
86@if errorlevel 1 (\r
87@echo Error building the Python-based BaseTools\r
88@cd %WORKSPACE%\r
89@exit /B1\r
90)\r
91@cd %WORKSPACE%\r
92\r
93@goto End\r
94\r
95:VersionNotFound\r
96@echo.\r
97@echo This Microsoft Visual Studio version is in not installed on this system: %1\r
98@echo.\r
99@exit /B 1\r
100\r
101:End\r
102@exit /B 0\r