2 @REM Copyright (c) 2007, Intel Corporation
\r
3 @REM All rights reserved. This program and the accompanying materials
\r
4 @REM are licensed and made available under the terms and conditions of the BSD License
\r
5 @REM which accompanies this distribution. The full text of the license may be found at
\r
6 @REM http://opensource.org/licenses/bsd-license.php
\r
8 @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
\r
9 @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
\r
14 REM ##############################################################
\r
15 REM # You should not have to modify anything below this line
\r
19 REM check the EDK_TOOLS_PATH
\r
22 if defined VCINSTALLDIR goto check_path
\r
23 if defined VS71COMNTOOLS (
\r
24 call "%VS71COMNTOOLS%\vsvars32.bat"
\r
27 echo !!! WARNING !!!! Cannot find Visual Studio !!!
\r
32 if not defined PYTHON_FREEZER_PATH set PYTHON_FREEZER_PATH=C:\cx_Freeze
\r
33 if not exist %PYTHON_FREEZER_PATH% goto no_freezer_path
\r
37 set BASE_TOOLS_PATH=%CD%
\r
40 if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%BASE_TOOLS_PATH%
\r
41 mkdir %EDK_TOOLS_PATH%\Bin\Win32
\r
45 if /I "%1"=="-h" goto Usage
\r
46 if /I "%1"=="-help" goto Usage
\r
47 if /I "%1"=="--help" goto Usage
\r
48 if /I "%1"=="/h" goto Usage
\r
49 if /I "%1"=="/?" goto Usage
\r
50 if /I "%1"=="/help" goto Usage
\r
51 if /I "%1"=="build" goto build
\r
52 if /I "%1"=="rebuild" goto rebuild
\r
53 if NOT "%1"=="" goto Usage
\r
55 if not defined ORIGINAL_PATH set ORIGINAL_PATH=%PATH%
\r
56 set PATH=%EDK_TOOLS_PATH%\Bin\Win32;%EDK_TOOLS_PATH%\Bin;%ORIGINAL_PATH%
\r
58 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\BootSectImage.exe" goto build
\r
59 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\build.exe" goto build
\r
60 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\EfiLdrImage.exe" goto build
\r
61 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\EfiRom.exe" goto build
\r
62 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenBootSector.exe" goto build
\r
63 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFds.exe" goto build
\r
64 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFfs.exe" goto build
\r
65 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFv.exe" goto build
\r
66 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFw.exe" goto build
\r
67 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenPage.exe" goto build
\r
68 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenSec.exe" goto build
\r
69 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenVtf.exe" goto build
\r
70 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\MigrationMsa2Inf.exe" goto build
\r
71 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Split.exe" goto build
\r
72 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\TargetTool.exe" goto build
\r
73 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\TianoCompress.exe" goto build
\r
74 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Trim.exe" goto build
\r
75 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\VfrCompile.exe" goto build
\r
82 cd %BASE_TOOLS_PATH%\Source\C
\r
84 del /f /q %BASE_TOOLS_PATH%\Bin\Win32\*.*
\r
89 REM Start to build the Framework Tools
\r
93 echo Building the C Tools
\r
97 cd %BASE_TOOLS_PATH%\Source\C
\r
102 echo Building the Python Tools
\r
105 set PYTHON_PATH=%BASE_TOOLS_PATH%\Source\Python
\r
108 echo Generating build.exe
\r
109 cd %BASE_TOOLS_PATH%\Source\Python\build
\r
110 %PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 build.py > NUL
\r
112 echo Generating GenFds.exe
\r
113 cd %BASE_TOOLS_PATH%\Source\Python\GenFds
\r
114 %PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 GenFds.py > NUL
\r
116 echo Generating Trim.exe
\r
117 cd %BASE_TOOLS_PATH%\Source\Python\Trim
\r
118 %PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 Trim.py > NUL
\r
120 echo Generating MigrationMsa2Inf.exe
\r
121 cd %BASE_TOOLS_PATH%\Source\Python\MigrationMsa2Inf
\r
122 %PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 MigrationMsa2Inf.py > NUL
\r
130 echo !!!WARNING!!! No cx_Freeze path found. Please install cx_Freeze and set PYTHON_FREEZER_PATH.
\r
136 echo !!!WARNING!!! No tools path found. Please check and set EDK_TOOLS_PATH.
\r
142 echo Usage: %0 [build] [rebuild]
\r
143 echo build: Incremental build, only build those updated tools;
\r
144 echo rebuild: Rebuild all tools neither updated or not;
\r