blob: 8ed7943e29a871794a548490090ddcd3d7e161f6 [file] [log] [blame]
klu2c5dfb472008-05-08 06:22:31 +00001@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
klu252ce3fa2008-04-25 02:59:16 +00006
klu2c5dfb472008-05-08 06:22:31 +00007@set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
klu29fe0e262008-10-29 06:49:52 +00008@set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
klu2c5dfb472008-05-08 06:22:31 +00009@set PROCESSOR=""
klu252ce3fa2008-04-25 02:59:16 +000010
klu2c5dfb472008-05-08 06:22:31 +000011@if "%1"=="" goto NoArch
12@if "%1"=="IA32" set PROCESSOR=IA32
13@if "%1"=="X64" set PROCESSOR=X64
14@if %PROCESSOR%=="" goto WrongArch
klu26d3f7722008-05-07 05:11:29 +000015
klu2c5dfb472008-05-08 06:22:31 +000016@set OUTPUT_DIR=%BUILD_DIR%\%PROCESSOR%\DuetPkg\BootSector\BootSector\OUTPUT
klu2105c70e2009-03-01 09:52:07 +000017@set BOOTSECTOR_OUTPUT_DIR=%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT
klu2c5dfb472008-05-08 06:22:31 +000018
19@echo Compressing DUETEFIMainFv.FV ...
gikidy8b854122009-05-06 03:44:47 +000020@%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv
klu2c5dfb472008-05-08 06:22:31 +000021
22@echo Compressing DxeMain.efi ...
gikidy8b854122009-05-06 03:44:47 +000023@%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi
klu2c5dfb472008-05-08 06:22:31 +000024
25@echo Compressing DxeIpl.efi ...
gikidy8b854122009-05-06 03:44:47 +000026@%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi
klu2c5dfb472008-05-08 06:22:31 +000027
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
klu2105c70e2009-03-01 09:52:07 +000041@copy /b %BOOTSECTOR_OUTPUT_DIR%\Start64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure
klu2c5dfb472008-05-08 06:22:31 +000042@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
klu2105c70e2009-03-01 09:52:07 +000043@copy /b %BOOTSECTOR_OUTPUT_DIR%\St16_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure
klu2c5dfb472008-05-08 06:22:31 +000044@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
klu2105c70e2009-03-01 09:52:07 +000045@copy /b %BOOTSECTOR_OUTPUT_DIR%\St32_64.com+%BOOTSECTOR_OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure
klu2c5dfb472008-05-08 06:22:31 +000046@%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