小華的部落格: 2012/9/16 - 2012/9/23

搜尋此網誌

網頁

星期三, 9月 19, 2012

EDKII - Build.py

最近在研究EDKII的 Build process的動作,順便做做筆記!

這個Python Build tool是EDKII/EDK2 的一個Build tool,而底下是Build.py 目前支援的Command line options,因為我還沒追完全部的動作,所以先整理一下比較會使用到的部分:

===============================================================
"-a", "--arch", , choices=['IA32','X64','IPF','EBC','ARM'], dest="TargetArch",
"-p", "--platform"dest="PlatformFile"
"-m", "--module",, dest="ModuleFile"
"-b", "--buildtarget",  dest="BuildTarget"
"-t", "--tagname", , dest="ToolChain",
"-x", "--sku-id", , dest="SkuId", 
"-n",  dest="ThreadNumber"
"-f", "--fdf", dest="FdfFile"
"-r", "--rom-image", dest="RomImage"
"-i", "--fv-image", dest="FvImage"
"-C", "--capsule-image", dest="CapName"
"-u", "--skip-autogen", dest="SkipAutoGen"
"-e", "--re-parse", , dest="Reparse"
"-c", "--case-insensitive", dest="CaseInsensitive"
"-w", "--warning-as-error", dest="WarningAsError
"-j", "--log",  dest="LogFile"
"-s", "--silent",, dest="SilentMode",
"-q", "--quiet"
"-v", "--verbose"
"-d", "--debug"
"-D", "--define",dest="Macros"
"-y", "--report-file"dest="ReportFile"
"-Y", "--report-type" choices=['PCD','LIBRARY','FLASH','DEPEX','BUILD_FLAGS','FIXED_ADDRESS', 'EXECUTION_ORDER'], dest="ReportType"

"-F", "--flag", dest="Flag",
"-N", "--no-cache", dest="DisableCache"

從上面資料中可以看到-a 或是--arch對他來說應該都是同一個選項.
而底下是一些實際範例的說明,希望對大家有幫助~

======================
build.exe  -p ACTIVE_PLATFORM 
======================
ex: build -p DUETPkg\DuetPkg64.dsc
說明: 等同於修改Target.txt內的 ACTIVE_PLATFORM       = Nt32Pkg/Nt32Pkg.dsc

=====================
build -b TARGET
=====================
ex: build -b DEBUG
說明: 等同於修改Target.txt內的TARGET= DEBUG,以及DSC file: [Defines] BUILD_TARGETS tag

[Defines]
  PLATFORM_NAME                  = NT32
  PLATFORM_GUID                  = EB216561-961F-47EE-9EF9-CA426EF547C2
  PLATFORM_VERSION               = 0.4
  DSC_SPECIFICATION              = 0x00010005
  OUTPUT_DIRECTORY               = Build/NT32
  SUPPORTED_ARCHITECTURES        = IA32
  BUILD_TARGETS                  = DEBUG|RELEASE
  SKUID_IDENTIFIER               = DEFAULT
  FLASH_DEFINITION               = Nt32Pkg/Nt32Pkg.fdf

=====================
build -a TARGET
=====================
ex: build -d x64
說明: 等同於修改Target.txt內的TARGET_ARCH           = IA32,以及DSC file: [Defines] SUPPORTED_ARCHITECTURES tag (同上範例)

=====================
build -t TOOL_CHAIN
=====================
ex: build -t VS2010x86
說明: 等同於修改Target.txt內的TOOL_CHAIN_TAG        = VS2008x86 

=====================
build --log=Build.log
=====================
--log 可以產生建置過程的紀錄檔