]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - DuetPkg/PostBuild.bat
UefiCpuPkg/SmmCpuFeaturesLib: Split into two files
[mirror_edk2.git] / DuetPkg / PostBuild.bat
... / ...
CommitLineData
1@echo off\r
2@REM ## @file\r
3@REM #\r
4@REM # Post build script that will be automatically run after build.\r
5@REM #\r
6@REM # Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
7@REM #\r
8@REM # This program and the accompanying materials\r
9@REM # are licensed and made available under the terms and conditions of the BSD License\r
10@REM # which accompanies this distribution. The full text of the license may be found at\r
11@REM # http://opensource.org/licenses/bsd-license.php\r
12@REM # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13@REM # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14@REM #\r
15@REM #\r
16@REM ##\r
17\r
18set BASETOOLS_DIR=%EDK_TOOLS_BIN%\r
19set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin\r
20\r
21:SetDefault\r
22set TARGET_ARCH=\r
23set TARGET=\r
24set TOOL_CHAIN_TAG=\r
25\r
26:ParseParamsLoop\r
27if "%1"=="" goto EndPParseParamsLoop\r
28if /I "%1"=="-p" goto ParseParamsLoopNext\r
29if /I "%1"=="-a" set TARGET_ARCH=%2& goto ParseParamsLoopNext\r
30if /I "%1"=="-b" set TARGET=%2& goto ParseParamsLoopNext\r
31if /I "%1"=="-t" set TOOL_CHAIN_TAG=%2& goto ParseParamsLoopNext\r
32if /I "%1"=="-h" goto Help\r
33\r
34:ParseParamsLoopNext\r
35shift\r
36shift\r
37goto ParseParamsLoop\r
38\r
39:EndPParseParamsLoop\r
40if "%TARGET_ARCH%"=="" goto Help\r
41if "%TARGET%"=="" goto Help\r
42if "%TOOL_CHAIN_TAG%"=="" goto Help\r
43\r
44set PROCESSOR=%TARGET_ARCH%\r
45set BUILD_DIR=%WORKSPACE%\Build\DuetPkg%PROCESSOR%\%TARGET%_%TOOL_CHAIN_TAG%\r
46\r
47@REM Store environment variables used by CreateBootDisk.bat\r
48echo set TARGET=%TARGET%> %WORKSPACE%\DuetPkg\SetEnv_%PROCESSOR%.bat\r
49echo set TOOL_CHAIN_TAG=%TOOL_CHAIN_TAG%>> %WORKSPACE%\DuetPkg\SetEnv_%PROCESSOR%.bat\r
50\r
51echo Compressing DUETEFIMainFv.FV ...\r
52%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv\r
53\r
54echo Compressing DxeMain.efi ...\r
55%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi\r
56\r
57echo Compressing DxeIpl.efi ...\r
58%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi\r
59\r
60echo Generate Loader Image ...\r
61if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32\r
62if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64\r
63\r
64:GENERATE_IMAGE_IA32\r
65%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\r
66copy /b %BOOTSECTOR_BIN_DIR%\Start.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr\r
67copy /b %BOOTSECTOR_BIN_DIR%\Start16.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16\r
68copy /b %BOOTSECTOR_BIN_DIR%\Start32.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20\r
69goto end\r
70\r
71:GENERATE_IMAGE_X64\r
72%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\r
73copy /b %BOOTSECTOR_BIN_DIR%\Start64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure\r
74%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr\r
75copy /b %BOOTSECTOR_BIN_DIR%\St16_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure\r
76%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16\r
77copy /b %BOOTSECTOR_BIN_DIR%\St32_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure\r
78%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20\r
79goto end\r
80\r
81:Help\r
82echo Usage: This script will be run automatically after build.\r
83:end\r