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 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 9 | @set PROCESSOR=""
|
klu2 | 52ce3fa | 2008-04-25 02:59:16 +0000 | [diff] [blame] | 10 |
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 11 | @if "%1"=="" goto NoArch
|
| 12 | @if "%1"=="IA32" set PROCESSOR=IA32
|
| 13 | @if "%1"=="X64" set PROCESSOR=X64
|
| 14 | @if %PROCESSOR%=="" goto WrongArch
|
klu2 | 6d3f772 | 2008-05-07 05:11:29 +0000 | [diff] [blame] | 15 |
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 16 | @set OUTPUT_DIR=%BUILD_DIR%\%PROCESSOR%\DuetPkg\BootSector\BootSector\OUTPUT
|
klu2 | 105c70e | 2009-03-01 09:52:07 +0000 | [diff] [blame] | 17 | @set BOOTSECTOR_OUTPUT_DIR=%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 18 |
|
| 19 | @echo Compressing DUETEFIMainFv.FV ...
|
gikidy | 8b85412 | 2009-05-06 03:44:47 +0000 | [diff] [blame^] | 20 | @%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] | 21 |
|
| 22 | @echo Compressing DxeMain.efi ...
|
gikidy | 8b85412 | 2009-05-06 03:44:47 +0000 | [diff] [blame^] | 23 | @%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] | 24 |
|
| 25 | @echo Compressing DxeIpl.efi ...
|
gikidy | 8b85412 | 2009-05-06 03:44:47 +0000 | [diff] [blame^] | 26 | @%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] | 27 |
|
| 28 | @echo Generate Loader Image ...
|
| 29 | @if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32
|
| 30 | @if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64
|
| 31 |
|
| 32 | :GENERATE_IMAGE_IA32
|
| 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
|
| 34 | @copy /b %OUTPUT_DIR%\Start.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr
|
| 35 | @copy /b %OUTPUT_DIR%\Start16.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16
|
| 36 | @copy /b %OUTPUT_DIR%\Start32.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20
|
| 37 | @goto end
|
| 38 |
|
| 39 | :GENERATE_IMAGE_X64
|
| 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
|
klu2 | 105c70e | 2009-03-01 09:52:07 +0000 | [diff] [blame] | 41 | @copy /b %BOOTSECTOR_OUTPUT_DIR%\Start64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 42 | @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
|
klu2 | 105c70e | 2009-03-01 09:52:07 +0000 | [diff] [blame] | 43 | @copy /b %BOOTSECTOR_OUTPUT_DIR%\St16_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 44 | @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
|
klu2 | 105c70e | 2009-03-01 09:52:07 +0000 | [diff] [blame] | 45 | @copy /b %BOOTSECTOR_OUTPUT_DIR%\St32_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 46 | @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20
|
| 47 | @goto end
|
| 48 |
|
| 49 |
|
| 50 | :NoArch
|
| 51 | @echo Error! Please specific the architecture.
|
| 52 | @goto Help
|
| 53 |
|
| 54 | :WrongArch
|
| 55 | @echo Error! Wrong architecture.
|
| 56 | @goto Help
|
| 57 |
|
| 58 | :Help
|
| 59 | @echo Usage: "PostBuild [IA32|X64]"
|
| 60 | :end |