]> git.proxmox.com Git - mirror_edk2.git/blob - edksetup.bat
1. Updated some files’ description files in MdePkg, EdkModulePkg & EdkNt32Pkg.
[mirror_edk2.git] / edksetup.bat
1 @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
7 @REM
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.
10 @REM
11
12 @REM set following environment in this file or in command shell
13 @REM set JAVA_HOME=C:\Java\jdk1.5.0_04
14 @REM set ANT_HOME=C:\ANT
15 @REM set XMLBEANS_HOME=C:\xmlbeans
16 @REM set CYGWIN_HOME=C:\cygwin
17
18 @REM usage: edksetup.bat [skip]
19 @REM if the argument, skip is present, only the paths and the
20 @REM test and set of environment settings are performed.
21
22 @REM ##############################################################
23 @REM # You should not have to modify anything below this line
24 @REM #
25
26 @echo off
27
28 @REM
29 @REM Check the required system environment variables
30 @REM
31
32 :check_vc
33 if defined VCINSTALLDIR goto check_cygwin
34 if defined VS71COMNTOOLS (
35 call "%VS71COMNTOOLS%vsvars32.bat"
36 ) else (
37 echo.
38 echo !!! WARNING !!!! Cannot find Visual Studio !!!
39 echo.
40 )
41
42 :check_cygwin
43 if defined CYGWIN_HOME goto check_java
44 if exist c:\cygwin (
45 set CYGWIN_HOME=c:\cygwin
46 ) else (
47 echo.
48 echo !!! WARNING !!!! Not set CYGWIN_HOME, gcc build may not be used !!!
49 echo.
50 )
51
52 :check_java
53 if "%JAVA_HOME%"=="" goto no_jdk
54
55 :check_ant
56 if "%ANT_HOME%"=="" goto no_ant
57 if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib
58
59 :check_xmlbeans
60 if "%XMLBEANS_HOME%"=="" goto no_xmlbeans
61 if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8
62
63 @REM
64 @REM Set the WORKSPACE to the current working directory
65 @REM
66 set WORKSPACE=%CD%
67
68 set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin
69
70 if defined WORKSPACE_TOOLS_PATH goto check_path
71 set PATH=%FRAMEWORK_TOOLS_PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin;%XMLBEANS_HOME%\bin;%PATH%
72 set WORKSPACE_TOOLS_PATH=%FRAMEWORK_TOOLS_PATH%
73 echo Setting the PATH variable to include the Framework_Tools_Path for this WORKSPACE
74 goto path_ok
75
76 :check_path
77 if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok
78 set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%
79 set WORKSPACE_PATH=%WORKSPACE%
80 echo Resetting the PATH variable to include the Framework_Tools_Path for this WORKSPACE
81
82 :path_ok
83
84 if "%1"=="skip" goto skipbuild
85
86 echo.
87 echo WORKSPACE: %WORKSPACE%
88 echo JAVA_HOME: %JAVA_HOME%
89 echo ANT_HOME: %ANT_HOME%
90 echo XMLBEANS_HOME: %XMLBEANS_HOME%
91 echo CYGWIN_HOME: %CYGWIN_HOME%
92 echo PATH: %PATH%
93 echo.
94
95 @REM
96 @REM Start to build the Framework Tools
97 @REM
98
99
100 echo.
101 echo Building the Framework Tools
102 echo.
103
104 @REM
105 @REM We are going to create the SurfaceArea.jar file first so that the other
106 @REM Java Programs can use it.
107 @REM It needs the XMLBEANS libraries in order to compile.
108 @REM
109 set CLASSPATH=.;%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar
110 set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar
111 set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar;%XMLBEANS_HOME%\lib\resolver.jar
112
113 @if "%1" neq "ForceRebuild" goto NormalBuild
114 call ant -f %WORKSPACE%\Tools\build.xml cleanall
115
116 :NormalBuild
117 call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea
118
119 @REM
120 @REM Now we can make the other Java Programs
121 @REM All of the remaining Java Programs require the SurfaceArea library to compile
122 @REM
123 set CLASSPATH=%CLASSPATH%;%WORKSPACE%\%Tools\Jars\SurfaceArea.jar
124
125
126 call ant -f %WORKSPACE%\Tools\build.xml JavaCode
127
128 @REM
129 @REM We have all of the Java Programs and add-in classes created, so we can start
130 @REM using the cpp-tasks to create our tools
131 @REM
132 set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar
133 set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\GenBuild.jar
134 set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar
135 set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\frameworktasks.jar
136
137 call ant -f %WORKSPACE%\Tools\build.xml C_Code
138
139 @REM
140 @REM Done!!!
141 @REM
142 goto end
143
144 :no_jdk
145 echo.
146 echo !!! Please install Java, and set JAVA_HOME !!!
147 echo.
148 goto end
149
150 :no_ant
151 echo.
152 echo !!! Please install Apache Ant, and set ANT_HOME !!!
153 echo.
154 goto end
155
156 :no_antcontrib
157 echo.
158 echo !!! Please install Ant-contrib to ANT_HOME !!!
159 echo.
160 goto end
161
162 :no_xmlbeans
163 echo.
164 echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!
165 echo.
166 goto end
167
168 :no_saxon8
169 echo.
170 echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!
171 echo.
172 goto end
173
174 :skipbuild
175 @REM
176 @REM This just sets up the CLASSPATH, the rest of the environment should have been set already.
177 @REM
178 echo.
179 echo WORKSPACE: %WORKSPACE%
180 echo JAVA_HOME: %JAVA_HOME%
181 echo ANT_HOME: %ANT_HOME%
182 echo XMLBEANS_HOME: %XMLBEANS_HOME%
183 echo CYGWIN_HOME: %CYGWIN_HOME%
184 echo PATH: %PATH%
185 echo.
186 set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar
187 set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar
188 set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar;%XMLBEANS_HOME%\lib\resolver.jar
189 set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\SurfaceArea.jar
190 set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar;%WORKSPACE%\Tools\Jars\GenBuild.jar
191 set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar;%WORKSPACE%\Tools\Jars\frameworktasks.jar
192 goto end
193
194 :end
195 @echo on
196