@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
@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
\r
@if defined REBUILD_TOOLS goto SetConf\r
@if defined SVN_PULL goto SetConf\r
-@if not exist "%EDK_TOOLS_PATH%\Bin\Win32\build.exe" (\r
- @echo ERROR : %EDK_TOOLS_PATH%\Bin\Win32\build.exe does not exist\r
- @echo Re-run this script using --reset, --pull or --rebuild\r
- @echo.\r
- @goto ExitFailure\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
)\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
@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
@set SCRIPT=\r
@set LIST_VS_VERSIONS=\r
@set PYTHON_FREEZER_PATH=\r
+@set PYTHON_BUILD=\r
@echo on\r
@exit /B 1\r