klu2 | e4c0074 | 2010-03-10 01:23:13 +0000 | [diff] [blame] | 1 | @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 #
|
niruiyu | 7708d08 | 2011-07-01 04:48:45 +0000 | [diff] [blame] | 7 | @REM # Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
klu2 | e4c0074 | 2010-03-10 01:23:13 +0000 | [diff] [blame] | 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 ##
|
klu2 | 52ce3fa | 2008-04-25 02:59:16 +0000 | [diff] [blame] | 18 |
|
klu2 | 9fe0e26 | 2008-10-29 06:49:52 +0000 | [diff] [blame] | 19 | @set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 20 | @set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 21 | @set PROCESSOR=""
|
niruiyu | 7708d08 | 2011-07-01 04:48:45 +0000 | [diff] [blame] | 22 | @call %WORKSPACE%\DuetPkg\GetVariables.bat
|
klu2 | 52ce3fa | 2008-04-25 02:59:16 +0000 | [diff] [blame] | 23 |
|
niruiyu | 7708d08 | 2011-07-01 04:48:45 +0000 | [diff] [blame] | 24 | @if NOT "%1"=="" @set TARGET_ARCH=%1
|
| 25 | @if "%TARGET_ARCH%"=="IA32" set PROCESSOR=IA32
|
| 26 | @if "%TARGET_ARCH%"=="X64" set PROCESSOR=X64
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 27 | @if %PROCESSOR%=="" goto WrongArch
|
klu2 | 6d3f772 | 2008-05-07 05:11:29 +0000 | [diff] [blame] | 28 |
|
niruiyu | 7708d08 | 2011-07-01 04:48:45 +0000 | [diff] [blame] | 29 | @set BUILD_DIR=%WORKSPACE%\Build\DuetPkg%PROCESSOR%\%TARGET%_%TOOL_CHAIN_TAG%
|
klu2 | ab9cb4b | 2010-03-18 02:36:52 +0000 | [diff] [blame] | 30 |
|
| 31 |
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 32 | @echo Compressing DUETEFIMainFv.FV ...
|
gikidy | 8b85412 | 2009-05-06 03:44:47 +0000 | [diff] [blame] | 33 | @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 34 |
|
| 35 | @echo Compressing DxeMain.efi ...
|
gikidy | 8b85412 | 2009-05-06 03:44:47 +0000 | [diff] [blame] | 36 | @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 37 |
|
| 38 | @echo Compressing DxeIpl.efi ...
|
gikidy | 8b85412 | 2009-05-06 03:44:47 +0000 | [diff] [blame] | 39 | @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 40 |
|
| 41 | @echo Generate Loader Image ...
|
| 42 | @if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32
|
| 43 | @if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64
|
| 44 |
|
| 45 | :GENERATE_IMAGE_IA32
|
| 46 | @%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
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 47 | @copy /b %BOOTSECTOR_BIN_DIR%\Start.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr
|
| 48 | @copy /b %BOOTSECTOR_BIN_DIR%\Start16.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16
|
| 49 | @copy /b %BOOTSECTOR_BIN_DIR%\Start32.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 50 | @goto end
|
| 51 |
|
| 52 | :GENERATE_IMAGE_X64
|
| 53 | @%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
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 54 | @copy /b %BOOTSECTOR_BIN_DIR%\Start64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 55 | @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 56 | @copy /b %BOOTSECTOR_BIN_DIR%\St16_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 57 | @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
|
klu2 | e88f305 | 2009-06-22 03:01:53 +0000 | [diff] [blame] | 58 | @copy /b %BOOTSECTOR_BIN_DIR%\St32_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 59 | @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20
|
| 60 | @goto end
|
| 61 |
|
| 62 |
|
klu2 | c5dfb47 | 2008-05-08 06:22:31 +0000 | [diff] [blame] | 63 | :WrongArch
|
| 64 | @echo Error! Wrong architecture.
|
| 65 | @goto Help
|
| 66 |
|
| 67 | :Help
|
| 68 | @echo Usage: "PostBuild [IA32|X64]"
|
| 69 | :end |