X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2Ftoolsetup.bat;h=2afa8103ec7c6f64bb791482ed45487f55f1cfbc;hb=2f667c5488c81924861901d4d7c6f4bb170ffb69;hp=5ddb9b04faa47204fb91a1b9c6fc3d9295b4a9b1;hpb=884f6e76521c7a59fab6b593bf93c293140875d3;p=mirror_edk2.git diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 5ddb9b04fa..2afa8103ec 100755 --- a/BaseTools/toolsetup.bat +++ b/BaseTools/toolsetup.bat @@ -3,10 +3,10 @@ @REM however it may be executed directly from the BaseTools project folder @REM if the file is not executed within a WORKSPACE\BaseTools folder. @REM -@REM Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved. +@REM Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
@REM @REM This program and the accompanying materials are licensed and made available -@REM under the terms and conditions of the BSD Licensewhich accompanies this +@REM under the terms and conditions of the BSD License which accompanies this @REM distribution. The full text of the license may be found at: @REM http://opensource.org/licenses/bsd-license.php @REM @@ -22,32 +22,32 @@ pushd . @REM # You should not have to modify anything below this line @REM # -@if /I "%1"=="-h" goto Usage -@if /I "%1"=="-help" goto Usage -@if /I "%1"=="--help" goto Usage -@if /I "%1"=="/h" goto Usage -@if /I "%1"=="/help" goto Usage -@if /I "%1"=="/?" goto Usage +if /I "%1"=="-h" goto Usage +if /I "%1"=="-help" goto Usage +if /I "%1"=="--help" goto Usage +if /I "%1"=="/h" goto Usage +if /I "%1"=="/help" goto Usage +if /I "%1"=="/?" goto Usage :loop - @if "%1"=="" goto setup_workspace - @if /I "%1"=="--nt32" ( + if "%1"=="" goto setup_workspace + if /I "%1"=="--nt32" ( @REM Ignore --nt32 flag shift goto loop ) - @if /I "%1"=="Reconfig" ( + if /I "%1"=="Reconfig" ( shift set RECONFIG=TRUE goto loop ) - @if /I "%1"=="Rebuild" ( + if /I "%1"=="Rebuild" ( shift set REBUILD=TRUE goto loop ) - @if /I "%1"=="ForceRebuild" ( + if /I "%1"=="ForceRebuild" ( shift set FORCE_REBUILD=TRUE goto loop @@ -158,14 +158,6 @@ if NOT exist %WORKSPACE%\Conf ( ) ) -if NOT exist %WORKSPACE%\Conf\FrameworkDatabase.db ( - if defined RECONFIG echo copying ... FrameworkDatabase.template to %WORKSPACE%\Conf\FrameworkDatabase.db - copy %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul -) else ( - if defined RECONFIG echo over-write ... FrameworkDatabase.template to %WORKSPACE%\Conf\FrameworkDatabase.db - if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul -) - if NOT exist %WORKSPACE%\Conf\target.txt ( echo copying ... target.template to %WORKSPACE%\Conf\target.txt if NOT exist %EDK_TOOLS_PATH%\Conf\target.template ( @@ -254,14 +246,15 @@ goto end ) set PATH=%BASE_TOOLS_PATH%\Bin\Win32;%PATH% - set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python + set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python + set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH% if not defined PYTHON_HOME ( if defined PYTHONHOME ( set PYTHON_HOME=%PYTHONHOME% ) else ( echo. - echo !!! ERROR !!! PYTHON is required to build or execute the tools !!! + echo !!! ERROR !!! PYTHON_HOME is required to build or execute the tools, please set it. !!! echo. goto end ) @@ -287,8 +280,9 @@ goto end echo !!! WARNING !!! Will not be able to compile Python programs to .exe echo Will setup environment to run Python scripts directly. echo. - set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python - set PATH=%PYTHONPATH%\build;%PYTHONPATH%\GenFds;%PYTHONPATH%\Trim;%PATH% + set PATH=%BASETOOLS_PYTHON_SOURCE%\Trim;%PATH% + set PATH=%BASETOOLS_PYTHON_SOURCE%\GenFds;%PATH% + set PATH=%BASETOOLS_PYTHON_SOURCE%\build;%PATH% set PATHEXT=%PATHEXT%;.py ) ) @@ -298,23 +292,16 @@ goto end echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH% echo. - if defined VCINSTALLDIR goto VisualStudioAvailable - if defined VS71COMNTOOLS ( - call "%VS71COMNTOOLS%\vsvars32.bat" - ) else ( - if defined VS80COMNTOOLS ( - call "%VS80COMNTOOLS%\vsvars32.bat" - ) else ( - echo. - echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!! - echo. - goto end - ) + call "%EDK_TOOLS_PATH%\get_vsvars.bat" + if not defined VCINSTALLDIR ( + @echo. + @echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!! + @echo. + goto end ) :VisualStudioAvailable - if defined FORCE_REBUILD goto CleanAndBuild - goto IncrementalBuild + if not defined FORCE_REBUILD goto IncrementalBuild :CleanAndBuild pushd . @@ -352,17 +339,17 @@ goto end goto end :Usage - echo. + @echo. echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]" - echo. - echo base_tools_path BaseTools project path, BASE_TOOLS_PATH will be set to this path. - echo edk_tools_path EDK_TOOLS_PATH will be set to this path. - echo Rebuild If sources are available perform an Incremental build, only - echo build those updated tools. - echo ForceRebuild If sources are available, rebuild all tools regardless of - echo whether they have been updated or not. - echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt. -echo. + @echo. + @echo base_tools_path BaseTools project path, BASE_TOOLS_PATH will be set to this path. + @echo edk_tools_path EDK_TOOLS_PATH will be set to this path. + @echo Rebuild If sources are available perform an Incremental build, only + @echo build those updated tools. + @echo ForceRebuild If sources are available, rebuild all tools regardless of + @echo whether they have been updated or not. + @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt. + @echo. :end set REBUILD= @@ -370,5 +357,3 @@ set FORCE_REBUILD= set RECONFIG= popd -@echo on -