]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/PostBuild.bat
sync comments, fix function header, rename variable name to follow coding style.
[mirror_edk2.git] / DuetPkg / PostBuild.bat
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
6
7 @set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
8 @set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
9 @set PROCESSOR=""
10
11 @if "%1"=="" goto NoArch
12 @if "%1"=="IA32" set PROCESSOR=IA32
13 @if "%1"=="X64" set PROCESSOR=X64
14 @if %PROCESSOR%=="" goto WrongArch
15
16 @set OUTPUT_DIR=%BUILD_DIR%\%PROCESSOR%\DuetPkg\BootSector\BootSector\OUTPUT
17
18 @echo Compressing DUETEFIMainFv.FV ...
19 @%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv
20
21 @echo Compressing DxeMain.efi ...
22 @%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi
23
24 @echo Compressing DxeIpl.efi ...
25 @%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi
26
27 @echo Generate Loader Image ...
28 @if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32
29 @if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64
30
31 :GENERATE_IMAGE_IA32
32 @%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
33 @copy /b %OUTPUT_DIR%\Start.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr
34 @copy /b %OUTPUT_DIR%\Start16.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16
35 @copy /b %OUTPUT_DIR%\Start32.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20
36 @goto end
37
38 :GENERATE_IMAGE_X64
39 @%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
40 @copy /b %OUTPUT_DIR%\Start64.com+%OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure
41 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
42 @copy /b %OUTPUT_DIR%\St16_64.com+%OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure
43 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
44 @copy /b %OUTPUT_DIR%\St32_64.com+%OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure
45 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20
46 @goto end
47
48
49 :NoArch
50 @echo Error! Please specific the architecture.
51 @goto Help
52
53 :WrongArch
54 @echo Error! Wrong architecture.
55 @goto Help
56
57 :Help
58 @echo Usage: "PostBuild [IA32|X64]"
59 :end