]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - edksetup.bat
Introduce a new property INCLUDE_PATHS. This property can used by customized build...
[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_04\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]\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 Check the required system environment variables\r
30@REM\r
31\r
32:check_vc\r
33if defined VCINSTALLDIR goto check_cygwin\r
34if defined VS71COMNTOOLS (\r
35 call "%VS71COMNTOOLS%\vsvars32.bat"\r
36) else (\r
37 echo.\r
38 echo !!! WARNING !!!! Cannot find Visual Studio !!!\r
39 echo.\r
40)\r
41\r
42:check_cygwin\r
43if defined CYGWIN_HOME goto check_java\r
44if exist c:\cygwin (\r
45 set CYGWIN_HOME=c:\cygwin\r
46) else (\r
47 echo.\r
48 echo !!! WARNING !!!! Not set CYGWIN_HOME, gcc build may not be used !!!\r
49 echo.\r
50)\r
51\r
52:check_java\r
53if "%JAVA_HOME%"=="" goto no_jdk\r
54\r
55:check_ant\r
56if "%ANT_HOME%"=="" goto no_ant\r
57if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib\r
58\r
59:check_xmlbeans\r
60if "%XMLBEANS_HOME%"=="" goto no_xmlbeans\r
61if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8\r
62\r
63@REM\r
64@REM Set the WORKSPACE to the current working directory\r
65@REM\r
66set WORKSPACE=%CD%\r
67\r
68set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin\r
69\r
70if defined WORKSPACE_TOOLS_PATH goto check_path\r
71set PATH=%FRAMEWORK_TOOLS_PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin;%XMLBEANS_HOME%\bin;%PATH%\r
72set WORKSPACE_TOOLS_PATH=%FRAMEWORK_TOOLS_PATH%\r
73echo Setting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE\r
74goto path_ok\r
75\r
76:check_path\r
77if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok\r
78set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%\r
79set WORKSPACE_TOOLS_PATH=%WORKSPACE%\Tools\bin\r
80echo Resetting the PATH variable to include the FRAMEWORK_TOOLS_PATH for this WORKSPACE\r
81\r
82:path_ok\r
83\r
84@if "%1"=="-h" goto Usage\r
85@if "%1"=="-help" goto Usage\r
86@if "%1"=="--help" goto Usage\r
87@if "%1"=="/h" goto Usage\r
88@if "%1"=="/?" goto Usage\r
89@if "%1"=="/help" goto Usage\r
90\r
91@IF NOT EXIST "Tools\Jars\Common.jar" goto NormalBuild\r
92@IF NOT EXIST "Tools\Jars\PcdTools.jar" goto NormalBuild\r
93@IF NOT EXIST "Tools\Jars\GenBuild.jar" goto NormalBuild\r
94@IF NOT EXIST "Tools\Jars\SurfaceArea.jar" goto NormalBuild\r
95@IF NOT EXIST "Tools\Jars\cpptasks.jar" goto NormalBuild\r
96@IF NOT EXIST "Tools\Jars\frameworktasks.jar" goto NormalBuild\r
97@IF NOT EXIST "Tools\bin\FrameworkWizard.jar" goto NormalBuild\r
98@IF NOT EXIST "Tools\bin\CompressDll.dll" goto NormalBuild\r
99@IF NOT EXIST "Tools\bin\CompressDll.lib" goto NormalBuild\r
100@IF NOT EXIST "Tools\bin\CreateMtFile.exe" goto NormalBuild\r
101@IF NOT EXIST "Tools\bin\EfiCompress.exe" goto NormalBuild\r
102@IF NOT EXIST "Tools\bin\EfiRom.exe" goto NormalBuild\r
103@IF NOT EXIST "Tools\bin\FlashMap.exe" goto NormalBuild\r
104@IF NOT EXIST "Tools\bin\FwImage.exe" goto NormalBuild\r
105@IF NOT EXIST "Tools\bin\GenAcpiTable.exe" goto NormalBuild\r
106@IF NOT EXIST "Tools\bin\GenCRC32Section.exe" goto NormalBuild\r
107@IF NOT EXIST "Tools\bin\GenCapsuleHdr.exe" goto NormalBuild\r
108@IF NOT EXIST "Tools\bin\GenDepex.exe" goto NormalBuild\r
109@IF NOT EXIST "Tools\bin\GenFfsFile.exe" goto NormalBuild\r
110@IF NOT EXIST "Tools\bin\GenFvImage.exe" goto NormalBuild\r
111@IF NOT EXIST "Tools\bin\GenSection.exe" goto NormalBuild\r
112@IF NOT EXIST "Tools\bin\GenTEImage.exe" goto NormalBuild\r
113@IF NOT EXIST "Tools\bin\GuidChk.exe" goto NormalBuild\r
114@IF NOT EXIST "Tools\bin\MakeDeps.exe" goto NormalBuild\r
115@IF NOT EXIST "Tools\bin\ModifyInf.exe" goto NormalBuild\r
116@IF NOT EXIST "Tools\bin\PeiRebase_Ia32.exe" goto NormalBuild\r
117@IF NOT EXIST "Tools\bin\PeiRebase_Ipf.exe" goto NormalBuild\r
118@IF NOT EXIST "Tools\bin\PeiRebase_X64.exe" goto NormalBuild\r
119@IF NOT EXIST "Tools\bin\SecApResetVectorFixup.exe" goto NormalBuild\r
120@IF NOT EXIST "Tools\bin\SecFixup.exe" goto NormalBuild\r
121@IF NOT EXIST "Tools\bin\SetStamp.exe" goto NormalBuild\r
122@IF NOT EXIST "Tools\bin\SplitFile.exe" goto NormalBuild\r
123@IF NOT EXIST "Tools\bin\StrGather.exe" goto NormalBuild\r
124@IF NOT EXIST "Tools\bin\Strip.exe" goto NormalBuild\r
125@IF NOT EXIST "Tools\bin\VfrCompile.exe" goto NormalBuild\r
126@IF NOT EXIST "Tools\bin\ZeroDebugData.exe" goto NormalBuild\r
127@IF NOT EXIST "Tools\bin\antlr.exe" goto NormalBuild\r
128@IF NOT EXIST "Tools\bin\dlg.exe" goto NormalBuild\r
129\r
130@if "%1"=="Rebuild" goto NormalBuild\r
131@if "%1"=="ForceRebuild" goto ForceBuild\r
132@if NOT "%1"=="" goto Usage\r
133\r
134goto skipbuild\r
135\r
136:ForceBuild\r
137call ant -noclasspath -f %WORKSPACE%\Tools\build.xml cleanall\r
138\r
139:NormalBuild\r
140@REM\r
141@REM Start to build the Framework Tools\r
142@REM\r
143\r
144echo.\r
145echo Building the Framework Tools\r
146echo.\r
147\r
148@REM\r
149@REM We are going to create the SurfaceArea.jar file first so that the other\r
150@REM Java Programs can use it.\r
151@REM It needs the XMLBEANS libraries in order to compile.\r
152@REM\r
153set CLASSPATH=%XMLBEANS_HOME%\lib\r
154set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar\r
155set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean.jar\r
156set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar\r
157set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xmlpublic.jar\r
158set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar\r
159set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\resolver.jar\r
160\r
161call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea\r
162\r
163@REM\r
164@REM Now we can make the other Java Programs\r
165@REM All of the remaining Java Programs require the SurfaceArea library to compile\r
166@REM\r
167set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\SurfaceArea.jar\r
168\r
169call ant -f %WORKSPACE%\Tools\build.xml JavaCode\r
170\r
171@REM\r
172@REM We have all of the Java Programs and add-in classes created, so we can start\r
173@REM using the cpp-tasks to create our tools\r
174@REM\r
175set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar\r
176set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\PcdTools.jar\r
177set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\GenBuild.jar\r
178set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar\r
179set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\frameworktasks.jar\r
180set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Bin\FrameworkWizard.jar\r
181set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Bin\MigrationTools.jar\r
182\r
183call ant -f %WORKSPACE%\Tools\build.xml C_Code\r
184\r
185@REM\r
186@REM Done!!!\r
187@REM\r
188goto end\r
189\r
190:no_jdk\r
191echo.\r
192echo !!! Please install Java, and set JAVA_HOME !!!\r
193echo.\r
194goto end\r
195\r
196:no_ant\r
197echo.\r
198echo !!! Please install Apache Ant, and set ANT_HOME !!!\r
199echo.\r
200goto end\r
201\r
202:no_antcontrib\r
203echo.\r
204echo !!! Please install Ant-contrib to ANT_HOME !!!\r
205echo.\r
206goto end\r
207\r
208:no_xmlbeans\r
209echo.\r
210echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!\r
211echo.\r
212goto end\r
213\r
214:no_saxon8\r
215echo.\r
216echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!\r
217echo.\r
218goto end\r
219\r
220:skipbuild\r
221@REM\r
222@REM This just sets up the CLASSPATH, the rest of the environment should have been set already.\r
223@REM\r
224echo.\r
225echo WORKSPACE: %WORKSPACE%\r
226echo JAVA_HOME: %JAVA_HOME%\r
227echo ANT_HOME: %ANT_HOME%\r
228echo XMLBEANS_HOME: %XMLBEANS_HOME%\r
229echo CYGWIN_HOME: %CYGWIN_HOME%\r
230echo PATH: %PATH%\r
231echo.\r
232set CLASSPATH=%XMLBEANS_HOME%\lib\r
233set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar\r
234set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean.jar\r
235set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar\r
236set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xmlpublic.jar\r
237set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar\r
238set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\resolver.jar\r
239set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\SurfaceArea.jar\r
240set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar\r
241set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\PcdTools.jar\r
242set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\GenBuild.jar\r
243set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar\r
244set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\frameworktasks.jar\r
245set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Bin\FrameworkWizard.jar\r
246set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Bin\MigrationTools.jar\r
247echo CLASSPATH: %CLASSPATH%\r
248goto end\r
249\r
250:Usage\r
251echo.\r
252echo Usage: %0 [Rebuild] [ForceRebuild]\r
253echo.\r
254\r
255:end\r
256@echo on\r
257\r