]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | @REM\r |
2 | @REM Copyright (c) 2006, 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 | |
a29212b2 | 7 | @REM\r |
878ddf1f | 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 | |
10 | @REM\r | |
11 | \r | |
12 | @REM set following environment in this file or in command shell\r | |
9dac0c36 | 13 | @REM set JAVA_HOME=C:\Java\jdk1.5.0_06\r |
a29212b2 | 14 | @REM set ANT_HOME=C:\ANT\r |
15 | @REM set XMLBEANS_HOME=C:\xmlbeans\r | |
16 | @REM set CYGWIN_HOME=C:\cygwin\r | |
878ddf1f | 17 | \r |
2fcfed38 | 18 | @REM usage: edksetup.bat [Rebuild] [ForceRebuild] [Reconfig]\r |
302e0e4a | 19 | @REM if the argument, skip is present, only the paths and the\r |
20 | @REM test and set of environment settings are performed. \r | |
878ddf1f | 21 | \r |
22 | @REM ##############################################################\r | |
23 | @REM # You should not have to modify anything below this line\r | |
24 | @REM #\r | |
25 | \r | |
26 | @echo off\r | |
27 | \r | |
a29212b2 | 28 | @REM\r |
29 | @REM Check the required system environment variables\r | |
30 | @REM\r | |
31 | \r | |
878ddf1f | 32 | :check_vc\r |
a29212b2 | 33 | if defined VCINSTALLDIR goto check_cygwin\r |
878ddf1f | 34 | if defined VS71COMNTOOLS (\r |
b0108f04 | 35 | call "%VS71COMNTOOLS%\vsvars32.bat"\r |
878ddf1f | 36 | ) else (\r |
37 | echo.\r | |
38 | echo !!! WARNING !!!! Cannot find Visual Studio !!!\r | |
39 | echo.\r | |
40 | )\r | |
41 | \r | |
a29212b2 | 42 | :check_cygwin\r |
43 | if defined CYGWIN_HOME goto check_java\r | |
44 | if exist c:\cygwin (\r | |
45 | set CYGWIN_HOME=c:\cygwin\r | |
42b67fc4 | 46 | ) else (\r |
a29212b2 | 47 | echo.\r |
48 | echo !!! WARNING !!!! Not set CYGWIN_HOME, gcc build may not be used !!!\r | |
49 | echo.\r | |
878ddf1f | 50 | )\r |
51 | \r | |
a29212b2 | 52 | :check_java\r |
53 | if "%JAVA_HOME%"=="" goto no_jdk\r | |
54 | \r | |
55 | :check_ant\r | |
02996846 | 56 | if "%ANT_HOME%"=="" goto no_ant\r |
42b67fc4 | 57 | if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib\r |
58 | \r | |
a29212b2 | 59 | :check_xmlbeans\r |
02996846 | 60 | if "%XMLBEANS_HOME%"=="" goto no_xmlbeans\r |
a29212b2 | 61 | if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8\r |
878ddf1f | 62 | \r |
a29212b2 | 63 | @REM\r |
64 | @REM Set the WORKSPACE to the current working directory\r | |
65 | @REM\r | |
66 | set WORKSPACE=%CD%\r | |
878ddf1f | 67 | \r |
2da8968b | 68 | set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin\r |
6de5f959 | 69 | \r |
a9008cdd | 70 | if not defined ORIGINAL_CLASSPATH set ORIGINAL_CLASSPATH=%CLASSPATH%\r |
eb614e7e | 71 | set CLASSPATH=%ORIGINAL_CLASSPATH%\r |
72 | \r | |
6de5f959 | 73 | if defined WORKSPACE_TOOLS_PATH goto check_path\r |
74 | set PATH=%FRAMEWORK_TOOLS_PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin;%XMLBEANS_HOME%\bin;%PATH%\r | |
75 | set WORKSPACE_TOOLS_PATH=%FRAMEWORK_TOOLS_PATH%\r | |
11f009f1 | 76 | echo Setting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE\r |
6de5f959 | 77 | goto path_ok\r |
78 | \r | |
79 | :check_path\r | |
80 | if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok\r | |
81 | set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%\r | |
13681235 | 82 | set WORKSPACE_TOOLS_PATH=%WORKSPACE%\Tools\bin\r |
11f009f1 | 83 | echo Resetting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE\r |
6de5f959 | 84 | \r |
85 | :path_ok\r | |
86 | \r | |
d02920ea | 87 | @if /I "%1"=="-h" goto Usage\r |
88 | @if /I "%1"=="-help" goto Usage\r | |
89 | @if /I "%1"=="--help" goto Usage\r | |
90 | @if /I "%1"=="/h" goto Usage\r | |
91 | @if /I "%1"=="/?" goto Usage\r | |
92 | @if /I "%1"=="/help" goto Usage\r | |
93 | @if /I "%1"=="ForceRebuild" goto ForceBuild\r | |
94 | @if /I "%1"=="Reconfig" goto Reconfig\r | |
70edbc34 | 95 | \r |
96 | @IF NOT EXIST "Tools\Jars\Common.jar" goto NormalBuild\r | |
fb102512 | 97 | @IF NOT EXIST "Tools\Jars\PcdTools.jar" goto NormalBuild\r |
70edbc34 | 98 | @IF NOT EXIST "Tools\Jars\GenBuild.jar" goto NormalBuild\r |
99 | @IF NOT EXIST "Tools\Jars\SurfaceArea.jar" goto NormalBuild\r | |
100 | @IF NOT EXIST "Tools\Jars\cpptasks.jar" goto NormalBuild\r | |
101 | @IF NOT EXIST "Tools\Jars\frameworktasks.jar" goto NormalBuild\r | |
102 | @IF NOT EXIST "Tools\bin\FrameworkWizard.jar" goto NormalBuild\r | |
103 | @IF NOT EXIST "Tools\bin\CompressDll.dll" goto NormalBuild\r | |
104 | @IF NOT EXIST "Tools\bin\CompressDll.lib" goto NormalBuild\r | |
105 | @IF NOT EXIST "Tools\bin\CreateMtFile.exe" goto NormalBuild\r | |
106 | @IF NOT EXIST "Tools\bin\EfiCompress.exe" goto NormalBuild\r | |
107 | @IF NOT EXIST "Tools\bin\EfiRom.exe" goto NormalBuild\r | |
108 | @IF NOT EXIST "Tools\bin\FlashMap.exe" goto NormalBuild\r | |
109 | @IF NOT EXIST "Tools\bin\FwImage.exe" goto NormalBuild\r | |
110 | @IF NOT EXIST "Tools\bin\GenAcpiTable.exe" goto NormalBuild\r | |
111 | @IF NOT EXIST "Tools\bin\GenCRC32Section.exe" goto NormalBuild\r | |
112 | @IF NOT EXIST "Tools\bin\GenCapsuleHdr.exe" goto NormalBuild\r | |
113 | @IF NOT EXIST "Tools\bin\GenDepex.exe" goto NormalBuild\r | |
114 | @IF NOT EXIST "Tools\bin\GenFfsFile.exe" goto NormalBuild\r | |
115 | @IF NOT EXIST "Tools\bin\GenFvImage.exe" goto NormalBuild\r | |
70edbc34 | 116 | @IF NOT EXIST "Tools\bin\GenSection.exe" goto NormalBuild\r |
117 | @IF NOT EXIST "Tools\bin\GenTEImage.exe" goto NormalBuild\r | |
118 | @IF NOT EXIST "Tools\bin\GuidChk.exe" goto NormalBuild\r | |
119 | @IF NOT EXIST "Tools\bin\MakeDeps.exe" goto NormalBuild\r | |
120 | @IF NOT EXIST "Tools\bin\ModifyInf.exe" goto NormalBuild\r | |
121 | @IF NOT EXIST "Tools\bin\PeiRebase_Ia32.exe" goto NormalBuild\r | |
122 | @IF NOT EXIST "Tools\bin\PeiRebase_Ipf.exe" goto NormalBuild\r | |
123 | @IF NOT EXIST "Tools\bin\PeiRebase_X64.exe" goto NormalBuild\r | |
124 | @IF NOT EXIST "Tools\bin\SecApResetVectorFixup.exe" goto NormalBuild\r | |
125 | @IF NOT EXIST "Tools\bin\SecFixup.exe" goto NormalBuild\r | |
126 | @IF NOT EXIST "Tools\bin\SetStamp.exe" goto NormalBuild\r | |
127 | @IF NOT EXIST "Tools\bin\SplitFile.exe" goto NormalBuild\r | |
128 | @IF NOT EXIST "Tools\bin\StrGather.exe" goto NormalBuild\r | |
129 | @IF NOT EXIST "Tools\bin\Strip.exe" goto NormalBuild\r | |
130 | @IF NOT EXIST "Tools\bin\VfrCompile.exe" goto NormalBuild\r | |
131 | @IF NOT EXIST "Tools\bin\ZeroDebugData.exe" goto NormalBuild\r | |
132 | @IF NOT EXIST "Tools\bin\antlr.exe" goto NormalBuild\r | |
133 | @IF NOT EXIST "Tools\bin\dlg.exe" goto NormalBuild\r | |
134 | \r | |
d02920ea | 135 | @if /I "%1"=="Rebuild" goto NormalBuild\r |
11f009f1 | 136 | @if NOT "%1"=="" goto Usage\r |
70edbc34 | 137 | \r |
138 | goto skipbuild\r | |
139 | \r | |
3a9b7229 | 140 | :ForceBuild \r |
eb614e7e | 141 | call ant -f %WORKSPACE%\Tools\build.xml -noclasspath cleanall\r |
878ddf1f | 142 | \r |
70edbc34 | 143 | :NormalBuild\r |
a29212b2 | 144 | @REM\r |
145 | @REM Start to build the Framework Tools\r | |
146 | @REM\r | |
42b67fc4 | 147 | \r |
a29212b2 | 148 | echo.\r |
149 | echo Building the Framework Tools\r | |
150 | echo.\r | |
42b67fc4 | 151 | \r |
a29212b2 | 152 | @REM\r |
153 | @REM We are going to create the SurfaceArea.jar file first so that the other\r | |
154 | @REM Java Programs can use it.\r | |
155 | @REM It needs the XMLBEANS libraries in order to compile.\r | |
156 | @REM\r | |
d2f9b39f | 157 | set CLASSPATH=%XMLBEANS_HOME%\lib;%CLASSPATH%\r |
158 | set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%CLASSPATH%\r | |
159 | set CLASSPATH=%XMLBEANS_HOME%\lib\xbean.jar;%CLASSPATH%\r | |
160 | set CLASSPATH=%XMLBEANS_HOME%\lib\xbean_xpath.jar;%CLASSPATH%\r | |
161 | set CLASSPATH=%XMLBEANS_HOME%\lib\xmlpublic.jar;%CLASSPATH%\r | |
162 | set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8.jar;%CLASSPATH%\r | |
163 | set CLASSPATH=%XMLBEANS_HOME%\lib\resolver.jar;%CLASSPATH%\r | |
70edbc34 | 164 | \r |
a29212b2 | 165 | call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea\r |
878ddf1f | 166 | \r |
a29212b2 | 167 | @REM\r |
878ddf1f | 168 | @REM Now we can make the other Java Programs\r |
53cef58a | 169 | @REM All of the remaining Java Programs require the SurfaceArea library to compile\r |
a29212b2 | 170 | @REM\r |
d2f9b39f | 171 | set CLASSPATH=%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%CLASSPATH%\r |
b9546cc8 | 172 | \r |
a29212b2 | 173 | call ant -f %WORKSPACE%\Tools\build.xml JavaCode\r |
878ddf1f | 174 | \r |
a29212b2 | 175 | @REM\r |
176 | @REM We have all of the Java Programs and add-in classes created, so we can start\r | |
177 | @REM using the cpp-tasks to create our tools\r | |
178 | @REM\r | |
d2f9b39f | 179 | set CLASSPATH=%WORKSPACE%\Tools\Jars\Common.jar;%CLASSPATH%\r |
180 | set CLASSPATH=%WORKSPACE%\Tools\Jars\PcdTools.jar;%CLASSPATH%\r | |
181 | set CLASSPATH=%WORKSPACE%\Tools\Jars\GenBuild.jar;%CLASSPATH%\r | |
182 | set CLASSPATH=%WORKSPACE%\Tools\Jars\cpptasks.jar;%CLASSPATH%\r | |
183 | set CLASSPATH=%WORKSPACE%\Tools\Jars\frameworktasks.jar;%CLASSPATH%\r | |
184 | set CLASSPATH=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar;%CLASSPATH%\r | |
185 | set CLASSPATH=%WORKSPACE%\Tools\Bin\MigrationTools.jar;%CLASSPATH%\r | |
878ddf1f | 186 | \r |
a29212b2 | 187 | call ant -f %WORKSPACE%\Tools\build.xml C_Code\r |
878ddf1f | 188 | \r |
a29212b2 | 189 | @REM\r |
190 | @REM Done!!!\r | |
191 | @REM\r | |
878ddf1f | 192 | goto end\r |
193 | \r | |
194 | :no_jdk\r | |
195 | echo.\r | |
02996846 | 196 | echo !!! Please install Java, and set JAVA_HOME !!!\r |
197 | echo.\r | |
a29212b2 | 198 | goto end\r |
02996846 | 199 | \r |
200 | :no_ant\r | |
201 | echo.\r | |
202 | echo !!! Please install Apache Ant, and set ANT_HOME !!!\r | |
203 | echo.\r | |
a29212b2 | 204 | goto end\r |
02996846 | 205 | \r |
42b67fc4 | 206 | :no_antcontrib\r |
207 | echo.\r | |
208 | echo !!! Please install Ant-contrib to ANT_HOME !!!\r | |
209 | echo.\r | |
a29212b2 | 210 | goto end\r |
42b67fc4 | 211 | \r |
02996846 | 212 | :no_xmlbeans\r |
213 | echo.\r | |
214 | echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!\r | |
878ddf1f | 215 | echo.\r |
a29212b2 | 216 | goto end\r |
878ddf1f | 217 | \r |
42b67fc4 | 218 | :no_saxon8\r |
219 | echo.\r | |
220 | echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!\r | |
221 | echo.\r | |
a29212b2 | 222 | goto end\r |
42b67fc4 | 223 | \r |
302e0e4a | 224 | :skipbuild\r |
225 | @REM\r | |
226 | @REM This just sets up the CLASSPATH, the rest of the environment should have been set already.\r | |
227 | @REM\r | |
302e0e4a | 228 | echo.\r |
6de5f959 | 229 | echo WORKSPACE: %WORKSPACE%\r |
302e0e4a | 230 | echo JAVA_HOME: %JAVA_HOME%\r |
231 | echo ANT_HOME: %ANT_HOME%\r | |
232 | echo XMLBEANS_HOME: %XMLBEANS_HOME%\r | |
233 | echo CYGWIN_HOME: %CYGWIN_HOME%\r | |
302e0e4a | 234 | echo PATH: %PATH%\r |
235 | echo.\r | |
d2f9b39f | 236 | set CLASSPATH=%XMLBEANS_HOME%\lib;%CLASSPATH%\r |
237 | set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%CLASSPATH%\r | |
238 | set CLASSPATH=%XMLBEANS_HOME%\lib\xbean.jar;%CLASSPATH%\r | |
239 | set CLASSPATH=%XMLBEANS_HOME%\lib\xbean_xpath.jar;%CLASSPATH%\r | |
240 | set CLASSPATH=%XMLBEANS_HOME%\lib\xmlpublic.jar;%CLASSPATH%\r | |
241 | set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8.jar;%CLASSPATH%\r | |
242 | set CLASSPATH=%XMLBEANS_HOME%\lib\resolver.jar;%CLASSPATH%\r | |
243 | set CLASSPATH=%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%CLASSPATH%\r | |
244 | set CLASSPATH=%WORKSPACE%\Tools\Jars\Common.jar;%CLASSPATH%\r | |
245 | set CLASSPATH=%WORKSPACE%\Tools\Jars\PcdTools.jar;%CLASSPATH%\r | |
246 | set CLASSPATH=%WORKSPACE%\Tools\Jars\GenBuild.jar;%CLASSPATH%\r | |
247 | set CLASSPATH=%WORKSPACE%\Tools\Jars\cpptasks.jar;%CLASSPATH%\r | |
248 | set CLASSPATH=%WORKSPACE%\Tools\Jars\frameworktasks.jar;%CLASSPATH%\r | |
249 | set CLASSPATH=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar;%CLASSPATH%\r | |
250 | set CLASSPATH=%WORKSPACE%\Tools\Bin\MigrationTools.jar;%CLASSPATH%\r | |
11f009f1 | 251 | echo CLASSPATH: %CLASSPATH%\r |
302e0e4a | 252 | goto end\r |
253 | \r | |
2fcfed38 | 254 | :Reconfig\r |
255 | @REM\r | |
256 | @REM Reinstall all config files\r | |
257 | @REM\r | |
258 | call ant -f %WORKSPACE%\Tools\build.xml reconfig\r | |
259 | goto end\r | |
260 | \r | |
70edbc34 | 261 | :Usage\r |
262 | echo.\r | |
2fcfed38 | 263 | echo Usage: %0 [Rebuild] [ForceRebuild] [Reconfig]\r |
264 | echo Rebuild: Incremental build, only build those updated tools; \r | |
265 | echo ForceRebuild: Rebuild all tools neither updated or not; \r | |
266 | echo Reconfig: Reinstall target.txt, tools_def.txt, FrameworkDatabase.db. \r | |
267 | echo.\r | |
268 | echo Note that target.template, tools_def.template, FrameworkDatabase.template will be\r | |
269 | echo only copied to target.txt, tools_def.txt, FrameworkDatabase.db respectively if they\r | |
270 | echo are not existed. Using option [Reconfig] to do the force copy. \r | |
70edbc34 | 271 | echo.\r |
272 | \r | |
878ddf1f | 273 | :end\r |
274 | @echo on\r | |
275 | \r |