@echo off\r
@REM ## @file\r
@REM #\r
-@REM # Currently, Build system does not provide post build mechanism for module\r
-@REM # and platform building, so just use a bat file to do post build commands.\r
-@REM # Originally, following post building command is for EfiLoader module.\r
+@REM # Post build script that will be automatically run after build.\r
@REM #\r
-@REM # Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+@REM # Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
@REM #\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 #\r
@REM ##\r
\r
-set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32\r
+set BASETOOLS_DIR=%EDK_TOOLS_BIN%\r
set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin\r
-set PROCESSOR=""\r
-call %WORKSPACE%\DuetPkg\GetVariables.bat\r
\r
-if NOT "%1"=="" @set TARGET_ARCH=%1\r
-if "%TARGET_ARCH%"=="IA32" set PROCESSOR=IA32\r
-if "%TARGET_ARCH%"=="X64" set PROCESSOR=X64\r
-if %PROCESSOR%=="" goto WrongArch\r
+:SetDefault\r
+set TARGET_ARCH=\r
+set TARGET=\r
+set TOOL_CHAIN_TAG=\r
\r
+:ParseParamsLoop\r
+if "%1"=="" goto EndPParseParamsLoop\r
+if /I "%1"=="-p" goto ParseParamsLoopNext\r
+if /I "%1"=="-a" set TARGET_ARCH=%2& goto ParseParamsLoopNext\r
+if /I "%1"=="-b" set TARGET=%2& goto ParseParamsLoopNext\r
+if /I "%1"=="-t" set TOOL_CHAIN_TAG=%2& goto ParseParamsLoopNext\r
+if /I "%1"=="-h" goto Help\r
+\r
+:ParseParamsLoopNext\r
+shift\r
+shift\r
+goto ParseParamsLoop\r
+\r
+:EndPParseParamsLoop\r
+if "%TARGET_ARCH%"=="" goto Help\r
+if "%TARGET%"=="" goto Help\r
+if "%TOOL_CHAIN_TAG%"=="" goto Help\r
+\r
+set PROCESSOR=%TARGET_ARCH%\r
set BUILD_DIR=%WORKSPACE%\Build\DuetPkg%PROCESSOR%\%TARGET%_%TOOL_CHAIN_TAG%\r
\r
+@REM Store environment variables used by CreateBootDisk.bat\r
+echo set TARGET=%TARGET%> %WORKSPACE%\DuetPkg\SetEnv_%PROCESSOR%.bat\r
+echo set TOOL_CHAIN_TAG=%TOOL_CHAIN_TAG%>> %WORKSPACE%\DuetPkg\SetEnv_%PROCESSOR%.bat\r
\r
echo Compressing DUETEFIMainFv.FV ...\r
%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv\r
%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20\r
goto end\r
\r
-\r
-:WrongArch\r
-echo Error! Wrong architecture.\r
-goto Help\r
-\r
:Help\r
-echo Usage: "PostBuild [IA32|X64]"\r
-:end
\ No newline at end of file
+echo Usage: This script will be run automatically after build.\r
+:end\r