]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/PostBuild.bat
Reviewed the code comments in the Include/Protocol directory for typos, grammar issue...
[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 @set BOOTSECTOR_OUTPUT_DIR=%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT
18
19 @echo Compressing DUETEFIMainFv.FV ...
20 @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv
21
22 @echo Compressing DxeMain.efi ...
23 @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi
24
25 @echo Compressing DxeIpl.efi ...
26 @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi
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
41 @copy /b %BOOTSECTOR_OUTPUT_DIR%\Start64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure
42 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
43 @copy /b %BOOTSECTOR_OUTPUT_DIR%\St16_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure
44 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
45 @copy /b %BOOTSECTOR_OUTPUT_DIR%\St32_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure
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