blob: 8a6aeb356c8e308b73731c4e07a45c85b2fea261 [file] [log] [blame]
bbahnsen878ddf12006-04-21 22:54:32 +00001@REM
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
yshi8a29212b2006-05-09 06:11:05 +00007@REM
bbahnsen878ddf12006-04-21 22:54:32 +00008@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.
10@REM
11
12@REM set following environment in this file or in command shell
lhauch9dac0c32006-10-10 23:03:33 +000013@REM set JAVA_HOME=C:\Java\jdk1.5.0_06
yshi8a29212b2006-05-09 06:11:05 +000014@REM set ANT_HOME=C:\ANT
15@REM set XMLBEANS_HOME=C:\xmlbeans
16@REM set CYGWIN_HOME=C:\cygwin
bbahnsen878ddf12006-04-21 22:54:32 +000017
lhauch11f009f2006-07-24 16:03:47 +000018@REM usage: edksetup.bat [Rebuild] [ForceRebuild]
lhauch302e0e42006-06-09 15:26:28 +000019@REM if the argument, skip is present, only the paths and the
20@REM test and set of environment settings are performed.
bbahnsen878ddf12006-04-21 22:54:32 +000021
22@REM ##############################################################
23@REM # You should not have to modify anything below this line
24@REM #
25
26@echo off
27
yshi8a29212b2006-05-09 06:11:05 +000028@REM
29@REM Check the required system environment variables
30@REM
31
bbahnsen878ddf12006-04-21 22:54:32 +000032:check_vc
yshi8a29212b2006-05-09 06:11:05 +000033if defined VCINSTALLDIR goto check_cygwin
bbahnsen878ddf12006-04-21 22:54:32 +000034if defined VS71COMNTOOLS (
wuyizhongb0108f02006-07-19 06:10:12 +000035 call "%VS71COMNTOOLS%\vsvars32.bat"
bbahnsen878ddf12006-04-21 22:54:32 +000036) else (
37 echo.
38 echo !!! WARNING !!!! Cannot find Visual Studio !!!
39 echo.
40)
41
yshi8a29212b2006-05-09 06:11:05 +000042:check_cygwin
43if defined CYGWIN_HOME goto check_java
44if exist c:\cygwin (
45 set CYGWIN_HOME=c:\cygwin
lhauch42b67fc2006-04-25 19:59:29 +000046) else (
yshi8a29212b2006-05-09 06:11:05 +000047 echo.
48 echo !!! WARNING !!!! Not set CYGWIN_HOME, gcc build may not be used !!!
49 echo.
bbahnsen878ddf12006-04-21 22:54:32 +000050)
51
yshi8a29212b2006-05-09 06:11:05 +000052:check_java
53if "%JAVA_HOME%"=="" goto no_jdk
54
55:check_ant
bbahnsen02996842006-04-21 23:36:37 +000056if "%ANT_HOME%"=="" goto no_ant
lhauch42b67fc2006-04-25 19:59:29 +000057if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib
58
yshi8a29212b2006-05-09 06:11:05 +000059:check_xmlbeans
bbahnsen02996842006-04-21 23:36:37 +000060if "%XMLBEANS_HOME%"=="" goto no_xmlbeans
lhauch42b67fc2006-04-25 19:59:29 +000061if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8
62
yshi8a29212b2006-05-09 06:11:05 +000063@REM
64@REM Set the WORKSPACE to the current working directory
65@REM
66set WORKSPACE=%CD%
lhauch42b67fc2006-04-25 19:59:29 +000067
qouyang2da89682006-06-08 09:11:56 +000068set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin
lhauch6de5f952006-06-09 18:07:09 +000069
jwang36eb614e72006-10-17 06:24:21 +000070if not defined ORIGINAL_CLASSPATH set ORIGINAL_CLASSPATH=%CLASSPATH%
71set CLASSPATH=%ORIGINAL_CLASSPATH%
72
lhauch6de5f952006-06-09 18:07:09 +000073if defined WORKSPACE_TOOLS_PATH goto check_path
74set PATH=%FRAMEWORK_TOOLS_PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin;%XMLBEANS_HOME%\bin;%PATH%
75set WORKSPACE_TOOLS_PATH=%FRAMEWORK_TOOLS_PATH%
lhauch11f009f2006-07-24 16:03:47 +000076echo Setting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE
lhauch6de5f952006-06-09 18:07:09 +000077goto path_ok
78
79:check_path
80if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok
81set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%
lhauch13681232006-08-08 19:48:49 +000082set WORKSPACE_TOOLS_PATH=%WORKSPACE%\Tools\bin
lhauch11f009f2006-07-24 16:03:47 +000083echo Resetting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE
lhauch6de5f952006-06-09 18:07:09 +000084
85:path_ok
86
lhauch70edbc32006-07-14 06:46:15 +000087@if "%1"=="-h" goto Usage
88@if "%1"=="-help" goto Usage
89@if "%1"=="--help" goto Usage
90@if "%1"=="/h" goto Usage
91@if "%1"=="/?" goto Usage
92@if "%1"=="/help" goto Usage
yshi8a29212b2006-05-09 06:11:05 +000093
lhauch70edbc32006-07-14 06:46:15 +000094@IF NOT EXIST "Tools\Jars\Common.jar" goto NormalBuild
klu2fb102512006-07-31 19:06:25 +000095@IF NOT EXIST "Tools\Jars\PcdTools.jar" goto NormalBuild
lhauch70edbc32006-07-14 06:46:15 +000096@IF NOT EXIST "Tools\Jars\GenBuild.jar" goto NormalBuild
97@IF NOT EXIST "Tools\Jars\SurfaceArea.jar" goto NormalBuild
98@IF NOT EXIST "Tools\Jars\cpptasks.jar" goto NormalBuild
99@IF NOT EXIST "Tools\Jars\frameworktasks.jar" goto NormalBuild
100@IF NOT EXIST "Tools\bin\FrameworkWizard.jar" goto NormalBuild
101@IF NOT EXIST "Tools\bin\CompressDll.dll" goto NormalBuild
102@IF NOT EXIST "Tools\bin\CompressDll.lib" goto NormalBuild
103@IF NOT EXIST "Tools\bin\CreateMtFile.exe" goto NormalBuild
104@IF NOT EXIST "Tools\bin\EfiCompress.exe" goto NormalBuild
105@IF NOT EXIST "Tools\bin\EfiRom.exe" goto NormalBuild
106@IF NOT EXIST "Tools\bin\FlashMap.exe" goto NormalBuild
107@IF NOT EXIST "Tools\bin\FwImage.exe" goto NormalBuild
108@IF NOT EXIST "Tools\bin\GenAcpiTable.exe" goto NormalBuild
109@IF NOT EXIST "Tools\bin\GenCRC32Section.exe" goto NormalBuild
110@IF NOT EXIST "Tools\bin\GenCapsuleHdr.exe" goto NormalBuild
111@IF NOT EXIST "Tools\bin\GenDepex.exe" goto NormalBuild
112@IF NOT EXIST "Tools\bin\GenFfsFile.exe" goto NormalBuild
113@IF NOT EXIST "Tools\bin\GenFvImage.exe" goto NormalBuild
lhauch70edbc32006-07-14 06:46:15 +0000114@IF NOT EXIST "Tools\bin\GenSection.exe" goto NormalBuild
115@IF NOT EXIST "Tools\bin\GenTEImage.exe" goto NormalBuild
116@IF NOT EXIST "Tools\bin\GuidChk.exe" goto NormalBuild
117@IF NOT EXIST "Tools\bin\MakeDeps.exe" goto NormalBuild
118@IF NOT EXIST "Tools\bin\ModifyInf.exe" goto NormalBuild
119@IF NOT EXIST "Tools\bin\PeiRebase_Ia32.exe" goto NormalBuild
120@IF NOT EXIST "Tools\bin\PeiRebase_Ipf.exe" goto NormalBuild
121@IF NOT EXIST "Tools\bin\PeiRebase_X64.exe" goto NormalBuild
122@IF NOT EXIST "Tools\bin\SecApResetVectorFixup.exe" goto NormalBuild
123@IF NOT EXIST "Tools\bin\SecFixup.exe" goto NormalBuild
124@IF NOT EXIST "Tools\bin\SetStamp.exe" goto NormalBuild
125@IF NOT EXIST "Tools\bin\SplitFile.exe" goto NormalBuild
126@IF NOT EXIST "Tools\bin\StrGather.exe" goto NormalBuild
127@IF NOT EXIST "Tools\bin\Strip.exe" goto NormalBuild
128@IF NOT EXIST "Tools\bin\VfrCompile.exe" goto NormalBuild
129@IF NOT EXIST "Tools\bin\ZeroDebugData.exe" goto NormalBuild
130@IF NOT EXIST "Tools\bin\antlr.exe" goto NormalBuild
131@IF NOT EXIST "Tools\bin\dlg.exe" goto NormalBuild
yshi8a29212b2006-05-09 06:11:05 +0000132
lhauch70edbc32006-07-14 06:46:15 +0000133@if "%1"=="Rebuild" goto NormalBuild
134@if "%1"=="ForceRebuild" goto ForceBuild
lhauch11f009f2006-07-24 16:03:47 +0000135@if NOT "%1"=="" goto Usage
lhauch70edbc32006-07-14 06:46:15 +0000136
137goto skipbuild
138
qouyang3a9b7222006-08-28 13:06:24 +0000139:ForceBuild
jwang36eb614e72006-10-17 06:24:21 +0000140call ant -f %WORKSPACE%\Tools\build.xml -noclasspath cleanall
lhauch70edbc32006-07-14 06:46:15 +0000141
142:NormalBuild
yshi8a29212b2006-05-09 06:11:05 +0000143@REM
144@REM Start to build the Framework Tools
145@REM
146
147echo.
148echo Building the Framework Tools
149echo.
150
151@REM
152@REM We are going to create the SurfaceArea.jar file first so that the other
153@REM Java Programs can use it.
154@REM It needs the XMLBEANS libraries in order to compile.
155@REM
jwang36eb614e72006-10-17 06:24:21 +0000156set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib
lhauch70edbc32006-07-14 06:46:15 +0000157set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar
158set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean.jar
159set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar
160set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xmlpublic.jar
161set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar
162set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\resolver.jar
bbahnsen878ddf12006-04-21 22:54:32 +0000163
yshi8a29212b2006-05-09 06:11:05 +0000164call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea
bbahnsen878ddf12006-04-21 22:54:32 +0000165
yshi8a29212b2006-05-09 06:11:05 +0000166@REM
bbahnsen878ddf12006-04-21 22:54:32 +0000167@REM Now we can make the other Java Programs
lhauch53cef582006-04-28 19:32:18 +0000168@REM All of the remaining Java Programs require the SurfaceArea library to compile
yshi8a29212b2006-05-09 06:11:05 +0000169@REM
lhauch70edbc32006-07-14 06:46:15 +0000170set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\SurfaceArea.jar
qouyangb9546cc2006-06-20 11:57:17 +0000171
yshi8a29212b2006-05-09 06:11:05 +0000172call ant -f %WORKSPACE%\Tools\build.xml JavaCode
bbahnsen878ddf12006-04-21 22:54:32 +0000173
yshi8a29212b2006-05-09 06:11:05 +0000174@REM
175@REM We have all of the Java Programs and add-in classes created, so we can start
176@REM using the cpp-tasks to create our tools
177@REM
qouyangb9546cc2006-06-20 11:57:17 +0000178set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar
klu2d14ebb42006-07-31 18:55:26 +0000179set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\PcdTools.jar
lhauch302e0e42006-06-09 15:26:28 +0000180set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\GenBuild.jar
lhauch08e4a412006-07-08 13:59:19 +0000181set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar
182set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\frameworktasks.jar
hche10xda1508d2006-07-13 01:16:51 +0000183set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Bin\FrameworkWizard.jar
alfred3ecfb292006-08-10 09:33:40 +0000184set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Bin\MigrationTools.jar
bbahnsen878ddf12006-04-21 22:54:32 +0000185
yshi8a29212b2006-05-09 06:11:05 +0000186call ant -f %WORKSPACE%\Tools\build.xml C_Code
bbahnsen878ddf12006-04-21 22:54:32 +0000187
yshi8a29212b2006-05-09 06:11:05 +0000188@REM
189@REM Done!!!
190@REM
bbahnsen878ddf12006-04-21 22:54:32 +0000191goto end
192
193:no_jdk
194echo.
bbahnsen02996842006-04-21 23:36:37 +0000195echo !!! Please install Java, and set JAVA_HOME !!!
196echo.
yshi8a29212b2006-05-09 06:11:05 +0000197goto end
bbahnsen02996842006-04-21 23:36:37 +0000198
199:no_ant
200echo.
201echo !!! Please install Apache Ant, and set ANT_HOME !!!
202echo.
yshi8a29212b2006-05-09 06:11:05 +0000203goto end
bbahnsen02996842006-04-21 23:36:37 +0000204
lhauch42b67fc2006-04-25 19:59:29 +0000205:no_antcontrib
206echo.
207echo !!! Please install Ant-contrib to ANT_HOME !!!
208echo.
yshi8a29212b2006-05-09 06:11:05 +0000209goto end
lhauch42b67fc2006-04-25 19:59:29 +0000210
bbahnsen02996842006-04-21 23:36:37 +0000211:no_xmlbeans
212echo.
213echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!
bbahnsen878ddf12006-04-21 22:54:32 +0000214echo.
yshi8a29212b2006-05-09 06:11:05 +0000215goto end
bbahnsen878ddf12006-04-21 22:54:32 +0000216
lhauch42b67fc2006-04-25 19:59:29 +0000217:no_saxon8
218echo.
219echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!
220echo.
yshi8a29212b2006-05-09 06:11:05 +0000221goto end
lhauch42b67fc2006-04-25 19:59:29 +0000222
lhauch302e0e42006-06-09 15:26:28 +0000223:skipbuild
224@REM
225@REM This just sets up the CLASSPATH, the rest of the environment should have been set already.
226@REM
lhauch302e0e42006-06-09 15:26:28 +0000227echo.
lhauch6de5f952006-06-09 18:07:09 +0000228echo WORKSPACE: %WORKSPACE%
lhauch302e0e42006-06-09 15:26:28 +0000229echo JAVA_HOME: %JAVA_HOME%
230echo ANT_HOME: %ANT_HOME%
231echo XMLBEANS_HOME: %XMLBEANS_HOME%
232echo CYGWIN_HOME: %CYGWIN_HOME%
lhauch302e0e42006-06-09 15:26:28 +0000233echo PATH: %PATH%
234echo.
jwang36eb614e72006-10-17 06:24:21 +0000235set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib
lhauch70edbc32006-07-14 06:46:15 +0000236set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar
237set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean.jar
238set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar
239set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xmlpublic.jar
240set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar
241set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\resolver.jar
lhauch08e4a412006-07-08 13:59:19 +0000242set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\SurfaceArea.jar
lhauch70edbc32006-07-14 06:46:15 +0000243set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar
klu2d14ebb42006-07-31 18:55:26 +0000244set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\PcdTools.jar
lhauch70edbc32006-07-14 06:46:15 +0000245set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\GenBuild.jar
246set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar
247set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\frameworktasks.jar
248set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Bin\FrameworkWizard.jar
alfred19151032006-08-14 05:03:11 +0000249set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Bin\MigrationTools.jar
lhauch11f009f2006-07-24 16:03:47 +0000250echo CLASSPATH: %CLASSPATH%
lhauch302e0e42006-06-09 15:26:28 +0000251goto end
252
lhauch70edbc32006-07-14 06:46:15 +0000253:Usage
254echo.
255echo Usage: %0 [Rebuild] [ForceRebuild]
256echo.
257
bbahnsen878ddf12006-04-21 22:54:32 +0000258:end
259@echo on
260