]> git.proxmox.com Git - mirror_edk2.git/blame - DuetPkg/PostBuild.bat
Using sizeof(EFO_BLOCK_IO_MEDIA) replace Macro.
[mirror_edk2.git] / DuetPkg / PostBuild.bat
CommitLineData
c5dfb477 1@REM \r
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
5@REM \r
6d3f7723 6\r
c5dfb477 7@set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS\r
9fe0e267 8@set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32\r
c5dfb477 9@set PROCESSOR=""\r
10\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
15\r
16@set OUTPUT_DIR=%BUILD_DIR%\%PROCESSOR%\DuetPkg\BootSector\BootSector\OUTPUT\r
105c70e2 17@set BOOTSECTOR_OUTPUT_DIR=%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\r
c5dfb477 18\r
19@echo Compressing DUETEFIMainFv.FV ...\r
20@%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv\r
21\r
22@echo Compressing DxeMain.efi ...\r
9fe0e267 23@%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi\r
c5dfb477 24\r
25@echo Compressing DxeIpl.efi ...\r
26@%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi\r
27\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
31\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
37@goto end\r
38\r
39:GENERATE_IMAGE_X64\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
105c70e2 41@copy /b %BOOTSECTOR_OUTPUT_DIR%\Start64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure\r
c5dfb477 42@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr\r
105c70e2 43@copy /b %BOOTSECTOR_OUTPUT_DIR%\St16_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure\r
c5dfb477 44@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16\r
105c70e2 45@copy /b %BOOTSECTOR_OUTPUT_DIR%\St32_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure\r
c5dfb477 46@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20\r
47@goto end\r
48\r
49\r
50:NoArch\r
51@echo Error! Please specific the architecture.\r
52@goto Help\r
53\r
54:WrongArch\r
55@echo Error! Wrong architecture.\r
56@goto Help\r
57\r
58:Help\r
59@echo Usage: "PostBuild [IA32|X64]"\r
60:end