REM open a new command promptsetWORKSPACE=c:\myedk2
cd%WORKSPACE%setPACKAGES_PATH=%WORKSPACE%/edk2;%WORKSPACE%/edk2-libc;%WORKSPACE%/edk2-test;%WORKSPACE%/edk2-platforms/Silicon/Intel;%WORKSPACE%/edk2-platforms
edk2\edksetup.bat VS2019
build -a X64 -t VS2019 -p AppPkg/AppPkg.dsc -b RELEASE
@echo off
setTOOL_CHAIN_TAG=%1setTARGET=%2setARCH=%3setOUT_FOLDER=%4if"%TOOL_CHAIN_TAG%"==""gotousageif"%TARGET%"==""gotousageif"%ARCH%"==""gotousageif"%OUT_FOLDER%"==""gotousagegotocontinue:usageecho.
echo Batch Script to create Python EFI Package.
echo.
echo Invalid command line arguments passed, please see the below usage instructions
echo.
echo"Usage: %0 <ToolChain> <Target> <Architecture> <OutFolder>"echo.
echo ToolChain = one of VS2013x86, VS2015x86, VS2017, VS2019
echo Target = one of RELEASE, DEBUG
echo Architecture = one of IA32, X64
echo OutFolder = Output directory for creating the package
echo.
goto:eof:continuecd ..\..\..\..\..\
ifnotexist Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python.efi (gotoerror)ifnotexist%OUT_FOLDER%\EFI\Tools (mkdir%OUT_FOLDER%\EFI\Tools
)xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python.efi %OUT_FOLDER%\EFI\Tools\ /y
ifnotexist%OUT_FOLDER%\EFI\StdLib\lib\python36.8 (mkdir%OUT_FOLDER%\EFI\StdLib\lib\python36.8
)ifnotexist%OUT_FOLDER%\EFI\StdLib\etc (mkdir%OUT_FOLDER%\EFI\StdLib\etc
)xcopy edk2-libc\AppPkg\Applications\Python\Python-3.6.8\Lib\* %OUT_FOLDER%\EFI\StdLib\lib\python36.8\ /Y /S /I
xcopy edk2-libc\StdLib\Efi\StdLib\etc\* %OUT_FOLDER%\EFI\StdLib\etc\ /Y /S /I
echo.
ifnot x%OUT_FOLDER::=%==x%OUT_FOLDER%(echo Python EFI package available at %OUT_FOLDER%)else(echo Python EFI package available at %CD%\%OUT_FOLDER%)gotoall_done:errorecho Failed to Create Python EFI Package
echo Python.efi is not available at Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\
echo Follow the instructions in Py368ReadMe.txt to build Python interpreter
echo Then use this script to create a Python EFI package
:all_doneexit /b %ERRORLEVEL%