klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 1 | @REM
|
| 2 | @REM Currently, Build system does not provide post build mechanism for module
|
| 3 | @REM and platform building, so just use a bat file to do post build commands.
|
| 4 | @REM Originally, following post building command is for EfiLoader module.
|
| 5 | @REM
|
klu2 | 52ce3fa | 2008-04-25 02:59:16 +0000 | [diff] [blame] | 6 |
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 7 | @set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
|
klu2 | 9fe0e26 | 2008-10-29 06:49:52 +0000 | [diff] [blame] | 8 | @set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 9 | @set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 10 | @set PROCESSOR=""
|
klu2 | 52ce3fa | 2008-04-25 02:59:16 +0000 | [diff] [blame] | 11 |
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 12 | @if "%1"=="" goto NoArch
|
| 13 | @if "%1"=="IA32" set PROCESSOR=IA32
|
| 14 | @if "%1"=="X64" set PROCESSOR=X64
|
| 15 | @if %PROCESSOR%=="" goto WrongArch
|
klu2 | 6d3f772 | 2008-05-07 05:11:29 +0000 | [diff] [blame] | 16 |
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 17 | @echo Compressing DUETEFIMainFv.FV ...
|
gikidy | 8b85412 | 2009-05-06 03:44:47 +0000 | [diff] [blame] | 18 | @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 19 |
|
| 20 | @echo Compressing DxeMain.efi ...
|
gikidy | 8b85412 | 2009-05-06 03:44:47 +0000 | [diff] [blame] | 21 | @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 22 |
|
| 23 | @echo Compressing DxeIpl.efi ...
|
gikidy | 8b85412 | 2009-05-06 03:44:47 +0000 | [diff] [blame] | 24 | @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 25 |
|
| 26 | @echo Generate Loader Image ...
|
| 27 | @if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32
|
| 28 | @if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64
|
| 29 |
|
| 30 | :GENERATE_IMAGE_IA32
|
| 31 | @%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
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 32 | @copy /b %BOOTSECTOR_BIN_DIR%\Start.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr
|
| 33 | @copy /b %BOOTSECTOR_BIN_DIR%\Start16.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16
|
| 34 | @copy /b %BOOTSECTOR_BIN_DIR%\Start32.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 35 | @goto end
|
| 36 |
|
| 37 | :GENERATE_IMAGE_X64
|
| 38 | @%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
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 39 | @copy /b %BOOTSECTOR_BIN_DIR%\Start64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 40 | @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 41 | @copy /b %BOOTSECTOR_BIN_DIR%\St16_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 42 | @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 43 | @copy /b %BOOTSECTOR_BIN_DIR%\St32_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 44 | @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20
|
| 45 | @goto end
|
| 46 |
|
| 47 |
|
| 48 | :NoArch
|
| 49 | @echo Error! Please specific the architecture.
|
| 50 | @goto Help
|
| 51 |
|
| 52 | :WrongArch
|
| 53 | @echo Error! Wrong architecture.
|
| 54 | @goto Help
|
| 55 |
|
| 56 | :Help
|
| 57 | @echo Usage: "PostBuild [IA32|X64]"
|
| 58 | :end |