2 @REM Currently, Build system does not provide post build mechanism for module
\r
3 @REM and platform building, so just use a bat file to do post build commands.
\r
4 @REM Originally, following post building command is for EfiLoader module.
\r
7 @set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
\r
8 @set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
\r
11 @if "%1"=="" goto NoArch
\r
12 @if "%1"=="IA32" set PROCESSOR=IA32
\r
13 @if "%1"=="X64" set PROCESSOR=X64
\r
14 @if %PROCESSOR%=="" goto WrongArch
\r
16 @set OUTPUT_DIR=%BUILD_DIR%\%PROCESSOR%\DuetPkg\BootSector\BootSector\OUTPUT
\r
17 @set BOOTSECTOR_OUTPUT_DIR=%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT
\r
19 @echo Compressing DUETEFIMainFv.FV ...
\r
20 @%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv
\r
22 @echo Compressing DxeMain.efi ...
\r
23 @%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi
\r
25 @echo Compressing DxeIpl.efi ...
\r
26 @%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi
\r
28 @echo Generate Loader Image ...
\r
29 @if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32
\r
30 @if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64
\r
32 :GENERATE_IMAGE_IA32
\r
33 @%BASETOOLS_DIR%\EfiLdrImage.exe -o %BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\%PROCESSOR%\EfiLoader.efi %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\FV\DUETEFIMAINFV.z
\r
34 @copy /b %OUTPUT_DIR%\Start.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr
\r
35 @copy /b %OUTPUT_DIR%\Start16.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16
\r
36 @copy /b %OUTPUT_DIR%\Start32.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20
\r
40 @%BASETOOLS_DIR%\EfiLdrImage.exe -o %BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\%PROCESSOR%\EfiLoader.efi %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\FV\DUETEFIMAINFV.z
\r
41 @copy /b %BOOTSECTOR_OUTPUT_DIR%\Start64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure
\r
42 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
\r
43 @copy /b %BOOTSECTOR_OUTPUT_DIR%\St16_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure
\r
44 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
\r
45 @copy /b %BOOTSECTOR_OUTPUT_DIR%\St32_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure
\r
46 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20
\r
51 @echo Error! Please specific the architecture.
\r
55 @echo Error! Wrong architecture.
\r
59 @echo Usage: "PostBuild [IA32|X64]"
\r