DuetPkg: Add POSTBUILD in DSC files to run post-build automatically

https://bugzilla.tianocore.org/show_bug.cgi?id=220

Currently, the post-build scripts PostBuild.bat/PostBuild.sh in DuetPkg
need to be run manually. Especially for Windows batch script, it also
requires users to set the build options (like tool chain, target and arch)
in file Conf/target.txt. If users using command line options via '-t' or
'-a', the post-build script won't work properly.

The package DSC files now support the feature to execute post-build script
automatically by adding a 'POSTBUILD' definition. This feature also passes
the build options into the post-build script as parameters. This commit
uses this feature to make the post-build works for DuetPkg more
user-friendly. Also, ReadMe.txt is updated to reflect the new steps for
UEFI Emulation (DUET) development.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
Hao Wu
2016-11-11 16:21:35 +08:00
parent ea4511d127
commit bab82372a9
10 changed files with 105 additions and 150 deletions

View File

@@ -1,7 +1,7 @@
@echo off
@REM ## @file
@REM #
@REM # Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
@REM # Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
@REM #
@REM # This program and the accompanying materials
@REM # are licensed and made available under the terms and conditions of the BSD License
@@ -15,14 +15,11 @@
@REM Set up environment at first.
set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
set BASETOOLS_DIR=%EDK_TOOLS_BIN%
set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin
set DISK_LABEL=DUET
set PROCESSOR=""
set STEP=1
call %WORKSPACE%\DuetPkg\GetVariables.bat
echo on
if "%1"=="" goto Help
if "%2"=="" goto Help
@@ -35,6 +32,7 @@ set EFI_BOOT_DISK=%2
if "%TARGET_ARCH%"=="IA32" set PROCESSOR=IA32
if "%TARGET_ARCH%"=="X64" set PROCESSOR=X64
if %PROCESSOR%=="" goto WrongArch
call %WORKSPACE%\DuetPkg\SetEnv_%PROCESSOR%.bat
set BUILD_DIR=%WORKSPACE%\Build\DuetPkg%PROCESSOR%\%TARGET%_%TOOL_CHAIN_TAG%
if "%1"=="floppy" goto CreateFloppy