+@REM @file\r
+@REM This stand-alone program is typically called by the edksetup.bat file, \r
+@REM however it may be executed directly from the BaseTools project folder\r
+@REM if the file is not executed within a WORKSPACE\BaseTools folder.\r
@REM\r
-@REM Copyright (c) 2006, Intel Corporation\r
-@REM All rights reserved. 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 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.\r
+@REM\r
+@REM This program and the accompanying materials are licensed and made available\r
+@REM under the terms and conditions of the BSD Licensewhich accompanies this \r
+@REM 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 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR \r
+@REM IMPLIED.\r
@REM\r
\r
@echo off\r
+pushd .\r
\r
-REM ##############################################################\r
-REM # You should not have to modify anything below this line\r
-REM #\r
+@REM ##############################################################\r
+@REM # You should not have to modify anything below this line\r
+@REM #\r
\r
-if /I "%1"=="-h" goto usage\r
-if /I "%1"=="-help" goto usage\r
-if /I "%1"=="--help" goto usage\r
-if /I "%1"=="/h" goto usage\r
-if /I "%1"=="/?" goto usage\r
-if /I "%1"=="/help" goto usage\r
+@if /I "%1"=="-h" goto Usage\r
+@if /I "%1"=="-help" goto Usage\r
+@if /I "%1"=="--help" goto Usage\r
+@if /I "%1"=="/h" goto Usage\r
+@if /I "%1"=="/help" goto Usage\r
+@if /I "%1"=="/?" goto Usage\r
\r
-if /I "%1"=="Reconfig" (\r
- if NOT "%2"=="" set EDK_TOOLS_PATH=%2\r
-) else (\r
- if NOT "%1"=="" set EDK_TOOLS_PATH=%1\r
-)\r
\r
-REM\r
-REM Check the required system environment variables\r
-REM\r
+:loop\r
+ @if "%1"=="" goto setup_workspace\r
+ @if /I "%1"=="--nt32" (\r
+ @REM Ignore --nt32 flag\r
+ shift\r
+ goto loop\r
+ )\r
+ @if /I "%1"=="Reconfig" (\r
+ shift\r
+ set RECONFIG=TRUE\r
+ goto loop\r
+ )\r
+ @if /I "%1"=="Rebuild" (\r
+ shift\r
+ set REBUILD=TRUE\r
+ goto loop\r
+ )\r
+ @if /I "%1"=="ForceRebuild" (\r
+ shift\r
+ set FORCE_REBUILD=TRUE\r
+ goto loop\r
+ )\r
+ if "%1"=="" goto setup_workspace\r
+ if exist %1 (\r
+ if not defined BASE_TOOLS_PATH (\r
+ if exist %1\Source set BASE_TOOLS_PATH=%1\r
+ shift\r
+ goto loop\r
+ )\r
+ if not defined EDK_TOOLS_PATH (\r
+ if exist %1\Bin\Win32 set EDK_TOOLS_PATH=%1\r
+ shift\r
+ goto loop\r
+ )\r
+ echo.\r
+ echo !!! ERROR !!! Unknown argument, %1 !!!\r
+ echo.\r
+ goto end\r
+ ) else (\r
+ echo.\r
+ echo !!! ERROR !!! Unknown argument, %1 !!!\r
+ echo.\r
+ goto end\r
+ )\r
+ goto loop\r
+\r
+\r
+@REM\r
+@REM Check the required system environment variables\r
+@REM\r
\r
:setup_workspace\r
-REM\r
-REM check the EDK_TOOLS_PATH\r
-REM\r
-if not defined EDK_TOOLS_PATH goto no_tools_path\r
-if exist %EDK_TOOLS_PATH% goto set_path\r
-echo.\r
-echo !!!WARNING!!! %EDK_TOOLS_PATH% doesn't exist. %WORKSPACE%\BaseTools will be used !!!\r
-echo.\r
+ REM\r
+ REM check the EDK_TOOLS_PATH\r
+ REM\r
+ if not defined EDK_TOOLS_PATH goto no_EDK_TOOLS_PATH\r
+ if exist %EDK_TOOLS_PATH% goto set_PATH\r
\r
-:no_tools_path\r
-if exist %WORKSPACE%\BaseTools (\r
- set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
-) else (\r
- echo.\r
- echo !!!WARNING!!! No tools path found. Please set EDK_TOOLS_PATH !!!\r
- echo.\r
- goto end\r
-)\r
+:no_EDK_TOOLS_PATH\r
+ if not defined WORKSPACE (\r
+ if defined BASE_TOOLS_PATH (\r
+ set EDK_TOOLS_PATH=%BASE_TOOLS_PATH%\r
+ goto set_PATH\r
+ ) else (\r
+ echo.\r
+ echo !!! ERROR !!! Neither BASE_TOOLS_PATH nor EDK_TOOLS_PATH are set. !!!\r
+ echo.\r
+ goto end\r
+ )\r
+ ) else (\r
+ if exist %WORKSPACE%\BaseTools\Bin (\r
+ set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
+ goto set_PATH\r
+ ) else (\r
+ echo.\r
+ echo !!! ERROR !!! No tools path available. Please set EDK_TOOLS_PATH !!!\r
+ echo.\r
+ goto end\r
+ )\r
+ )\r
\r
-:set_path\r
-if defined WORKSPACE_TOOLS_PATH goto check_path\r
-set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%\r
-set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
-goto path_ok\r
+:set_PATH\r
+ if defined WORKSPACE_TOOLS_PATH goto check_PATH\r
+ set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%\r
+ set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
+ goto PATH_ok\r
\r
-:check_path\r
-if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok\r
-set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%\r
-set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
-echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this WORKSPACE\r
+:check_PATH\r
+ if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok\r
+ set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%\r
+ set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
+ echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this session.\r
\r
-:path_ok\r
-echo PATH = %PATH%\r
-echo.\r
-echo WORKSPACE = %WORKSPACE%\r
-echo EDK_TOOLS_PATH = %EDK_TOOLS_PATH%\r
-echo.\r
+:PATH_ok\r
+ echo PATH = %PATH%\r
+ echo.\r
+ if defined WORKSPACE (\r
+ echo WORKSPACE = %WORKSPACE%\r
+ )\r
+ echo EDK_TOOLS_PATH = %EDK_TOOLS_PATH%\r
+ if defined BASE_TOOLS_PATH (\r
+ echo BASE_TOOLS_PATH = %EDK_TOOLS_PATH%\r
+ )\r
+ echo.\r
\r
REM\r
REM copy *.template to %WORKSPACE%\Conf\r
REM\r
+if not defined WORKSPACE (\r
+ if defined RECONFIG (\r
+ echo.\r
+ echo !!! WARNING !!! WORKSPACE environment variable was not set, cannot Reconfig !!!\r
+ echo.\r
+ )\r
+ goto skip_reconfig\r
+)\r
+\r
if NOT exist %WORKSPACE%\Conf (\r
mkdir %WORKSPACE%\Conf\r
) else (\r
- if /I "%1"=="Reconfig" (\r
+ if defined RECONFIG (\r
echo.\r
echo Over-writing the files in the WORKSPACE\Conf directory\r
echo using the default template files\r
echo.\r
)\r
)\r
+\r
if NOT exist %WORKSPACE%\Conf\FrameworkDatabase.db (\r
echo copying ... FrameworkDatabase.template to %WORKSPACE%\Conf\FrameworkDatabase.db\r
copy %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul\r
) else (\r
- if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul\r
+ if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul\r
)\r
+\r
if NOT exist %WORKSPACE%\Conf\target.txt (\r
echo copying ... target.template to %WORKSPACE%\Conf\target.txt\r
copy %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
) else (\r
- if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
+ if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
)\r
+\r
if NOT exist %WORKSPACE%\Conf\tools_def.txt (\r
echo copying ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt\r
copy %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
) else (\r
- if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
+ if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
)\r
+\r
if NOT exist %WORKSPACE%\Conf\build_rule.txt (\r
echo copying ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt\r
copy %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
) else (\r
- if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
+ if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
)\r
\r
-REM\r
-REM copy XMLSchema to %EDK_TOOLS_PATH%\Conf\XMLSchema\r
-REM\r
-REM echo copying ... XMLSchema to %EDK_TOOLS_PATH%\Conf\XMLSchema\r
-REM xcopy %WORKSPACE%\Conf\XMLSchema %EDK_TOOLS_PATH%\Conf\XMLSchema /S /I /D /F /Q > nul\r
+:skip_reconfig\r
+\r
+@REM\r
+@REM Test if we are going to have to do a build\r
+@REM\r
+if defined FORCE_REBUILD goto check_build_environment\r
+if defined REBUILD goto check_build_environment\r
+if not exist "%EDK_TOOLS_PATH%\Bin" goto check_build_environment\r
+\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\BootSectImage.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\build.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\EfiLdrImage.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\EfiRom.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenBootSector.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFds.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFfs.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFv.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFw.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenPage.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenSec.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenVtf.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\MigrationMsa2Inf.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Split.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\TargetTool.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\TianoCompress.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Trim.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\VfrCompile.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Fpd2Dsc.exe" goto check_build_environment\r
+IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\VolInfo.exe" goto check_build_environment\r
\r
-REM\r
-REM Done!!!\r
-REM\r
goto end\r
\r
-:usage\r
-echo.\r
-echo "Usage: %0 [/? | /h | /help | -h | -help | --help] [Reconfig] [tools_path]"\r
-echo.\r
-echo tools_path Tools' path. EDK_TOOLS_PATH will be set to this path.\r
+:check_build_environment\r
+\r
+ if not defined FORCE_REBUILD (\r
+ echo.\r
+ echo Rebuilding of 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 FORCE_REBUILD option.\r
+ echo.\r
+ goto end\r
+ )\r
+\r
+ if not defined BASE_TOOLS_PATH (\r
+ if not exist "Source\C\Makefile" (\r
+ if not exist "%EDK_TOOLS_PATH%\Source\C\Makefile" goto no_source_files\r
+ set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
+ ) else (\r
+ set BASE_TOOLS_PATH=%CD%\r
+ )\r
+ )\r
+ set PATH=%BASE_TOOLS_PATH%\Bin\Win32;%PATH%\r
+\r
+ set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python\r
+\r
+ if not defined PYTHON_HOME (\r
+ if defined PYTHONHOME (\r
+ set PYTHON_HOME=%PYTHONHOME%\r
+ ) else (\r
+ echo.\r
+ echo !!! ERROR !!! PYTHON is required to build or execute the tools !!!\r
+ echo.\r
+ goto end\r
+ )\r
+ )\r
+\r
+ @REM We have Python, now test for FreezePython application\r
+ if not defined PYTHON_FREEZER_PATH (\r
+ @REM see if we can find FreezePython.ex\r
+ if exist "%PYTHON_HOME%\Tools\cx_Freeze-3.0.3\FreezePython.exe" (\r
+ set PYTHON_FREEZER_PATH=%PYTHON_HOME%\Tools\cx_Freeze-3.0.3\r
+ ) \r
+ if exist "%PYTHON_HOME%\Tools\cx_Freeze\FreezePython.exe" (\r
+ set PYTHON_FREEZER_PATH=%PYTHON_HOME%\Tools\cx_Freeze\r
+ ) \r
+ if exist "C:\cx_Freeze\FreezePython.exe" (\r
+ set PYTHON_FREEZER_PATH=C:\cx_Freeze\r
+ )\r
+ if exist "C:\cx_Freeze-3.0.3" (\r
+ set PYTHON_FREEZER_PATH=C:\cx_Freeze-3.0.3\r
+ )\r
+ if not defined PYTHON_FREEZER_PATH (\r
+ echo.\r
+ echo !!! WARNING !!! Will not be able to compile Python programs to .exe\r
+ echo Will setup environment to run Python scripts directly.\r
+ echo.\r
+ set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python\r
+ set PATH=%PYTHONPATH%\build;%PYTHONPATH%\GenFds;%PYTHONPATH%\Trim;%PATH%\r
+ set PATHEXT=%PATHEXT%;.py\r
+ )\r
+ )\r
+ \r
+ echo BASE_TOOLS_PATH = %BASE_TOOLS_PATH%\r
+ echo PYTHON_PATH = %PYTHON_PATH%\r
+ echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%\r
+ echo.\r
+\r
+ if defined VCINSTALLDIR goto VisualStudioAvailable\r
+ if defined VS71COMNTOOLS (\r
+ call "%VS71COMNTOOLS%\vsvars32.bat"\r
+ ) else (\r
+ if defined VS80COMNTOOLS (\r
+ call "%VS80COMNTOOLS%\vsvars32.bat"\r
+ ) else (\r
+ echo.\r
+ echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!!\r
+ echo.\r
+ goto end\r
+ )\r
+ )\r
+\r
+:VisualStudioAvailable\r
+ if defined FORCE_REBUILD goto CleanAndBuild\r
+ goto IncrementalBuild\r
+\r
+:CleanAndBuild\r
+ pushd .\r
+ cd %BASE_TOOLS_PATH%\r
+ call nmake cleanall\r
+ del /f /q %BASE_TOOLS_PATH%\Bin\Win32\*.*\r
+ popd\r
+ @REM Let CleanAndBuild fall through to IncrementalBuild\r
+\r
+\r
+:IncrementalBuild\r
+ pushd .\r
+ cd %BASE_TOOLS_PATH%\r
+ call nmake c\r
+ popd\r
+\r
+ if defined PYTHON_FREEZER_PATH (\r
+ echo BUILDING PYTHON TOOLS\r
+ pushd .\r
+ cd %BASE_TOOLS_PATH%\r
+ call nmake python\r
+ popd\r
+ ) else (\r
+ echo.\r
+ echo !!! WARNING !!! Cannot make executable from Python code, executing python scripts instead !!!\r
+ echo.\r
+ )\r
+ goto end\r
+\r
+\r
+:no_source_files\r
+ echo.\r
+ echo !!! ERROR !!! Cannot build BaseTools applications - no source directory located !!!\r
+ echo.\r
+ goto end\r
+\r
+:Usage\r
+ echo.\r
+ echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]"\r
+ echo.\r
+ echo base_tools_path BaseTools project path, BASE_TOOLS_PATH will be set to this path. \r
+ echo edk_tools_path EDK_TOOLS_PATH will be set to this path.\r
+ echo Rebuild If sources are available perform an Incremental build, only \r
+ echo build those updated tools.\r
+ echo ForceRebuild If sources are available, rebuild all tools regardless of \r
+ echo whether they have been updated or not.\r
+ echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.\r
echo.\r
\r
:end\r
+set REBUILD=\r
+set FORCE_REBUILD=\r
+set RECONFIG=\r
+popd\r
+\r
@echo on\r
\r
+@REM @file\r
+@REM Windows batch file to setup a WORKSPACE environment\r
@REM\r
-@REM Copyright (c) 2006, Intel Corporation\r
+@REM Copyright (c) 2006 - 2008, Intel Corporation\r
@REM All rights reserved. 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 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
@REM\r
\r
-@REM set following environment in this file or in command shell\r
+@REM set following environment in this file or in command shell for the older,\r
+@REM JAVA/Ant build\r
@REM set JAVA_HOME=C:\Java\jdk1.5.0_06\r
@REM set ANT_HOME=C:\ANT\r
@REM set XMLBEANS_HOME=C:\xmlbeans\r
@REM set CYGWIN_HOME=C:\cygwin\r
\r
-@REM usage: edksetup.bat [Rebuild] [ForceRebuild] [Reconfig]\r
+@REM usage: \r
+@REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]\r
@REM if the argument, skip is present, only the paths and the\r
@REM test and set of environment settings are performed. \r
\r
@if /I "%1"=="/h" goto Usage\r
@if /I "%1"=="/?" goto Usage\r
@if /I "%1"=="/help" goto Usage\r
-@if /I not "%1"=="--nt32" goto check_new_build\r
+\r
+@if /I not "%1"=="--nt32" goto check_Ant_build\r
+\r
+@REM Flag, --nt32 is set\r
+@REM The Nt32 Emluation Platform requires Microsoft Libraries\r
+@REM and headers to interface with Windows.\r
+\r
if not defined VCINSTALLDIR (\r
if defined VS71COMNTOOLS (\r
call "%VS71COMNTOOLS%\vsvars32.bat"\r
)\r
shift\r
\r
-:check_new_build\r
-@if /I "%1"=="NewBuild" goto NewBuild\r
+:check_Ant_build\r
+ @if /I "%1"=="AntBuild" goto AntBuild\r
\r
-:AntBuild\r
@REM\r
-@REM Check the required system environment variables\r
+@REM Default is new, Makefile Base Build\r
@REM\r
\r
-:check_vc\r
-if defined VCINSTALLDIR goto check_cygwin\r
-if defined VS71COMNTOOLS (\r
- call "%VS71COMNTOOLS%\vsvars32.bat"\r
-) else (\r
+@if /I "%1"=="NewBuild" shift\r
+@if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
+@IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools\r
+@call %EDK_TOOLS_PATH%\toolsetup.bat %*\r
+@goto end\r
+\r
+:BadBaseTools\r
+ @REM\r
+ @REM Need the BaseTools Package in order to build\r
+ @REM\r
echo.\r
- echo !!! WARNING !!! Cannot find Visual Studio !!!\r
+ echo !!! ERROR !!! The BaseTools Package was not found !!!\r
echo.\r
-)\r
+ echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,\r
+ echo For example,\r
+ echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools\r
+ echo The setup script, toolsetup.bat must reside in this folder.\r
+ echo.\r
+ @goto end\r
+\r
+@REM With the exception of the :end and :Usage tags, all information below\r
+@REM these lines is for the JAVA/Ant Build!\r
+\r
+:AntBuild\r
+ @REM\r
+ @REM Check the required system environment variables\r
+ @REM\r
+ @if /I "%1"=="AntBuild" shift\r
+\r
+ set FOUND="FALSE"\r
+ if exist "Tools\Jars" set FOUND="TRUE"\r
+ if exist "%EDK_TOOLS_PATH%\Tools\Jars" set FOUND="TRUE"\r
+ if %FOUND%=="FALSE" (\r
+ echo.\r
+ echo !!! ERROR !!! You have selected the Java/Ant build, however those tools\r
+ echo cannot be found in this WORKSPACE.\r
+ echo.\r
+ echo Please double check that the AntTools project is installed\r
+ echo in this WORKSPACE.\r
+ echo.\r
+ set FOUND=""\r
+ goto end\r
+ )\r
+ set FOUND=""\r
+\r
+:check_vc\r
+ if defined VCINSTALLDIR goto check_cygwin\r
+ if defined VS71COMNTOOLS (\r
+ call "%VS71COMNTOOLS%\vsvars32.bat"\r
+ ) else (\r
+ echo.\r
+ echo !!! WARNING !!! Cannot find Visual Studio !!!\r
+ echo.\r
+ )\r
\r
:check_cygwin\r
-if defined CYGWIN_HOME goto check_java\r
-if exist c:\cygwin (\r
- set CYGWIN_HOME=c:\cygwin\r
-) else (\r
- echo.\r
- echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!\r
- echo.\r
-)\r
+ if defined CYGWIN_HOME goto check_java\r
+ if exist c:\cygwin (\r
+ set CYGWIN_HOME=c:\cygwin\r
+ ) else (\r
+ echo.\r
+ echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!\r
+ echo.\r
+ )\r
\r
:check_java\r
-if "%JAVA_HOME%"=="" goto no_jdk\r
+ if "%JAVA_HOME%"=="" goto no_jdk\r
\r
:check_ant\r
-if "%ANT_HOME%"=="" goto no_ant\r
-if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib\r
+ if "%ANT_HOME%"=="" goto no_ant\r
+ if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib\r
\r
:check_xmlbeans\r
-if "%XMLBEANS_HOME%"=="" goto no_xmlbeans\r
-if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8\r
+ if "%XMLBEANS_HOME%"=="" goto no_xmlbeans\r
+ if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8\r
\r
set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin\r
\r
goto path_ok\r
\r
:check_path\r
-if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok\r
-set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%\r
-set WORKSPACE_TOOLS_PATH=%WORKSPACE%\Tools\bin\r
-echo Resetting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE\r
+ if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok\r
+ set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%\r
+ set WORKSPACE_TOOLS_PATH=%WORKSPACE%\Tools\bin\r
+ echo Resetting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE\r
\r
:path_ok\r
\r
-@if /I "%1"=="ForceRebuild" goto ForceBuild\r
-@if /I "%1"=="Reconfig" goto Reconfig\r
+ @if /I "%1"=="ForceRebuild" goto ForceBuild\r
+ @if /I "%1"=="Reconfig" goto Reconfig\r
\r
@IF NOT EXIST "Tools\Jars\Common.jar" goto NormalBuild\r
@IF NOT EXIST "Tools\Jars\PcdTools.jar" goto NormalBuild\r
goto skipbuild\r
\r
:ForceBuild \r
-call ant -f %WORKSPACE%\Tools\build.xml -noclasspath cleanall\r
+ call ant -f %WORKSPACE%\Tools\build.xml -noclasspath cleanall\r
\r
:NormalBuild\r
-@REM\r
-@REM Start to build the Framework Tools\r
-@REM\r
-\r
-echo.\r
-echo Building the Framework Tools\r
-echo.\r
-\r
-@REM\r
-@REM We are going to create the SurfaceArea.jar file first so that the other\r
-@REM Java Programs can use it.\r
-@REM It needs the XMLBEANS libraries in order to compile.\r
-@REM\r
-set CLASSPATH=%XMLBEANS_HOME%\lib;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\xbean.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\xbean_xpath.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\xmlpublic.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\resolver.jar;%CLASSPATH%\r
-\r
-call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea\r
-\r
-@REM\r
-@REM Now we can make the other Java Programs\r
-@REM All of the remaining Java Programs require the SurfaceArea library to compile\r
-@REM\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%CLASSPATH%\r
+ @REM\r
+ @REM Start to build the Framework Tools\r
+ @REM\r
\r
-call ant -f %WORKSPACE%\Tools\build.xml JavaCode\r
-\r
-@REM\r
-@REM We have all of the Java Programs and add-in classes created, so we can start\r
-@REM using the cpp-tasks to create our tools\r
-@REM\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\Common.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\PcdTools.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\GenBuild.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\cpptasks.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\frameworktasks.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Bin\MigrationTools.jar;%CLASSPATH%\r
-\r
-call ant -f %WORKSPACE%\Tools\build.xml C_Code\r
+ echo.\r
+ echo Building the Framework Tools\r
+ echo.\r
\r
-@REM\r
-@REM Done!!!\r
-@REM\r
-goto end\r
+ @REM\r
+ @REM We are going to create the SurfaceArea.jar file first so that the other\r
+ @REM Java Programs can use it.\r
+ @REM It needs the XMLBEANS libraries in order to compile.\r
+ @REM\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\xbean.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\xbean_xpath.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\xmlpublic.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\resolver.jar;%CLASSPATH%\r
+\r
+ call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea\r
+\r
+ @REM\r
+ @REM Now we can make the other Java Programs\r
+ @REM All of the remaining Java Programs require the SurfaceArea library to compile\r
+ @REM\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%CLASSPATH%\r
+\r
+ call ant -f %WORKSPACE%\Tools\build.xml JavaCode\r
+\r
+ @REM\r
+ @REM We have all of the Java Programs and add-in classes created, so we can start\r
+ @REM using the cpp-tasks to create our tools\r
+ @REM\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\Common.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\PcdTools.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\GenBuild.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\cpptasks.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\frameworktasks.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Bin\MigrationTools.jar;%CLASSPATH%\r
+\r
+ call ant -f %WORKSPACE%\Tools\build.xml C_Code\r
+\r
+ @REM\r
+ @REM Done!!!\r
+ @REM\r
+ goto end\r
\r
:no_jdk\r
-echo.\r
-echo !!! Please install Java, and set JAVA_HOME !!!\r
-echo.\r
-goto end\r
+ echo.\r
+ echo !!! Please install Java, and set JAVA_HOME !!!\r
+ echo.\r
+ goto end\r
\r
:no_ant\r
-echo.\r
-echo !!! Please install Apache Ant, and set ANT_HOME !!!\r
-echo.\r
-goto end\r
+ echo.\r
+ echo !!! Please install Apache Ant, and set ANT_HOME !!!\r
+ echo.\r
+ goto end\r
\r
:no_antcontrib\r
-echo.\r
-echo !!! Please install Ant-contrib to ANT_HOME !!!\r
-echo.\r
-goto end\r
+ echo.\r
+ echo !!! Please install Ant-contrib to ANT_HOME !!!\r
+ echo.\r
+ goto end\r
\r
:no_xmlbeans\r
-echo.\r
-echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!\r
-echo.\r
-goto end\r
+ echo.\r
+ echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!\r
+ echo.\r
+ goto end\r
\r
:no_saxon8\r
-echo.\r
-echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!\r
-echo.\r
-goto end\r
+ echo.\r
+ echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!\r
+ echo.\r
+ goto end\r
\r
:skipbuild\r
-@REM\r
-@REM This just sets up the CLASSPATH, the rest of the environment should have been set already.\r
-@REM\r
-echo.\r
-echo WORKSPACE: %WORKSPACE%\r
-echo JAVA_HOME: %JAVA_HOME%\r
-echo ANT_HOME: %ANT_HOME%\r
-echo XMLBEANS_HOME: %XMLBEANS_HOME%\r
-echo CYGWIN_HOME: %CYGWIN_HOME%\r
-echo PATH: %PATH%\r
-echo.\r
-set CLASSPATH=%XMLBEANS_HOME%\lib;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\xbean.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\xbean_xpath.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\xmlpublic.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8-dom.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8-xpath.jar;%CLASSPATH%\r
-set CLASSPATH=%XMLBEANS_HOME%\lib\resolver.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\Common.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\PcdTools.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\GenBuild.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\cpptasks.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Jars\frameworktasks.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar;%CLASSPATH%\r
-set CLASSPATH=%WORKSPACE%\Tools\Bin\MigrationTools.jar;%CLASSPATH%\r
-echo CLASSPATH: %CLASSPATH%\r
-goto end\r
+ @REM\r
+ @REM This just sets up the CLASSPATH, the rest of the environment should have been set already.\r
+ @REM\r
+ echo.\r
+ echo WORKSPACE: %WORKSPACE%\r
+ echo JAVA_HOME: %JAVA_HOME%\r
+ echo ANT_HOME: %ANT_HOME%\r
+ echo XMLBEANS_HOME: %XMLBEANS_HOME%\r
+ echo CYGWIN_HOME: %CYGWIN_HOME%\r
+ echo PATH: %PATH%\r
+ echo.\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\xbean.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\xbean_xpath.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\xmlpublic.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8-dom.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8-xpath.jar;%CLASSPATH%\r
+ set CLASSPATH=%XMLBEANS_HOME%\lib\resolver.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\Common.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\PcdTools.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\GenBuild.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\cpptasks.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Jars\frameworktasks.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar;%CLASSPATH%\r
+ set CLASSPATH=%WORKSPACE%\Tools\Bin\MigrationTools.jar;%CLASSPATH%\r
+ echo CLASSPATH: %CLASSPATH%\r
+ goto end\r
\r
:Reconfig\r
-@REM\r
-@REM Reinstall all config files\r
-@REM\r
-call ant -f %WORKSPACE%\Tools\build.xml reconfig\r
-goto end\r
+ @REM\r
+ @REM Reinstall all config files\r
+ @REM\r
+ call ant -f %WORKSPACE%\Tools\build.xml reconfig\r
+ goto end\r
\r
:Usage\r
-echo.\r
-echo Usage: "%0 [--nt32] [NewBuild | Rebuild | ForceRebuild | Reconfig]"\r
-echo --nt32 Call vsvars32.bat for NT32 platform build\r
-echo NewBuild Using new build tools in BaseTools package\r
-echo Rebuild Incremental build, only build those updated tools (Ant build only)\r
-echo ForceRebuild Rebuild all tools neither updated or not (Ant build only)\r
-echo Reconfig Reinstall target.txt, tools_def.txt, FrameworkDatabase.db (Ant build only) \r
-echo.\r
-echo Note that target.template, tools_def.template, FrameworkDatabase.template will be\r
-echo only copied to target.txt, tools_def.txt, FrameworkDatabase.db respectively if they\r
-echo are not existed. Using option [Reconfig] to do the force copy. \r
-echo.\r
-@goto end\r
-\r
-:NewBuild\r
-@IF NOT EXIST "BaseTools\toolsetup.bat" goto AntBuild\r
-if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
-@call BaseTools\toolsetup.bat\r
-@goto end\r
+ echo.\r
+ echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [AntBuild | Rebuild | ForceRebuild ] [Reconfig]"\r
+ echo --nt32 Call vsvars32.bat for NT32 platform build.\r
+ echo.\r
+ echo Rebuild If sources are available perform an Incremental build, only \r
+ echo build those updated tools.\r
+ echo ForceRebuild If sources are available, rebuild all tools regardless of \r
+ echo whether they have been updated or not.\r
+ echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.\r
+ echo.\r
+ echo JAVA/ANT Build\r
+ echo AntBuild Using older Java/ANT build tools in Tools directory.\r
+ echo Rebuild Incremental build, only build those updated tools.\r
+ echo ForceRebuild Rebuild all tools regardless of whether they have been updated or not.\r
+ echo Reconfig Reinstall target.txt, tools_def.txt and FrameworkDatabase.db.\r
+ echo.\r
+ echo Note that target.template, tools_def.template, build_rules.template and the \r
+ echo FrameworkDatabase.template will be only copied to target.txt, tools_def.txt, build_rule.txt and\r
+ echo FrameworkDatabase.db respectively if they do not exist. Using option [Reconfig] to force the copy. \r
+ echo.\r
+ @goto end\r
\r
:end\r
-@popd\r
-@echo on\r
+ @popd\r
+ @echo on\r
\r