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 |
13 | @REM set JAVA_HOME=C:\Java\jdk1.5.0_04\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 |
302e0e4a |
18 | @REM usage: edksetup.bat [skip]\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 |
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 |
a29212b2 |
28 | @REM\r |
29 | @REM Check the required system environment variables\r |
30 | @REM\r |
31 | \r |
878ddf1f |
32 | :check_vc\r |
a29212b2 |
33 | if defined VCINSTALLDIR goto check_cygwin\r |
878ddf1f |
34 | if 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 |
a29212b2 |
42 | :check_cygwin\r |
43 | if defined CYGWIN_HOME goto check_java\r |
44 | if exist c:\cygwin (\r |
45 | set CYGWIN_HOME=c:\cygwin\r |
42b67fc4 |
46 | ) else (\r |
a29212b2 |
47 | echo.\r |
48 | echo !!! WARNING !!!! Not set CYGWIN_HOME, gcc build may not be used !!!\r |
49 | echo.\r |
878ddf1f |
50 | )\r |
51 | \r |
a29212b2 |
52 | :check_java\r |
53 | if "%JAVA_HOME%"=="" goto no_jdk\r |
54 | \r |
55 | :check_ant\r |
02996846 |
56 | if "%ANT_HOME%"=="" goto no_ant\r |
42b67fc4 |
57 | if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib\r |
58 | \r |
a29212b2 |
59 | :check_xmlbeans\r |
02996846 |
60 | if "%XMLBEANS_HOME%"=="" goto no_xmlbeans\r |
a29212b2 |
61 | if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8\r |
878ddf1f |
62 | \r |
a29212b2 |
63 | @REM\r |
64 | @REM Set the WORKSPACE to the current working directory\r |
65 | @REM\r |
66 | set WORKSPACE=%CD%\r |
878ddf1f |
67 | \r |
2da8968b |
68 | set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin\r |
6de5f959 |
69 | \r |
70 | if defined WORKSPACE_TOOLS_PATH goto check_path\r |
71 | set PATH=%FRAMEWORK_TOOLS_PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin;%XMLBEANS_HOME%\bin;%PATH%\r |
72 | set WORKSPACE_TOOLS_PATH=%FRAMEWORK_TOOLS_PATH%\r |
73 | echo Setting the PATH variable to include the Framework_Tools_Path for this WORKSPACE\r |
74 | goto path_ok\r |
75 | \r |
76 | :check_path\r |
77 | if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok\r |
78 | set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%\r |
79 | set WORKSPACE_PATH=%WORKSPACE%\r |
80 | echo 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"=="skip" goto skipbuild\r |
878ddf1f |
85 | \r |
a29212b2 |
86 | echo.\r |
6de5f959 |
87 | echo WORKSPACE: %WORKSPACE%\r |
a29212b2 |
88 | echo JAVA_HOME: %JAVA_HOME%\r |
89 | echo ANT_HOME: %ANT_HOME%\r |
90 | echo XMLBEANS_HOME: %XMLBEANS_HOME%\r |
91 | echo CYGWIN_HOME: %CYGWIN_HOME%\r |
a29212b2 |
92 | echo PATH: %PATH%\r |
878ddf1f |
93 | echo.\r |
94 | \r |
a29212b2 |
95 | @REM\r |
96 | @REM Start to build the Framework Tools\r |
97 | @REM\r |
42b67fc4 |
98 | \r |
302e0e4a |
99 | \r |
a29212b2 |
100 | echo.\r |
101 | echo Building the Framework Tools\r |
102 | echo.\r |
42b67fc4 |
103 | \r |
a29212b2 |
104 | @REM\r |
105 | @REM We are going to create the SurfaceArea.jar file first so that the other\r |
106 | @REM Java Programs can use it.\r |
107 | @REM It needs the XMLBEANS libraries in order to compile.\r |
108 | @REM\r |
5d863867 |
109 | set CLASSPATH=.;%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar\r |
53cef58a |
110 | set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar\r |
111 | set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar;%XMLBEANS_HOME%\lib\resolver.jar\r |
878ddf1f |
112 | \r |
a29212b2 |
113 | call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea\r |
878ddf1f |
114 | \r |
a29212b2 |
115 | @REM\r |
878ddf1f |
116 | @REM Now we can make the other Java Programs\r |
53cef58a |
117 | @REM All of the remaining Java Programs require the SurfaceArea library to compile\r |
a29212b2 |
118 | @REM\r |
302e0e4a |
119 | set CLASSPATH=%CLASSPATH%;%WORKSPACE%\%Tools\Jars\SurfaceArea.jar\r |
878ddf1f |
120 | \r |
b9546cc8 |
121 | \r |
a29212b2 |
122 | call ant -f %WORKSPACE%\Tools\build.xml JavaCode\r |
878ddf1f |
123 | \r |
a29212b2 |
124 | @REM\r |
125 | @REM We have all of the Java Programs and add-in classes created, so we can start\r |
126 | @REM using the cpp-tasks to create our tools\r |
127 | @REM\r |
b9546cc8 |
128 | set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar\r |
302e0e4a |
129 | set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\GenBuild.jar\r |
a29212b2 |
130 | set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar;%WORKSPACE%\Tools\Jars\frameworktasks.jar\r |
878ddf1f |
131 | \r |
a29212b2 |
132 | call ant -f %WORKSPACE%\Tools\build.xml C_Code\r |
878ddf1f |
133 | \r |
a29212b2 |
134 | @REM\r |
135 | @REM Done!!!\r |
136 | @REM\r |
878ddf1f |
137 | goto end\r |
138 | \r |
139 | :no_jdk\r |
140 | echo.\r |
02996846 |
141 | echo !!! Please install Java, and set JAVA_HOME !!!\r |
142 | echo.\r |
a29212b2 |
143 | goto end\r |
02996846 |
144 | \r |
145 | :no_ant\r |
146 | echo.\r |
147 | echo !!! Please install Apache Ant, and set ANT_HOME !!!\r |
148 | echo.\r |
a29212b2 |
149 | goto end\r |
02996846 |
150 | \r |
42b67fc4 |
151 | :no_antcontrib\r |
152 | echo.\r |
153 | echo !!! Please install Ant-contrib to ANT_HOME !!!\r |
154 | echo.\r |
a29212b2 |
155 | goto end\r |
42b67fc4 |
156 | \r |
02996846 |
157 | :no_xmlbeans\r |
158 | echo.\r |
159 | echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!\r |
878ddf1f |
160 | echo.\r |
a29212b2 |
161 | goto end\r |
878ddf1f |
162 | \r |
42b67fc4 |
163 | :no_saxon8\r |
164 | echo.\r |
165 | echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!\r |
166 | echo.\r |
a29212b2 |
167 | goto end\r |
42b67fc4 |
168 | \r |
302e0e4a |
169 | :skipbuild\r |
170 | @REM\r |
171 | @REM This just sets up the CLASSPATH, the rest of the environment should have been set already.\r |
172 | @REM\r |
302e0e4a |
173 | echo.\r |
6de5f959 |
174 | echo WORKSPACE: %WORKSPACE%\r |
302e0e4a |
175 | echo JAVA_HOME: %JAVA_HOME%\r |
176 | echo ANT_HOME: %ANT_HOME%\r |
177 | echo XMLBEANS_HOME: %XMLBEANS_HOME%\r |
178 | echo CYGWIN_HOME: %CYGWIN_HOME%\r |
302e0e4a |
179 | echo PATH: %PATH%\r |
180 | echo.\r |
181 | set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar\r |
182 | set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar\r |
183 | set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar;%XMLBEANS_HOME%\lib\resolver.jar\r |
184 | set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%WORKSPACE%\Tools\Jars\GenBuild.jar\r |
185 | set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar;%WORKSPACE%\Tools\Jars\frameworktasks.jar\r |
186 | goto end\r |
187 | \r |
878ddf1f |
188 | :end\r |
189 | @echo on\r |
190 | \r |