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