2 @REM Copyright
(c
) 2006, Intel Corporation
3 @REM All rights reserved. This program and the accompanying materials
4 @REM are licensed and made available under the terms and conditions of the BSD License
5 @REM which accompanies this distribution. The full text of the license may be found at
6 @REM http
://opensource.org
/licenses
/bsd
-license.php
8 @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN
"AS IS" BASIS
,
9 @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND
, EITHER EXPRESS OR IMPLIED.
12 @REM
set following environment in this file or in
command shell
13 @REM
set JAVA_HOME
=C
:\Java\jdk1.5
.0_06
14 @REM
set ANT_HOME
=C
:\ANT
15 @REM
set XMLBEANS_HOME
=C
:\xmlbeans
16 @REM
set CYGWIN_HOME
=C
:\cygwin
18 @REM usage
: edksetup.bat
[Rebuild
] [ForceRebuild
] [Reconfig
]
19 @REM
if the argument
, skip is present
, only the paths and the
20 @REM test and
set of environment settings are performed.
22 @REM ##############################################################
23 @REM # You should
not have to modify anything below this line
29 @REM
Set the WORKSPACE to the current working directory
33 @
if /I
"%1"=="NewBuild" goto NewBuild
37 @REM Check the required system environment variables
41 if defined VCINSTALLDIR
goto check_cygwin
42 if defined VS71COMNTOOLS
(
43 call "%VS71COMNTOOLS%\vsvars32.bat"
46 echo !!! WARNING
!!!! Cannot
find Visual Studio
!!!
51 if defined CYGWIN_HOME
goto check_java
53 set CYGWIN_HOME
=c
:\cygwin
56 echo !!! WARNING
!!!! Not set CYGWIN_HOME
, gcc build may
not be used
!!!
61 if "%JAVA_HOME%"=="" goto no_jdk
64 if "%ANT_HOME%"=="" goto no_ant
65 if not exist %ANT_HOME%\lib
\ant
-contrib.jar
goto no_antcontrib
68 if "%XMLBEANS_HOME%"=="" goto no_xmlbeans
69 if not exist %XMLBEANS_HOME%\lib\saxon8.jar
goto no_saxon8
71 set FRAMEWORK_TOOLS_PATH
=%WORKSPACE%\Tools
\bin
73 if not defined ORIGINAL_CLASSPATH
set ORIGINAL_CLASSPATH
=%CLASSPATH%
74 set CLASSPATH
=%ORIGINAL_CLASSPATH%
76 if defined WORKSPACE_TOOLS_PATH
goto check_path
77 set PATH=%FRAMEWORK_TOOLS_PATH%;%JAVA_HOME%\bin
;%ANT_HOME%\bin
;%XMLBEANS_HOME%\bin
;%PATH%
78 set WORKSPACE_TOOLS_PATH
=%FRAMEWORK_TOOLS_PATH%
79 echo Setting the
PATH variable to include the FRAMEWORK_TOOLS_PATH
for this WORKSPACE
83 if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok
84 set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%
85 set WORKSPACE_TOOLS_PATH
=%WORKSPACE%\Tools
\bin
86 echo Resetting the
PATH variable to include the FRAMEWORK_TOOLS_PATH
for this WORKSPACE
90 @
if /I
"%1"=="-h" goto Usage
91 @
if /I
"%1"=="-help" goto Usage
92 @
if /I
"%1"=="--help" goto Usage
93 @
if /I
"%1"=="/h" goto Usage
94 @
if /I
"%1"=="/?" goto Usage
95 @
if /I
"%1"=="/help" goto Usage
96 @
if /I
"%1"=="ForceRebuild" goto ForceBuild
97 @
if /I
"%1"=="Reconfig" goto Reconfig
99 @
IF NOT EXIST "Tools\Jars\Common.jar" goto NormalBuild
100 @
IF NOT EXIST "Tools\Jars\PcdTools.jar" goto NormalBuild
101 @
IF NOT EXIST "Tools\Jars\GenBuild.jar" goto NormalBuild
102 @
IF NOT EXIST "Tools\Jars\SurfaceArea.jar" goto NormalBuild
103 @
IF NOT EXIST "Tools\Jars\cpptasks.jar" goto NormalBuild
104 @
IF NOT EXIST "Tools\Jars\frameworktasks.jar" goto NormalBuild
105 @
IF NOT EXIST "Tools\bin\FrameworkWizard.jar" goto NormalBuild
106 @
IF NOT EXIST "Tools\bin\CompressDll.dll" goto NormalBuild
107 @
IF NOT EXIST "Tools\bin\CompressDll.lib" goto NormalBuild
108 @
IF NOT EXIST "Tools\bin\CreateMtFile.exe" goto NormalBuild
109 @
IF NOT EXIST "Tools\bin\EfiCompress.exe" goto NormalBuild
110 @
IF NOT EXIST "Tools\bin\EfiRom.exe" goto NormalBuild
111 @
IF NOT EXIST "Tools\bin\FlashMap.exe" goto NormalBuild
112 @
IF NOT EXIST "Tools\bin\FwImage.exe" goto NormalBuild
113 @
IF NOT EXIST "Tools\bin\GenAcpiTable.exe" goto NormalBuild
114 @
IF NOT EXIST "Tools\bin\GenCRC32Section.exe" goto NormalBuild
115 @
IF NOT EXIST "Tools\bin\GenCapsuleHdr.exe" goto NormalBuild
116 @
IF NOT EXIST "Tools\bin\GenDepex.exe" goto NormalBuild
117 @
IF NOT EXIST "Tools\bin\GenFfsFile.exe" goto NormalBuild
118 @
IF NOT EXIST "Tools\bin\GenFvImage.exe" goto NormalBuild
119 @
IF NOT EXIST "Tools\bin\GenSection.exe" goto NormalBuild
120 @
IF NOT EXIST "Tools\bin\GenTEImage.exe" goto NormalBuild
121 @
IF NOT EXIST "Tools\bin\GuidChk.exe" goto NormalBuild
122 @
IF NOT EXIST "Tools\bin\MakeDeps.exe" goto NormalBuild
123 @
IF NOT EXIST "Tools\bin\ModifyInf.exe" goto NormalBuild
124 @
IF NOT EXIST "Tools\bin\PeiRebase_Ia32.exe" goto NormalBuild
125 @
IF NOT EXIST "Tools\bin\PeiRebase_Ipf.exe" goto NormalBuild
126 @
IF NOT EXIST "Tools\bin\PeiRebase_X64.exe" goto NormalBuild
127 @
IF NOT EXIST "Tools\bin\SecApResetVectorFixup.exe" goto NormalBuild
128 @
IF NOT EXIST "Tools\bin\SecFixup.exe" goto NormalBuild
129 @
IF NOT EXIST "Tools\bin\SetStamp.exe" goto NormalBuild
130 @
IF NOT EXIST "Tools\bin\SplitFile.exe" goto NormalBuild
131 @
IF NOT EXIST "Tools\bin\StrGather.exe" goto NormalBuild
132 @
IF NOT EXIST "Tools\bin\Strip.exe" goto NormalBuild
133 @
IF NOT EXIST "Tools\bin\VfrCompile.exe" goto NormalBuild
134 @
IF NOT EXIST "Tools\bin\ZeroDebugData.exe" goto NormalBuild
135 @
IF NOT EXIST "Tools\bin\antlr.exe" goto NormalBuild
136 @
IF NOT EXIST "Tools\bin\dlg.exe" goto NormalBuild
138 @
if /I
"%1"=="Rebuild" goto NormalBuild
139 @
if NOT "%1"=="" goto Usage
144 call ant
-f
%WORKSPACE%\Tools
\build.xml
-noclasspath cleanall
148 @REM
Start to build the Framework Tools
152 echo Building the Framework Tools
156 @REM We are going to create the SurfaceArea.jar file first so that the other
157 @REM Java Programs can
use it.
158 @REM It needs the XMLBEANS libraries in order to compile.
160 set CLASSPATH
=%XMLBEANS_HOME%\lib
;%CLASSPATH%
161 set CLASSPATH
=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar
;%CLASSPATH%
162 set CLASSPATH
=%XMLBEANS_HOME%\lib
\xbean.jar
;%CLASSPATH%
163 set CLASSPATH
=%XMLBEANS_HOME%\lib
\xbean_xpath.jar
;%CLASSPATH%
164 set CLASSPATH
=%XMLBEANS_HOME%\lib\xmlpublic.jar
;%CLASSPATH%
165 set CLASSPATH
=%XMLBEANS_HOME%\lib\saxon8.jar
;%CLASSPATH%
166 set CLASSPATH
=%XMLBEANS_HOME%\lib
\resolver.jar
;%CLASSPATH%
168 call ant
-f
%WORKSPACE%\Tools
\build.xml SurfaceArea
171 @REM Now we can make the other Java Programs
172 @REM All of the remaining Java Programs require the SurfaceArea library to compile
174 set CLASSPATH
=%WORKSPACE%\Tools\Jars\SurfaceArea.jar
;%CLASSPATH%
176 call ant
-f
%WORKSPACE%\Tools
\build.xml JavaCode
179 @REM We have all of the Java Programs and add
-in classes created
, so we can
start
180 @REM using the cpp
-tasks to create our tools
182 set CLASSPATH
=%WORKSPACE%\Tools\Jars\Common.jar
;%CLASSPATH%
183 set CLASSPATH
=%WORKSPACE%\Tools\Jars\PcdTools.jar
;%CLASSPATH%
184 set CLASSPATH
=%WORKSPACE%\Tools\Jars\GenBuild.jar
;%CLASSPATH%
185 set CLASSPATH
=%WORKSPACE%\Tools\Jars\cpptasks.jar
;%CLASSPATH%
186 set CLASSPATH
=%WORKSPACE%\Tools\Jars
\frameworktasks.jar
;%CLASSPATH%
187 set CLASSPATH
=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar
;%CLASSPATH%
188 set CLASSPATH
=%WORKSPACE%\Tools\Bin\MigrationTools.jar
;%CLASSPATH%
190 call ant
-f
%WORKSPACE%\Tools
\build.xml C_Code
199 echo !!! Please install Java
, and
set JAVA_HOME
!!!
205 echo !!! Please install Apache Ant
, and
set ANT_HOME
!!!
211 echo !!! Please install Ant
-contrib to ANT_HOME
!!!
217 echo !!! Please install XML Beans
, and
set XMLBEANS_HOME
!!!
223 echo !!! Please
copy saxon8.jar file to XMLBEANS_HOME\lib
!!!
229 @REM This just sets up the CLASSPATH
, the rest of the environment should have been
set already.
232 echo WORKSPACE
: %WORKSPACE%
233 echo JAVA_HOME
: %JAVA_HOME%
234 echo ANT_HOME
: %ANT_HOME%
235 echo XMLBEANS_HOME
: %XMLBEANS_HOME%
236 echo CYGWIN_HOME
: %CYGWIN_HOME%
239 set CLASSPATH
=%XMLBEANS_HOME%\lib
;%CLASSPATH%
240 set CLASSPATH
=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar
;%CLASSPATH%
241 set CLASSPATH
=%XMLBEANS_HOME%\lib
\xbean.jar
;%CLASSPATH%
242 set CLASSPATH
=%XMLBEANS_HOME%\lib
\xbean_xpath.jar
;%CLASSPATH%
243 set CLASSPATH
=%XMLBEANS_HOME%\lib\xmlpublic.jar
;%CLASSPATH%
244 set CLASSPATH
=%XMLBEANS_HOME%\lib\saxon8.jar
;%CLASSPATH%
245 set CLASSPATH
=%XMLBEANS_HOME%\lib\saxon8
-dom.jar
;%CLASSPATH%
246 set CLASSPATH
=%XMLBEANS_HOME%\lib\saxon8
-xpath.jar
;%CLASSPATH%
247 set CLASSPATH
=%XMLBEANS_HOME%\lib
\resolver.jar
;%CLASSPATH%
248 set CLASSPATH
=%WORKSPACE%\Tools\Jars\SurfaceArea.jar
;%CLASSPATH%
249 set CLASSPATH
=%WORKSPACE%\Tools\Jars\Common.jar
;%CLASSPATH%
250 set CLASSPATH
=%WORKSPACE%\Tools\Jars\PcdTools.jar
;%CLASSPATH%
251 set CLASSPATH
=%WORKSPACE%\Tools\Jars\GenBuild.jar
;%CLASSPATH%
252 set CLASSPATH
=%WORKSPACE%\Tools\Jars\cpptasks.jar
;%CLASSPATH%
253 set CLASSPATH
=%WORKSPACE%\Tools\Jars
\frameworktasks.jar
;%CLASSPATH%
254 set CLASSPATH
=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar
;%CLASSPATH%
255 set CLASSPATH
=%WORKSPACE%\Tools\Bin\MigrationTools.jar
;%CLASSPATH%
256 echo CLASSPATH
: %CLASSPATH%
261 @REM Reinstall all config
files
263 call ant
-f
%WORKSPACE%\Tools
\build.xml reconfig
268 echo Usage
: %0 [Rebuild
] [ForceRebuild
] [Reconfig
]
269 echo Rebuild
: Incremental build
, only build those updated tools
;
270 echo ForceRebuild
: Rebuild all tools neither updated or
not;
271 echo Reconfig
: Reinstall target.txt
, tools_def.txt
, FrameworkDatabase.db.
273 echo Note that target.template
, tools_def.template
, FrameworkDatabase.template will be
274 echo only copied to target.txt
, tools_def.txt
, FrameworkDatabase.db respectively
if they
275 echo are
not existed. Using option
[Reconfig
] to
do the force
copy.
279 @
IF NOT EXIST "BaseTools\toolsetup.bat" goto AntBuild
280 @
set EDK_TOOLS_PATH
=%WORKSPACE%\BaseTools
281 @
call BaseTools
\toolsetup.bat