]> git.proxmox.com Git - mirror_edk2.git/blame - DuetPkg/PostBuild.bat
DuetPkg: Use 'echo off' in BATCH script files
[mirror_edk2.git] / DuetPkg / PostBuild.bat
CommitLineData
ea4511d1 1@echo off\r
e4c0074b 2@REM ## @file\r
3@REM #\r
24476311 4@REM # Currently, Build system does not provide post build mechanism for module\r
e4c0074b 5@REM # and platform building, so just use a bat file to do post build commands.\r
6@REM # Originally, following post building command is for EfiLoader module.\r
7@REM #\r
7708d081 8@REM # Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
e4c0074b 9@REM #\r
10@REM # This program and the accompanying materials\r
11@REM # are licensed and made available under the terms and conditions of the BSD License\r
12@REM # which accompanies this distribution. The full text of the license may be found at\r
13@REM # http://opensource.org/licenses/bsd-license.php\r
14@REM # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15@REM # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16@REM #\r
17@REM #\r
18@REM ##\r
6d3f7723 19\r
ea4511d1
HW
20set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32\r
21set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin\r
22set PROCESSOR=""\r
23call %WORKSPACE%\DuetPkg\GetVariables.bat\r
c5dfb477 24\r
ea4511d1
HW
25if NOT "%1"=="" @set TARGET_ARCH=%1\r
26if "%TARGET_ARCH%"=="IA32" set PROCESSOR=IA32\r
27if "%TARGET_ARCH%"=="X64" set PROCESSOR=X64\r
28if %PROCESSOR%=="" goto WrongArch\r
c5dfb477 29\r
ea4511d1 30set BUILD_DIR=%WORKSPACE%\Build\DuetPkg%PROCESSOR%\%TARGET%_%TOOL_CHAIN_TAG%\r
ab9cb4b1 31\r
32\r
ea4511d1
HW
33echo Compressing DUETEFIMainFv.FV ...\r
34%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv\r
c5dfb477 35\r
ea4511d1
HW
36echo Compressing DxeMain.efi ...\r
37%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeCore.efi\r
c5dfb477 38\r
ea4511d1
HW
39echo Compressing DxeIpl.efi ...\r
40%BASETOOLS_DIR%\LzmaCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi\r
c5dfb477 41\r
ea4511d1
HW
42echo Generate Loader Image ...\r
43if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32\r
44if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64\r
c5dfb477 45\r
46:GENERATE_IMAGE_IA32\r
ea4511d1
HW
47%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
48copy /b %BOOTSECTOR_BIN_DIR%\Start.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr\r
49copy /b %BOOTSECTOR_BIN_DIR%\Start16.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16\r
50copy /b %BOOTSECTOR_BIN_DIR%\Start32.com+%BOOTSECTOR_BIN_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20\r
51goto end\r
c5dfb477 52\r
53:GENERATE_IMAGE_X64\r
ea4511d1
HW
54%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
55copy /b %BOOTSECTOR_BIN_DIR%\Start64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure\r
56%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr\r
57copy /b %BOOTSECTOR_BIN_DIR%\St16_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure\r
58%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16\r
59copy /b %BOOTSECTOR_BIN_DIR%\St32_64.com+%BOOTSECTOR_BIN_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure\r
60%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20\r
61goto end\r
c5dfb477 62\r
63\r
c5dfb477 64:WrongArch\r
ea4511d1
HW
65echo Error! Wrong architecture.\r
66goto Help\r
c5dfb477 67\r
68:Help\r
ea4511d1 69echo Usage: "PostBuild [IA32|X64]"\r
c5dfb477 70:end