blob: 43f7de94643963d78a1a9631d4b06201e9aa80ae [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
klu2e88f3052009-06-22 03:01:53 +00009@set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin
klu2c5dfb472008-05-08 06:22:31 +000010@set PROCESSOR=""
klu252ce3fa2008-04-25 02:59:16 +000011
klu2c5dfb472008-05-08 06:22:31 +000012@if "%1"=="" goto NoArch
13@if "%1"=="IA32" set PROCESSOR=IA32
14@if "%1"=="X64" set PROCESSOR=X64
15@if %PROCESSOR%=="" goto WrongArch
klu26d3f7722008-05-07 05:11:29 +000016
klu2c5dfb472008-05-08 06:22:31 +000017@echo Compressing DUETEFIMainFv.FV ...
gikidy8b854122009-05-06 03:44:47 +000018@%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv
klu2c5dfb472008-05-08 06:22:31 +000019
20@echo Compressing DxeMain.efi ...
gikidy8b854122009-05-06 03:44:47 +000021@%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi
klu2c5dfb472008-05-08 06:22:31 +000022
23@echo Compressing DxeIpl.efi ...
gikidy8b854122009-05-06 03:44:47 +000024@%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi
klu2c5dfb472008-05-08 06:22:31 +000025
26@echo Generate Loader Image ...
27@if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32
28@if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64
29
30:GENERATE_IMAGE_IA32
31@%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
klu2e88f3052009-06-22 03:01:53 +000032@copy /b %BOOTSECTOR_BIN_DIR%\Start.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr
33@copy /b %BOOTSECTOR_BIN_DIR%\Start16.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16
34@copy /b %BOOTSECTOR_BIN_DIR%\Start32.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20
klu2c5dfb472008-05-08 06:22:31 +000035@goto end
36
37:GENERATE_IMAGE_X64
38@%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
klu2e88f3052009-06-22 03:01:53 +000039@copy /b %BOOTSECTOR_BIN_DIR%\Start64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure
klu2c5dfb472008-05-08 06:22:31 +000040@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
klu2e88f3052009-06-22 03:01:53 +000041@copy /b %BOOTSECTOR_BIN_DIR%\St16_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure
klu2c5dfb472008-05-08 06:22:31 +000042@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
klu2e88f3052009-06-22 03:01:53 +000043@copy /b %BOOTSECTOR_BIN_DIR%\St32_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure
klu2c5dfb472008-05-08 06:22:31 +000044@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20
45@goto end
46
47
48:NoArch
49@echo Error! Please specific the architecture.
50@goto Help
51
52:WrongArch
53@echo Error! Wrong architecture.
54@goto Help
55
56:Help
57@echo Usage: "PostBuild [IA32|X64]"
58:end