]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/PostBuild.bat
Separate IA32/X64 architecture into two DSC file to avoid the their output mixup.
[mirror_edk2.git] / DuetPkg / PostBuild.bat
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 #
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 ##
18
19 @set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
20 @set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin
21 @set PROCESSOR=""
22
23 @if "%1"=="" goto NoArch
24 @if "%1"=="IA32" set PROCESSOR=IA32
25 @if "%1"=="X64" set PROCESSOR=X64
26 @if %PROCESSOR%=="" goto WrongArch
27
28 @set BUILD_DIR=%WORKSPACE%\Build\DuetPkg%PROCESSOR%\DEBUG_MYTOOLS
29
30
31 @echo Compressing DUETEFIMainFv.FV ...
32 @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv
33
34 @echo Compressing DxeMain.efi ...
35 @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi
36
37 @echo Compressing DxeIpl.efi ...
38 @%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi
39
40 @echo Generate Loader Image ...
41 @if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32
42 @if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64
43
44 :GENERATE_IMAGE_IA32
45 @%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
46 @copy /b %BOOTSECTOR_BIN_DIR%\Start.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr
47 @copy /b %BOOTSECTOR_BIN_DIR%\Start16.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16
48 @copy /b %BOOTSECTOR_BIN_DIR%\Start32.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20
49 @goto end
50
51 :GENERATE_IMAGE_X64
52 @%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
53 @copy /b %BOOTSECTOR_BIN_DIR%\Start64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure
54 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr
55 @copy /b %BOOTSECTOR_BIN_DIR%\St16_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure
56 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16
57 @copy /b %BOOTSECTOR_BIN_DIR%\St32_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure
58 @%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20
59 @goto end
60
61
62 :NoArch
63 @echo Error! Please specific the architecture.
64 @goto Help
65
66 :WrongArch
67 @echo Error! Wrong architecture.
68 @goto Help
69
70 :Help
71 @echo Usage: "PostBuild [IA32|X64]"
72 :end