blob: 97b3649a2283ad2bc5441da90b3452a3c844da6b [file] [log] [blame]
klu2e4c00742010-03-10 01:23:13 +00001@REM ## @file
2@REM #
3@REM # Currently, Build system does not provide post build mechanism for module
4@REM # and platform building, so just use a bat file to do post build commands.
5@REM # Originally, following post building command is for EfiLoader module.
6@REM #
7@REM # Copyright (c) 2010, Intel Corporation, All rights reserved. <BR>
8@REM #
9@REM # This program and the accompanying materials
10@REM # are licensed and made available under the terms and conditions of the BSD License
11@REM # which accompanies this distribution. The full text of the license may be found at
12@REM # http://opensource.org/licenses/bsd-license.php
13@REM # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14@REM # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15@REM #
16@REM #
17@REM ##
klu252ce3fa2008-04-25 02:59:16 +000018
klu2c5dfb472008-05-08 06:22:31 +000019@set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
klu29fe0e262008-10-29 06:49:52 +000020@set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
klu2e88f3052009-06-22 03:01:53 +000021@set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin
klu2c5dfb472008-05-08 06:22:31 +000022@set PROCESSOR=""
klu252ce3fa2008-04-25 02:59:16 +000023
klu2c5dfb472008-05-08 06:22:31 +000024@if "%1"=="" goto NoArch
25@if "%1"=="IA32" set PROCESSOR=IA32
26@if "%1"=="X64" set PROCESSOR=X64
27@if %PROCESSOR%=="" goto WrongArch
klu26d3f7722008-05-07 05:11:29 +000028
klu2c5dfb472008-05-08 06:22:31 +000029@echo Compressing DUETEFIMainFv.FV ...
gikidy8b854122009-05-06 03:44:47 +000030@%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv
klu2c5dfb472008-05-08 06:22:31 +000031
32@echo Compressing DxeMain.efi ...
gikidy8b854122009-05-06 03:44:47 +000033@%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi
klu2c5dfb472008-05-08 06:22:31 +000034
35@echo Compressing DxeIpl.efi ...
gikidy8b854122009-05-06 03:44:47 +000036@%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi
klu2c5dfb472008-05-08 06:22:31 +000037
38@echo Generate Loader Image ...
39@if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32
40@if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64
41
42:GENERATE_IMAGE_IA32
43@%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 +000044@copy /b %BOOTSECTOR_BIN_DIR%\Start.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr
45@copy /b %BOOTSECTOR_BIN_DIR%\Start16.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16
46@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 +000047@goto end
48
49:GENERATE_IMAGE_X64
50@%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 +000051@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 +000052@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
klu2e88f3052009-06-22 03:01:53 +000053@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 +000054@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
klu2e88f3052009-06-22 03:01:53 +000055@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 +000056@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20
57@goto end
58
59
60:NoArch
61@echo Error! Please specific the architecture.
62@goto Help
63
64:WrongArch
65@echo Error! Wrong architecture.
66@goto Help
67
68:Help
69@echo Usage: "PostBuild [IA32|X64]"
70:end