]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - edksetup.bat
a. Changed MYTOOLS to use Visual Studio Team Suite for IA32 and X64. IPF is still...
[mirror_edk2.git] / edksetup.bat
... / ...
CommitLineData
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
7@REM\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
10@REM\r
11\r
12@REM set following environment in this file or in command shell\r
13@REM set JAVA_HOME=C:\Java\jdk1.5.0_06\r
14@REM set ANT_HOME=C:\ANT\r
15@REM set XMLBEANS_HOME=C:\xmlbeans\r
16@REM set CYGWIN_HOME=C:\cygwin\r
17\r
18@REM usage: edksetup.bat [Rebuild] [ForceRebuild] [Reconfig]\r
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
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
28@REM\r
29@REM Set the WORKSPACE to the current working directory\r
30@REM\r
31pushd .\r
32cd %~dp0\r
33set WORKSPACE=%CD%\r
34\r
35@if /I "%1"=="-h" goto Usage\r
36@if /I "%1"=="-help" goto Usage\r
37@if /I "%1"=="--help" goto Usage\r
38@if /I "%1"=="/h" goto Usage\r
39@if /I "%1"=="/?" goto Usage\r
40@if /I "%1"=="/help" goto Usage\r
41@if /I not "%1"=="--nt32" goto check_new_build\r
42shift\r
43goto check_vc\r
44\r
45:check_new_build\r
46@if /I "%1"=="NewBuild" goto NewBuild\r
47\r
48:AntBuild\r
49@REM\r
50@REM Check the required system environment variables\r
51@REM\r
52\r
53:check_vc\r
54@REM The following setup is required for building the Nt32Pkg\Nt32.dsc\r
55@REM platform emulation environment.\r
56if defined VCINSTALLDIR goto check_cygwin\r
57if defined VS71COMNTOOLS (\r
58 @REM Use Visual Studio .NET 2003 if it is installed\r
59 call "%VS71COMNTOOLS%\vsvars32.bat"\r
60) else if defined VS80COMNTOOLS (\r
61 @REM Use Visual Studio 2005 iff Visual Studio .NET 2003 is not installed.\r
62 call "%VS80COMNTOOLS%\vsvars32.bat"\r
63) else (\r
64 echo.\r
65 echo !!! WARNING !!!! Cannot find Visual Studio !!!\r
66 echo.\r
67)\r
68goto check_new_build\r
69\r
70:check_cygwin\r
71@if /I "%1"=="NewBuild" goto NewBuild\r
72if defined CYGWIN_HOME goto check_java\r
73if exist c:\cygwin (\r
74 set CYGWIN_HOME=c:\cygwin\r
75) else (\r
76 echo.\r
77 echo !!! WARNING !!!! Not set CYGWIN_HOME, gcc build may not be used !!!\r
78 echo.\r
79)\r
80\r
81:check_java\r
82if "%JAVA_HOME%"=="" goto no_jdk\r
83\r
84:check_ant\r
85if "%ANT_HOME%"=="" goto no_ant\r
86if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib\r
87\r
88:check_xmlbeans\r
89if "%XMLBEANS_HOME%"=="" goto no_xmlbeans\r
90if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8\r
91\r
92set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin\r
93\r
94if not defined ORIGINAL_CLASSPATH set ORIGINAL_CLASSPATH=%CLASSPATH%\r
95set CLASSPATH=%ORIGINAL_CLASSPATH%\r
96\r
97if defined WORKSPACE_TOOLS_PATH goto check_path\r
98set PATH=%FRAMEWORK_TOOLS_PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin;%XMLBEANS_HOME%\bin;%PATH%\r
99set WORKSPACE_TOOLS_PATH=%FRAMEWORK_TOOLS_PATH%\r
100echo Setting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE\r
101goto path_ok\r
102\r
103:check_path\r
104if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok\r
105set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%\r
106set WORKSPACE_TOOLS_PATH=%WORKSPACE%\Tools\bin\r
107echo Resetting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE\r
108\r
109:path_ok\r
110\r
111@if /I "%1"=="ForceRebuild" goto ForceBuild\r
112@if /I "%1"=="Reconfig" goto Reconfig\r
113\r
114@IF NOT EXIST "Tools\Jars\Common.jar" goto NormalBuild\r
115@IF NOT EXIST "Tools\Jars\PcdTools.jar" goto NormalBuild\r
116@IF NOT EXIST "Tools\Jars\GenBuild.jar" goto NormalBuild\r
117@IF NOT EXIST "Tools\Jars\SurfaceArea.jar" goto NormalBuild\r
118@IF NOT EXIST "Tools\Jars\cpptasks.jar" goto NormalBuild\r
119@IF NOT EXIST "Tools\Jars\frameworktasks.jar" goto NormalBuild\r
120@IF NOT EXIST "Tools\bin\FrameworkWizard.jar" goto NormalBuild\r
121@IF NOT EXIST "Tools\bin\CompressDll.dll" goto NormalBuild\r
122@IF NOT EXIST "Tools\bin\CompressDll.lib" goto NormalBuild\r
123@IF NOT EXIST "Tools\bin\CreateMtFile.exe" goto NormalBuild\r
124@IF NOT EXIST "Tools\bin\EfiCompress.exe" goto NormalBuild\r
125@IF NOT EXIST "Tools\bin\EfiRom.exe" goto NormalBuild\r
126@IF NOT EXIST "Tools\bin\FlashMap.exe" goto NormalBuild\r
127@IF NOT EXIST "Tools\bin\FwImage.exe" goto NormalBuild\r
128@IF NOT EXIST "Tools\bin\GenAcpiTable.exe" goto NormalBuild\r
129@IF NOT EXIST "Tools\bin\GenCRC32Section.exe" goto NormalBuild\r
130@IF NOT EXIST "Tools\bin\GenCapsuleHdr.exe" goto NormalBuild\r
131@IF NOT EXIST "Tools\bin\GenDepex.exe" goto NormalBuild\r
132@IF NOT EXIST "Tools\bin\GenFfsFile.exe" goto NormalBuild\r
133@IF NOT EXIST "Tools\bin\GenFvImage.exe" goto NormalBuild\r
134@IF NOT EXIST "Tools\bin\GenSection.exe" goto NormalBuild\r
135@IF NOT EXIST "Tools\bin\GenTEImage.exe" goto NormalBuild\r
136@IF NOT EXIST "Tools\bin\GuidChk.exe" goto NormalBuild\r
137@IF NOT EXIST "Tools\bin\MakeDeps.exe" goto NormalBuild\r
138@IF NOT EXIST "Tools\bin\ModifyInf.exe" goto NormalBuild\r
139@IF NOT EXIST "Tools\bin\PeiRebase_Ia32.exe" goto NormalBuild\r
140@IF NOT EXIST "Tools\bin\PeiRebase_Ipf.exe" goto NormalBuild\r
141@IF NOT EXIST "Tools\bin\PeiRebase_X64.exe" goto NormalBuild\r
142@IF NOT EXIST "Tools\bin\SecApResetVectorFixup.exe" goto NormalBuild\r
143@IF NOT EXIST "Tools\bin\SecFixup.exe" goto NormalBuild\r
144@IF NOT EXIST "Tools\bin\SetStamp.exe" goto NormalBuild\r
145@IF NOT EXIST "Tools\bin\SplitFile.exe" goto NormalBuild\r
146@IF NOT EXIST "Tools\bin\StrGather.exe" goto NormalBuild\r
147@IF NOT EXIST "Tools\bin\Strip.exe" goto NormalBuild\r
148@IF NOT EXIST "Tools\bin\VfrCompile.exe" goto NormalBuild\r
149@IF NOT EXIST "Tools\bin\ZeroDebugData.exe" goto NormalBuild\r
150@IF NOT EXIST "Tools\bin\antlr.exe" goto NormalBuild\r
151@IF NOT EXIST "Tools\bin\dlg.exe" goto NormalBuild\r
152\r
153@if /I "%1"=="Rebuild" goto NormalBuild\r
154@if NOT "%1"=="" goto Usage\r
155\r
156goto skipbuild\r
157\r
158:ForceBuild \r
159call ant -f %WORKSPACE%\Tools\build.xml -noclasspath cleanall\r
160\r
161:NormalBuild\r
162@REM\r
163@REM Start to build the Framework Tools\r
164@REM\r
165\r
166echo.\r
167echo Building the Framework Tools\r
168echo.\r
169\r
170@REM\r
171@REM We are going to create the SurfaceArea.jar file first so that the other\r
172@REM Java Programs can use it.\r
173@REM It needs the XMLBEANS libraries in order to compile.\r
174@REM\r
175set CLASSPATH=%XMLBEANS_HOME%\lib;%CLASSPATH%\r
176set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%CLASSPATH%\r
177set CLASSPATH=%XMLBEANS_HOME%\lib\xbean.jar;%CLASSPATH%\r
178set CLASSPATH=%XMLBEANS_HOME%\lib\xbean_xpath.jar;%CLASSPATH%\r
179set CLASSPATH=%XMLBEANS_HOME%\lib\xmlpublic.jar;%CLASSPATH%\r
180set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8.jar;%CLASSPATH%\r
181set CLASSPATH=%XMLBEANS_HOME%\lib\resolver.jar;%CLASSPATH%\r
182\r
183call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea\r
184\r
185@REM\r
186@REM Now we can make the other Java Programs\r
187@REM All of the remaining Java Programs require the SurfaceArea library to compile\r
188@REM\r
189set CLASSPATH=%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%CLASSPATH%\r
190\r
191call ant -f %WORKSPACE%\Tools\build.xml JavaCode\r
192\r
193@REM\r
194@REM We have all of the Java Programs and add-in classes created, so we can start\r
195@REM using the cpp-tasks to create our tools\r
196@REM\r
197set CLASSPATH=%WORKSPACE%\Tools\Jars\Common.jar;%CLASSPATH%\r
198set CLASSPATH=%WORKSPACE%\Tools\Jars\PcdTools.jar;%CLASSPATH%\r
199set CLASSPATH=%WORKSPACE%\Tools\Jars\GenBuild.jar;%CLASSPATH%\r
200set CLASSPATH=%WORKSPACE%\Tools\Jars\cpptasks.jar;%CLASSPATH%\r
201set CLASSPATH=%WORKSPACE%\Tools\Jars\frameworktasks.jar;%CLASSPATH%\r
202set CLASSPATH=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar;%CLASSPATH%\r
203set CLASSPATH=%WORKSPACE%\Tools\Bin\MigrationTools.jar;%CLASSPATH%\r
204\r
205call ant -f %WORKSPACE%\Tools\build.xml C_Code\r
206\r
207@REM\r
208@REM Done!!!\r
209@REM\r
210goto end\r
211\r
212:no_jdk\r
213echo.\r
214echo !!! Please install Java, and set JAVA_HOME !!!\r
215echo.\r
216goto end\r
217\r
218:no_ant\r
219echo.\r
220echo !!! Please install Apache Ant, and set ANT_HOME !!!\r
221echo.\r
222goto end\r
223\r
224:no_antcontrib\r
225echo.\r
226echo !!! Please install Ant-contrib to ANT_HOME !!!\r
227echo.\r
228goto end\r
229\r
230:no_xmlbeans\r
231echo.\r
232echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!\r
233echo.\r
234goto end\r
235\r
236:no_saxon8\r
237echo.\r
238echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!\r
239echo.\r
240goto end\r
241\r
242:skipbuild\r
243@REM\r
244@REM This just sets up the CLASSPATH, the rest of the environment should have been set already.\r
245@REM\r
246echo.\r
247echo WORKSPACE: %WORKSPACE%\r
248echo JAVA_HOME: %JAVA_HOME%\r
249echo ANT_HOME: %ANT_HOME%\r
250echo XMLBEANS_HOME: %XMLBEANS_HOME%\r
251echo CYGWIN_HOME: %CYGWIN_HOME%\r
252echo PATH: %PATH%\r
253echo.\r
254set CLASSPATH=%XMLBEANS_HOME%\lib;%CLASSPATH%\r
255set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%CLASSPATH%\r
256set CLASSPATH=%XMLBEANS_HOME%\lib\xbean.jar;%CLASSPATH%\r
257set CLASSPATH=%XMLBEANS_HOME%\lib\xbean_xpath.jar;%CLASSPATH%\r
258set CLASSPATH=%XMLBEANS_HOME%\lib\xmlpublic.jar;%CLASSPATH%\r
259set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8.jar;%CLASSPATH%\r
260set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8-dom.jar;%CLASSPATH%\r
261set CLASSPATH=%XMLBEANS_HOME%\lib\saxon8-xpath.jar;%CLASSPATH%\r
262set CLASSPATH=%XMLBEANS_HOME%\lib\resolver.jar;%CLASSPATH%\r
263set CLASSPATH=%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%CLASSPATH%\r
264set CLASSPATH=%WORKSPACE%\Tools\Jars\Common.jar;%CLASSPATH%\r
265set CLASSPATH=%WORKSPACE%\Tools\Jars\PcdTools.jar;%CLASSPATH%\r
266set CLASSPATH=%WORKSPACE%\Tools\Jars\GenBuild.jar;%CLASSPATH%\r
267set CLASSPATH=%WORKSPACE%\Tools\Jars\cpptasks.jar;%CLASSPATH%\r
268set CLASSPATH=%WORKSPACE%\Tools\Jars\frameworktasks.jar;%CLASSPATH%\r
269set CLASSPATH=%WORKSPACE%\Tools\Bin\FrameworkWizard.jar;%CLASSPATH%\r
270set CLASSPATH=%WORKSPACE%\Tools\Bin\MigrationTools.jar;%CLASSPATH%\r
271echo CLASSPATH: %CLASSPATH%\r
272goto end\r
273\r
274:Reconfig\r
275@REM\r
276@REM Reinstall all config files\r
277@REM\r
278call ant -f %WORKSPACE%\Tools\build.xml reconfig\r
279goto end\r
280\r
281:Usage\r
282echo.\r
283echo Usage: %0 [--nt32] [NewBuild] [Rebuild] [ForceRebuild] [Reconfig]\r
284echo --nt32 Call vsvars32.bat for NT32 platform build\r
285echo NewBuild Using new build tools in BaseTools package\r
286echo Rebuild: Incremental build, only build those updated tools; \r
287echo ForceRebuild: Rebuild all tools neither updated or not; \r
288echo Reconfig: Reinstall target.txt, tools_def.txt, FrameworkDatabase.db. \r
289echo.\r
290echo Note that target.template, tools_def.template, FrameworkDatabase.template will be\r
291echo only copied to target.txt, tools_def.txt, FrameworkDatabase.db respectively if they\r
292echo are not existed. Using option [Reconfig] to do the force copy. \r
293echo.\r
294@goto end\r
295\r
296:NewBuild\r
297@IF NOT EXIST "BaseTools\toolsetup.bat" goto AntBuild\r
298if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
299@call BaseTools\toolsetup.bat\r
300@goto end\r
301\r
302:end\r
303@popd\r
304@echo on\r
305\r