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
43 if not defined ORIGINAL_PATH set ORIGINAL_PATH=%PATH%
\r
44 set PATH=%EDK_TOOLS_PATH%\Bin\Win32;%EDK_TOOLS_PATH%\Bin;%ORIGINAL_PATH%
\r
48 if /I "%1"=="-h" goto Usage
\r
49 if /I "%1"=="-help" goto Usage
\r
50 if /I "%1"=="--help" goto Usage
\r
51 if /I "%1"=="/h" goto Usage
\r
52 if /I "%1"=="/?" goto Usage
\r
53 if /I "%1"=="/help" goto Usage
\r
54 if /I "%1"=="build" goto build
\r
55 if /I "%1"=="rebuild" goto rebuild
\r
56 if NOT "%1"=="" goto Usage
\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
76 IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Fpd2Dsc.exe" goto build
\r
83 cd %BASE_TOOLS_PATH%\Source\C
\r
85 del /f /q %BASE_TOOLS_PATH%\Bin\Win32\*.*
\r
90 REM Start to build the Framework Tools
\r
94 echo Building the C Tools
\r
98 cd %BASE_TOOLS_PATH%\Source\C
\r
103 echo Building the Python Tools
\r
106 set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python
\r
109 echo Generating build.exe
\r
110 cd %BASE_TOOLS_PATH%\Source\Python\build
\r
111 %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
113 echo Generating GenFds.exe
\r
114 cd %BASE_TOOLS_PATH%\Source\Python\GenFds
\r
115 %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
117 echo Generating Trim.exe
\r
118 cd %BASE_TOOLS_PATH%\Source\Python\Trim
\r
119 %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
121 echo Generating MigrationMsa2Inf.exe
\r
122 cd %BASE_TOOLS_PATH%\Source\Python\MigrationMsa2Inf
\r
123 %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
125 echo Generating Fpd2Dsc.exe
\r
126 cd %BASE_TOOLS_PATH%\Source\Python\Fpd2Dsc
\r
127 %PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 Fpd2Dsc.py > NUL
\r
135 echo !!!WARNING!!! No cx_Freeze path found. Please install cx_Freeze and set PYTHON_FREEZER_PATH.
\r
141 echo !!!WARNING!!! No tools path found. Please check and set EDK_TOOLS_PATH.
\r
147 echo Usage: %0 [build] [rebuild]
\r
148 echo build: Incremental build, only build those updated tools;
\r
149 echo rebuild: Rebuild all tools neither updated or not;
\r