]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Edk2Setup.bat
Edk2: Retire Edk2Setup.bat
[mirror_edk2.git] / Edk2Setup.bat
diff --git a/Edk2Setup.bat b/Edk2Setup.bat
deleted file mode 100755 (executable)
index 017e88d..0000000
+++ /dev/null
@@ -1,541 +0,0 @@
-@REM @file\r
-@REM Windows batch file, Edk2Setup.bat, to set up an EDK II build environment\r
-@REM\r
-@REM This script will be renamed to edksetup.bat after initial testing and\r
-@REM acceptance by the open source community.\r
-@REM\r
-@REM This script will set the following system environment variables:\r
-@REM   WORKSPACE, EDK_TOOLS_PATH, PATH\r
-@REM If rebuilding the tools:\r
-@REM   BASE_TOOLS_PATH, PYTHON_FREEZER_PATH, PYTHONPATH\r
-@REM It will also create a Conf/target.txt, tools_def.txt and build_rule.txt files\r
-@REM if they do not exist\r
-@REM If the reset flag is set, all environment variables will be reset and \r
-@REM the Conf/target.txt, tools_def.txt and build_rule.txt files will be overwritten\r
-@REM\r
-@REM Three other scripts, located in the BaseTools\Scripts directory, may be called\r
-@REM by this script.\r
-@REM SetVisualStudio.bat    - will set the Visual Studio environment based on the --vs* flags\r
-@REM                          it is also used to build the Win32 binaries, calling nmake \r
-@REM                          using the WORKSPACE\BaseTools\Makefile\r
-@REM ShowEnvironment.bat    - will display the current EDK II Build environment\r
-@REM UpdateBuildVersions.py - script is called prior to building the EDK II BaseTools from\r
-@REM                          Sources. This tool will modify the BuildVersion.* files so that\r
-@REM                          when the tools get built, they will have a custom version entry\r
-@REM                          similar to the following:\r
-@REM     e:\edk2>build --version\r
-@REM     build.exe Version 0.51 Developer Build based on Revision: 15668\r
-@REM\r
-@REM Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
-@REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-@REM This program and the accompanying materials\r
-@REM are licensed and made available under the terms and conditions of the BSD License\r
-@REM which accompanies this distribution.  The full text of the license may be found at\r
-@REM http://opensource.org/licenses/bsd-license.php\r
-@REM\r
-@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-@REM\r
-@REM\r
-@REM usage:\r
-@REM   Edk2Setup.bat [--help | -h] [-v | --version] [-r | --reset] \r
-@REM                 [--reconfig] [--edk-tools-path DirName]\r
-@REM                 [--pull [Directory]| --rebuild [Directory]]\r
-@REM                 [--nt32 [X64]]\r
-\r
-@REM ##############################################################\r
-@REM # You should not have to modify anything below this line\r
-@REM #\r
-@echo off\r
-@set SCRIPT_NAME=%0\r
-@set SCRIPT_VERSION=0.9.2.\r
-@set SVN_REVISION=$Revision$\r
-@set RESET_ENVIRONMENT=FALSE\r
-@set NT32PKG=FALSE\r
-@set NT32_X64=\r
-@set BUILD_TOOLS_WITH=\r
-@set LOCATION=\r
-@set REBUILD_TOOLS=\r
-@set SVN_PULL=\r
-@set SRC_CONF=\r
-@set ARGUMENT=\r
-@set SCRIPT=EDKSETUP_BAT\r
-@set PYTHON_BUILD=\r
-\r
-@if not defined ORIGINAL_PATH set "ORIGINAL_PATH=%PATH%"\r
-@REM Always set the WORKSPACE environment variable to the current directory\r
-@if not defined WORKSPACE (\r
-  @set "WORKSPACE=%CD%"\r
-)\r
-@if not exist "%BASE_TOOLS_PATH%" (\r
-  @if exist "%WORKSPACE%\BaseTools" (\r
-    set "BASE_TOOLS_PATH=%WORKSPACE%\BaseTools"\r
-  ) else (\r
-    @if defined PACKAGES_PATH (\r
-      @for %%i IN (%PACKAGES_PATH%) DO (\r
-        @if exist %%~fi\BaseTools (\r
-          @set BASE_TOOLS_PATH=%%~fi\BaseTools\r
-          @goto checkBaseTools\r
-        )\r
-      )\r
-    )\r
-  )\r
-)\r
-:checkBaseTools\r
-@if not defined BASE_TOOLS_PATH (\r
-  @echo.\r
-  @echo !!! ERROR !!! The BaseTools Package was not found !!!\r
-  @echo.\r
-  @goto ExitFailure\r
-)\r
-@if not exist "%WORKSPACE%\Conf" @mkdir "%WORKSPACE%\Conf"\r
-\r
-@@if not defined EDK_TOOLS_PATH @set "EDK_TOOLS_PATH=%BASE_TOOLS_PATH%"\r
-\r
-@REM Keep the existing EDK_TOOLS_PATH value, the --reset flag will set it\r
-@REM back to WORKSPACE\BaseTools while the --location DIRECTORY flag will\r
-@REM still take precedence if the location option follows the reset option\r
-@REM on the command line.\r
-@if defined EDK_TOOLS_PATH @set "LOCATION=%EDK_TOOLS_PATH%"\r
-\r
-:parse_cmd_line\r
-@if "%1"=="" @goto MainRoutine\r
-@if /I "%1"=="-h" @goto Usage\r
-@if /I "%1"=="--help" @goto Usage\r
-@if /I "%1"=="/?" @goto Usage\r
-@if /I "%1"=="--version" @goto Version\r
-\r
-@REM These options will reset the system environment\r
-@if /I "%1"=="-r" (\r
-    @setlocal EnableDelayedExpansion\r
-    @set "WORKSPACE=%CD%"\r
-    @set "EDK_TOOLS_PATH=%CD%\BaseTools"\r
-    @set "LOCATION=!EDK_TOOLS_PATH!"\r
-    @endlocal\r
-    @shift\r
-    @goto parse_cmd_line\r
-)\r
-@if /I "%1"=="--reset" (\r
-    @set "WORKSPACE=%CD%"\r
-    @set "EDK_TOOLS_PATH=%WORKSPACE%\BaseTools"\r
-    @set "LOCATION=%WORKSPACE%\BaseTools"\r
-    @shift\r
-    @goto parse_cmd_line\r
-)\r
-\r
-@REM This option is used to overwrite the Conf/*.txt files with the\r
-@REM WORKSPACE\BaseTools\Conf\*.template files.\r
-@if /I "%1"=="--reconfig" (\r
-    @set RECONFIG=TRUE\r
-    @shift\r
-    @goto parse_cmd_line\r
-)\r
-\r
-@REM This option can be used to set the EDK_TOOLS_PATH containing the Win32 binaries to an\r
-@REM alternate directory\r
-@if /I "%1"=="--edk-tools-path" (\r
-    @setlocal EnableDelayedExpansion\r
-    @set ARGUMENT=%2\r
-    @if "!ARGUMENT:~0,2!"=="--" (\r
-        @echo.\r
-        @echo ERROR : The --edk-tools-path flag requires an argument\r
-        @echo.\r
-        @endlocal\r
-        @goto Usage\r
-    )\r
-    @endlocal\r
-    @set "LOCATION=%WORKSPACE%\%2"\r
-    @shift\r
-    @shift\r
-    @goto parse_cmd_line\r
-)\r
-\r
-@REM Force pulling updated (or checkout if they do not exist) from SVN for the BaseTools\Bin\Win32 directory\r
-@REM or the directory pointed to by the --location option\r
-@if /I "%1"=="--pull" (\r
-    @if "%REBUILD_TOOLS%"=="TRUE" (\r
-        @echo.\r
-        @echo ERROR: The --pull option may not be used with the --rebuild option\r
-        @shift\r
-        @goto ExitFailure\r
-    )\r
-    @set SVN_PULL=TRUE\r
-    @setlocal EnableDelayedExpansion\r
-    @set ARGUMENT=%2\r
-    @if not "!ARGUMENT:~0,2!"=="--" (\r
-        @endlocal\r
-        @set "LOCATION=%2"\r
-        @shift\r
-    )\r
-    @shift\r
-    @goto parse_cmd_line\r
-)\r
-\r
-@REM This options forces rebuilding the tools (provided the required tools are available\r
-@if /I "%1"=="--rebuild" (\r
-    @if "%SVN_PULL%"=="TRUE" (\r
-        @echo.\r
-        @echo ERROR: The --reset option may not be used with the --pull option\r
-        @shift\r
-        @goto ExitFailure\r
-    )\r
-    @set REBUILD_TOOLS=TRUE\r
-    @setlocal EnableDelayedExpansion\r
-    @set ARGUMENT=%2\r
-    @if not "!ARGUMENT:~0,2!"=="--" (\r
-        @endlocal\r
-        @set "LOCATION=%2"\r
-        @shift\r
-    )\r
-    @shift\r
-    goto parse_cmd_line\r
-)\r
-\r
-@REM This option will try to set the compiler environment for building Nt32Pkg/Nt32Pkg.dsc\r
-@REM If the compiler environment is already installed, then no additional work is required.\r
-@if /I "%1"=="--nt32" (\r
-    @set NT32PKG=TRUE\r
-    @if not defined BUILD_TOOLS_WITH (\r
-        @set BUILD_TOOLS_WITH=Latest\r
-    )\r
-    @REM This option will try to set the environment for building the Nt32Pkg/Nt32Pkg; on a 64-bit \r
-    @REM Windows OS\r
-    @if /I "%2"=="X64" (\r
-        @set NT32_X64=TRUE\r
-        @shift\r
-    )\r
-  @shift\r
-  @goto parse_cmd_line\r
-)\r
-\r
-@if not "%1"=="" goto UnknownOptionOrArgument\r
-@goto MainRoutine\r
-\r
-:Usage\r
-@echo Usage: %SCRIPT_NAME% [Options]\r
-@echo Copyright(c) 2014, Intel Corporation. All rights reserved.\r
-@echo.\r
-@echo The system environment variable, WORKSPACE, is always set to the current \r
-@echo working directory.\r
-@echo.\r
-@echo Options:\r
-@echo   --help, -h          Print this help screen and exit.\r
-@echo.\r
-@echo   --version           Print this script's version and exit.\r
-@echo.\r
-@echo   --reset, -r         Reset the EDK_TOOLS_PATH and PATH system environment\r
-@echo                       variables. The EDK_TOOLS_PATH default is \r
-@echo                       WORKSPACE\BaseTools, however, it may be overridden by\r
-@echo                       arguments given to the --edk-tools-path, --pull and/or\r
-@echo                       --rebuild options.\r
-@echo                       Once set, the EDK_TOOLS_PATH environment variable reset\r
-@echo                       by opening up a new command prompt window or through one\r
-@echo                       of the options provided by this tool\r
-@echo.\r
-@echo   --reconfig          Overwrite the WORKSPACE/Conf/*.txt files with the\r
-@echo                       template files from the BaseTools/Conf directory.\r
-@echo.\r
-@echo   --edk-tools-path  DIRECTORY\r
-@echo                       This option sets the EDK_TOOLS_PATH to the DIRECTORY\r
-@echo                       value instead of the default (WORKSPACE\BaseTools).\r
-@echo.\r
-@echo   --nt32 [X64]        If a compiler tool chain is not available in the\r
-@echo                       environment, call a script to attempt to set one up.\r
-@echo                       This flag is only required if building the\r
-@echo                       Nt32Pkg/Nt32Pkg.dsc system emulator.\r
-@echo                       If the X64 argument is set, and a compiler tool chain is\r
-@echo                       not available, attempt to set up a tool chain that will\r
-@echo                       create X64 binaries. Setting these two options have the\r
-@echo                       potential side effect of changing tool chains used for a\r
-@echo                       rebuild.\r
-@echo.\r
-@pause\r
-@echo.\r
-@echo   --pull [DIRECTORY]  Get the EDK II BaseTools binaries from source control \r
-@echo                       (must not be used with --rebuild).\r
-@echo                       If the optional DIRECTORY argument is specified, the tool\r
-@echo                       sets EDK_TOOLS_PATH to DIRECTORY.\r
-@echo                       If the DIRECTORY argument is not specified, the tools are\r
-@echo                       placed in the directory tree pointed to by the current \r
-@echo                       EDK_TOOLS_PATH environment variable. If the binaries\r
-@echo                       cannot be obtained from source control, the \r
-@echo                       EDK_TOOLS_PATH will be set to the default, \r
-@echo                       WORKSPACE\BaseTools directory.\r
-@echo.\r
-@echo   --rebuild  [DIRECTORY]\r
-@echo                       Force Rebuilding the EDK II BaseTools from source\r
-@echo                      (must not be used with --pull).\r
-@echo                           NOTE: The build will use whatever compiler tool set\r
-@echo                                 is available in the environment prior to\r
-@echo                                 running edksetup.bat.\r
-@echo                       If the optional DIRECTORY argument is specified, the tool\r
-@echo                       sets EDK_TOOLS_PATH to DIRECTORY. Tools binaries will be\r
-@echo                       placed in the appropriate subdirectory in the \r
-@echo                       EDK_TOOLS_PATH directory. If the build fails, the\r
-@echo                       EDK_TOOLS_PATH will be set to the default,\r
-@echo                       WORKSPACE\BaseTools directory.\r
-@goto ExitSuccess\r
-\r
-:Version\r
-@echo %SCRIPT_NAME% Version: %SCRIPT_VERSION%%SVN_REVISION:~11,-1%\r
-@echo Copyright(c) 2014, Intel Corporation. All rights reserved.\r
-@set HIDE_PATH=TRUE\r
-@call "%BASE_TOOLS_PATH%\Scripts\ShowEnvironment.bat"\r
-@set HIDE_PATH=\r
-@goto ExitSuccess\r
-\r
-:UnknownOptionOrArgument\r
-@echo. ERROR : This argument is not valid: %1\r
-@echo.\r
-@goto ExitFailure\r
-\r
-:NoVisualStudio\r
-@echo ERROR : Unable to determine if a compiler tool chain has been enabled in this\r
-@echo         command-prompt window. Rebuilding of the tools with this script is not\r
-@echo         possible.\r
-@echo         Refer to the BaseTools\BuildNotes.txt for directions for building \r
-@echo         the BaseTools binaries.\r
-@echo.\r
-@goto ExitFailure\r
-\r
-:NoPython\r
-@echo ERROR : Unable to rebuild the BaseTools binaries, python does not appear to be\r
-@echo         installed. If python is installed, please set the environment\r
-@echo         variable, PYTHONHOME to the Path to the python.exe, for example,\r
-@echo         if python.exe is located in the C:\Python27 directory, then:\r
-@echo         set PYTHONHOME=C:\Python27\r
-@echo.\r
-@goto ExitFailure\r
-\r
-:BadPython\r
-@echo ERROR : Unable to rebuild the BaseTools binaries, python does not appear to be\r
-@echo         installed. \r
-@echo         The python executable was not found in the PYTHONHOME: %PYTHONHOME%\r
-@echo         If python is installed, please set the environment variable, PYTHONHOME \r
-@echo         to the Path that contains python.exe, for example, if python.exe is\r
-@echo         located in the C:\Python27 directory, then:\r
-@echo         set PYTHONHOME=C:\Python27\r
-@echo.\r
-@goto ExitFailure\r
-\r
-:NoCxFreeze\r
-@echo ERROR : Unable to locate cx_Freeze 4.2.3. The cxfreeze.bat file must be located\r
-@echo         in the %PYTHONHOME%\Scripts directoryin order to rebuild the BaseTools\r
-@echo         binaries.\r
-@echo.\r
-@goto ExitFailure\r
-\r
-:NoBaseTools\r
-@echo ERROR: Unable to locate the BaseTools directory containing the Source tree\r
-@echo.\r
-@goto ExitFailure\r
-\r
-@REM #########################################################################################\r
-@REM MAIN ROUTINE\r
-@REM Set up the Build System environment\r
-@REM #########################################################################################\r
-:MainRoutine\r
-@if defined LOCATION @set "EDK_TOOLS_PATH=%LOCATION%"\r
-@REM SET the EDK_TOOLS_PATH.\r
-@if not exist "%EDK_TOOLS_PATH%" (\r
-    @mkdir %EDK_TOOLS_PATH%\r
-)\r
-@if not defined NASM_PREFIX (\r
-    @echo.\r
-    @echo WARNING : NASM_PREFIX environment variable is not set\r
-    @if exist "C:\nasm\nasm.exe" @set "NASM_PREFIX=C:\nasm\"\r
-    @if exist "C:\nasm\nasm.exe" @echo   Found nasm.exe, setting the environment variable to C:\nasm\\r
-    @if not exist "C:\nasm\nasm.exe" echo   Attempting to build modules that require NASM will fail.\r
-)\r
-@REM Set up the path to include the EDK_TOOLS_PATH\Bin\Win32 directory; this test determines\r
-@REM whether the path is in the workspace or a fully qualified path that may be outside of\r
-@REM the workspace\r
-@if exist "%WORKSPACE%\%EDK_TOOLS_PATH%" @set "EDK_TOOLS_PATH=%WORKSPACE%\%EDK_TOOLS_PATH%"\r
-\r
-@if defined REBUILD_TOOLS goto SetConf\r
-@if defined SVN_PULL goto SetConf\r
-\r
-@REM call set_vsprefix_envs.bat to set up the PREFIX env for VS tool path.\r
-@IF NOT exist "%EDK_TOOLS_PATH%\set_vsprefix_envs.bat" (\r
-  @echo.\r
-  @echo !!! ERROR !!! The set_vsprefix_envs.bat was not found !!!\r
-  @echo.\r
-  @goto ExitFailure\r
-)\r
-@call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat\r
-\r
-@echo.\r
-@echo Rebuilding of the tools is not required. Binaries of the latest,\r
-@echo tested versions of the tools have been tested and included in the\r
-@echo EDK II repository.\r
-@echo.\r
-@echo If you really want to build the tools, use the --rebuild option.\r
-@echo.\r
-@if not defined CYGWIN_HOME @echo "!!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!"\r
-@if not defined CYGWIN_HOME @echo.\r
-@REM Make sure the WORKSPACE\Conf directory contains the required text files that will be\r
-@REM copied or replaced from the WORKSPACE\BaseTools\Conf directories' template files.\r
-:SetConf\r
-@if not exist "%EDK_TOOLS_PATH%\Conf" (\r
-    @if exist "%BASE_TOOLS_PATH%\Conf" (\r
-        @set "SRC_CONF=%BASE_TOOLS_PATH%\Conf"\r
-    )\r
-) else (\r
-    @set "SRC_CONF=%EDK_TOOLS_PATH%\Conf"\r
-)\r
-@if not defined SRC_CONF (\r
-    @echo ERROR : Unable to locate the BaseTools directory tree\r
-    @goto ExitFailure\r
-)\r
-\r
-@REM The script will test to see if the files exist, and also use the RESET_ENVIRONMENT flag\r
-@REM to overwrite the WORKSPACE\Conf *.txt files.\r
-@call "%BASE_TOOLS_PATH%\Scripts\ShowEnvironment.bat"\r
-@if errorlevel 1 (\r
-    @echo Unable to copy the template files from "%SRC_CONF%" to "%WORKSPACE%\Conf"\r
-    @goto ExitFailure\r
-)\r
-@set SRC_CONF=\r
-\r
-@REM Set up Visual Studio if required to build the Nt32Pkg/Nt32Pkg.dsc emulator\r
-@if "%NT32PKG%"=="TRUE" (\r
-    @if not defined VSINSTALLDIR @set "PATH=%ORIGINAL_PATH%"\r
-    @if not defined NT32_X64 @call "%BASE_TOOLS_PATH%\get_vsvars.bat"\r
-    @if defined NT32_X64 call "%BASE_TOOLS_PATH%\Scripts\SetVisualStudio.bat"\r
-)\r
-@if "%NT32PKG%"=="TRUE" (\r
-    @if not defined VS_PATH set "VS_PATH=%PATH%"\r
-)\r
-@if defined VS_PATH @set "PATH=%VS_PATH%"\r
-@if not defined VS_PATH @set "PATH=%ORIGINAL_PATH%"\r
-@if not defined EDK_TOOLS_BIN (\r
-  @if exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
-    @set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
-  ) else (\r
-    @echo.\r
-    @echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!\r
-    @echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32\r
-    @echo Or configure EDK_TOOLS_BIN env to point Win32 directory.\r
-    @echo. \r
-    @goto ExitFailure\r
-  )\r
-)\r
-@set "PATH=%EDK_TOOLS_BIN%;%PATH%"\r
-\r
-@if NOT EXIST "%EDK_TOOLS_BIN%\build.exe" @set PYTHON_BUILD=TRUE\r
-@if NOT EXIST "%EDK_TOOLS_BIN%\GenFds.exe" @set PYTHON_BUILD=TRUE\r
-@if NOT EXIST "%EDK_TOOLS_BIN%\TargetTool.exe" @set PYTHON_BUILD=TRUE\r
-@if NOT EXIST "%EDK_TOOLS_BIN%\Trim.exe" @set PYTHON_BUILD=TRUE\r
-\r
-@if not defined PYTHON_BUILD goto SvnPull\r
-\r
-@echo  !!! WARNING !!! Setup environment to run Python scripts directly.\r
-\r
-@if not defined PYTHON_HOME (\r
-  @if defined PYTHONHOME (\r
-    @set PYTHON_HOME=%PYTHONHOME%\r
-  ) else (\r
-    @echo.\r
-    @echo  !!! ERROR !!! PYTHON_HOME is required to build or execute the tools, please set it. !!!\r
-    @echo.\r
-    @goto ExitFailure\r
-  )\r
-)\r
-\r
-@set PATH=%PATH%;%BASE_TOOLS_PATH%\BinWrappers\WindowsLike\r
-@set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python\r
-@set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%\r
-\r
-:SvnPull\r
-@if "%REBUILD_TOOLS%"=="TRUE" @goto Rebuild\r
-@if "%SVN_PULL%"== "TRUE" (\r
-    if defined PYTHONHOME (\r
-        @REM Use the python script if possible to test is the svn command is available, if it fails, the user may be\r
-        @REM able to rebuild the Win32 binaries\r
-        @call "%BASE_TOOLS_PATH%\Scripts\UpdateBuildVersions.py" --svn-test -v\r
-        @if errorlevel 1 (\r
-            @echo ERROR : The command-line svn tool is not available and the Win32 binaries do not exist\r
-            @echo         Please re-run this script again with the --rebuild option to attempt to build \r
-            @echo         the binaries\r
-            @echo.\r
-            @goto ExitFailure\r
-        )\r
-        @if exist %EDK_TOOLS_PATH%\Bin\Win32 @rmdir /S /Q %EDK_TOOLS_PATH%\Bin\Win32\r
-        @call svn co https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32 "%EDK_TOOLS_PATH%\Bin\Win32"\r
-    ) else (\r
-        @call svn co https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32 "%EDK_TOOLS_PATH%\Bin\Win32"\r
-        @if errorlevel 1 (\r
-            @echo ERROR : The command-line svn tool is not available and the Win32 binaries do not exist\r
-            @echo         Python does not appear to be available either. This script cannot be used to\r
-            @echo         build the Win32 binaries or to obtain them from this repository:\r
-            @echo            https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32\r
-            @goto ExitFailure\r
-        )\r
-    )\r
-    @goto ShowAndExit\r
-)\r
-\r
-@if not "%REBUILD_TOOLS%"=="TRUE" @goto ShowAndExit\r
-\r
-@REM The following code is used to rebuild the Win32 BaseTools binaries - check that required tools are available\r
-:Rebuild\r
-@if not exist "%BASE_TOOLS_PATH%\Source" @goto NoBaseTools\r
-@endlocal\r
-@if not defined VCINSTALLDIR @goto NoVisualStudio\r
-@if not defined PYTHONHOME @goto NoPython\r
-@if not exist "%PYTHONHOME%\python.exe" @goto BadPython\r
-@REM python.exe has been located, now make sure it's in the PATH\r
-@call python --version > nul 2>&1\r
-@if errorlevel 1 @set "PATH=%PYTHONHOME%\python.exe;%PATH%"\r
-@if not defined PYTHON_FREEZER_PATH (\r
-    @if not exist "%PYTHONHOME%\Scripts\cxfreeze.bat" @goto NoCxFreeze\r
-    @set "PYTHON_FREEZER_PATH=%PYTHONHOME%\Scripts"\r
-)\r
-@call "%BASE_TOOLS_PATH%\Scripts\SetVisualStudio.bat"\r
-@if errorlevel 1 @goto ExitFailure\r
-\r
-:ShowAndExit\r
-@call "%BASE_TOOLS_PATH%\Scripts\ShowEnvironment.bat"\r
-\r
-@REM #########################################################################################\r
-@REM EXIT ROUTINES\r
-@REM #########################################################################################\r
-:ExitSuccess\r
-@set SCRIPT_NAME=\r
-@set SCRIPT_VERSION=\r
-@set SVN_REVISION=\r
-@set RESET_ENVIRONMENT=\r
-@set RECONFIG=\r
-@set NT32PKG=\r
-@set BUILD_TOOLS_WITH=\r
-@set LOCATION=\r
-@set REBUILD_TOOLS=\r
-@set SVN_PULL=\r
-@set SRC_CONF=\r
-@set ARGUMENT=\r
-@set SCRIPT=\r
-@set LIST_VS_VERSIONS=\r
-@set PYTHON_FREEZER_PATH=\r
-@set PYTHON_BUILD=\r
-@echo on\r
-@exit /B 0\r
-\r
-:ExitFailure\r
-@set SCRIPT_NAME=\r
-@set SCRIPT_VERSION=\r
-@set SVN_REVISION=\r
-@set RESET_ENVIRONMENT=\r
-@set RECONFIG=\r
-@set NT32PKG=\r
-@set BUILD_TOOLS_WITH=\r
-@set LOCATION=\r
-@set REBUILD_TOOLS=\r
-@set SVN_PULL=\r
-@set SRC_CONF=\r
-@set ARGUMENT=\r
-@set SCRIPT=\r
-@set LIST_VS_VERSIONS=\r
-@set PYTHON_FREEZER_PATH=\r
-@set PYTHON_BUILD=\r
-@echo on\r
-@exit /B 1\r