blob: 3e2da9a5e816d7d28a4d350685f01eb042354f30 [file] [log] [blame]
bbahnsen878ddf12006-04-21 22:54:32 +00001@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
yshi8a29212b2006-05-09 06:11:05 +00007@REM
bbahnsen878ddf12006-04-21 22:54:32 +00008@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
yshi8a29212b2006-05-09 06:11:05 +000014@REM set ANT_HOME=C:\ANT
15@REM set XMLBEANS_HOME=C:\xmlbeans
16@REM set CYGWIN_HOME=C:\cygwin
bbahnsen878ddf12006-04-21 22:54:32 +000017
lhauch302e0e42006-06-09 15:26:28 +000018@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.
bbahnsen878ddf12006-04-21 22:54:32 +000021
22@REM ##############################################################
23@REM # You should not have to modify anything below this line
24@REM #
25
26@echo off
27
yshi8a29212b2006-05-09 06:11:05 +000028@REM
29@REM Check the required system environment variables
30@REM
31
bbahnsen878ddf12006-04-21 22:54:32 +000032:check_vc
yshi8a29212b2006-05-09 06:11:05 +000033if defined VCINSTALLDIR goto check_cygwin
bbahnsen878ddf12006-04-21 22:54:32 +000034if defined VS71COMNTOOLS (
35 call "%VS71COMNTOOLS%vsvars32.bat"
36) else (
37 echo.
38 echo !!! WARNING !!!! Cannot find Visual Studio !!!
39 echo.
40)
41
yshi8a29212b2006-05-09 06:11:05 +000042:check_cygwin
43if defined CYGWIN_HOME goto check_java
44if exist c:\cygwin (
45 set CYGWIN_HOME=c:\cygwin
lhauch42b67fc2006-04-25 19:59:29 +000046) else (
yshi8a29212b2006-05-09 06:11:05 +000047 echo.
48 echo !!! WARNING !!!! Not set CYGWIN_HOME, gcc build may not be used !!!
49 echo.
bbahnsen878ddf12006-04-21 22:54:32 +000050)
51
yshi8a29212b2006-05-09 06:11:05 +000052:check_java
53if "%JAVA_HOME%"=="" goto no_jdk
54
55:check_ant
bbahnsen02996842006-04-21 23:36:37 +000056if "%ANT_HOME%"=="" goto no_ant
lhauch42b67fc2006-04-25 19:59:29 +000057if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib
58
yshi8a29212b2006-05-09 06:11:05 +000059:check_xmlbeans
bbahnsen02996842006-04-21 23:36:37 +000060if "%XMLBEANS_HOME%"=="" goto no_xmlbeans
lhauch42b67fc2006-04-25 19:59:29 +000061if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8
62
yshi8a29212b2006-05-09 06:11:05 +000063@REM
64@REM Set the WORKSPACE to the current working directory
65@REM
66set WORKSPACE=%CD%
lhauch42b67fc2006-04-25 19:59:29 +000067
qouyang2da89682006-06-08 09:11:56 +000068set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin
lhauch6de5f952006-06-09 18:07:09 +000069
70if defined WORKSPACE_TOOLS_PATH goto check_path
71set PATH=%FRAMEWORK_TOOLS_PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin;%XMLBEANS_HOME%\bin;%PATH%
72set WORKSPACE_TOOLS_PATH=%FRAMEWORK_TOOLS_PATH%
73echo Setting the PATH variable to include the Framework_Tools_Path for this WORKSPACE
74goto path_ok
75
76:check_path
77if "%FRAMEWORK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok
78set PATH=%FRAMEWORK_TOOLS_PATH%;%PATH%
79set WORKSPACE_PATH=%WORKSPACE%
80echo Resetting the PATH variable to include the Framework_Tools_Path for this WORKSPACE
81
82:path_ok
83
84if "%1"=="skip" goto skipbuild
yshi8a29212b2006-05-09 06:11:05 +000085
86echo.
lhauch6de5f952006-06-09 18:07:09 +000087echo WORKSPACE: %WORKSPACE%
yshi8a29212b2006-05-09 06:11:05 +000088echo JAVA_HOME: %JAVA_HOME%
89echo ANT_HOME: %ANT_HOME%
90echo XMLBEANS_HOME: %XMLBEANS_HOME%
91echo CYGWIN_HOME: %CYGWIN_HOME%
yshi8a29212b2006-05-09 06:11:05 +000092echo PATH: %PATH%
93echo.
94
95@REM
96@REM Start to build the Framework Tools
97@REM
98
lhauch302e0e42006-06-09 15:26:28 +000099
yshi8a29212b2006-05-09 06:11:05 +0000100echo.
101echo Building the Framework Tools
102echo.
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
wuyizhong5d863862006-06-30 17:53:27 +0000109set CLASSPATH=.;%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar
lhauch53cef582006-04-28 19:32:18 +0000110set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar
111set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar;%XMLBEANS_HOME%\lib\resolver.jar
bbahnsen878ddf12006-04-21 22:54:32 +0000112
wuyizhong450d3b12006-07-06 08:29:28 +0000113@if "%1" neq "ForceRebuild" goto NormalBuild
114call ant -f %WORKSPACE%\Tools\build.xml cleanall
115
116:NormalBuild
yshi8a29212b2006-05-09 06:11:05 +0000117call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea
bbahnsen878ddf12006-04-21 22:54:32 +0000118
yshi8a29212b2006-05-09 06:11:05 +0000119@REM
bbahnsen878ddf12006-04-21 22:54:32 +0000120@REM Now we can make the other Java Programs
lhauch53cef582006-04-28 19:32:18 +0000121@REM All of the remaining Java Programs require the SurfaceArea library to compile
yshi8a29212b2006-05-09 06:11:05 +0000122@REM
lhauch302e0e42006-06-09 15:26:28 +0000123set CLASSPATH=%CLASSPATH%;%WORKSPACE%\%Tools\Jars\SurfaceArea.jar
bbahnsen878ddf12006-04-21 22:54:32 +0000124
qouyangb9546cc2006-06-20 11:57:17 +0000125
yshi8a29212b2006-05-09 06:11:05 +0000126call ant -f %WORKSPACE%\Tools\build.xml JavaCode
bbahnsen878ddf12006-04-21 22:54:32 +0000127
yshi8a29212b2006-05-09 06:11:05 +0000128@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
qouyangb9546cc2006-06-20 11:57:17 +0000132set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar
lhauch302e0e42006-06-09 15:26:28 +0000133set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\GenBuild.jar
lhauch08e4a412006-07-08 13:59:19 +0000134set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar
135set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\frameworktasks.jar
bbahnsen878ddf12006-04-21 22:54:32 +0000136
yshi8a29212b2006-05-09 06:11:05 +0000137call ant -f %WORKSPACE%\Tools\build.xml C_Code
bbahnsen878ddf12006-04-21 22:54:32 +0000138
yshi8a29212b2006-05-09 06:11:05 +0000139@REM
140@REM Done!!!
141@REM
bbahnsen878ddf12006-04-21 22:54:32 +0000142goto end
143
144:no_jdk
145echo.
bbahnsen02996842006-04-21 23:36:37 +0000146echo !!! Please install Java, and set JAVA_HOME !!!
147echo.
yshi8a29212b2006-05-09 06:11:05 +0000148goto end
bbahnsen02996842006-04-21 23:36:37 +0000149
150:no_ant
151echo.
152echo !!! Please install Apache Ant, and set ANT_HOME !!!
153echo.
yshi8a29212b2006-05-09 06:11:05 +0000154goto end
bbahnsen02996842006-04-21 23:36:37 +0000155
lhauch42b67fc2006-04-25 19:59:29 +0000156:no_antcontrib
157echo.
158echo !!! Please install Ant-contrib to ANT_HOME !!!
159echo.
yshi8a29212b2006-05-09 06:11:05 +0000160goto end
lhauch42b67fc2006-04-25 19:59:29 +0000161
bbahnsen02996842006-04-21 23:36:37 +0000162:no_xmlbeans
163echo.
164echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!
bbahnsen878ddf12006-04-21 22:54:32 +0000165echo.
yshi8a29212b2006-05-09 06:11:05 +0000166goto end
bbahnsen878ddf12006-04-21 22:54:32 +0000167
lhauch42b67fc2006-04-25 19:59:29 +0000168:no_saxon8
169echo.
170echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!
171echo.
yshi8a29212b2006-05-09 06:11:05 +0000172goto end
lhauch42b67fc2006-04-25 19:59:29 +0000173
lhauch302e0e42006-06-09 15:26:28 +0000174:skipbuild
175@REM
176@REM This just sets up the CLASSPATH, the rest of the environment should have been set already.
177@REM
lhauch302e0e42006-06-09 15:26:28 +0000178echo.
lhauch6de5f952006-06-09 18:07:09 +0000179echo WORKSPACE: %WORKSPACE%
lhauch302e0e42006-06-09 15:26:28 +0000180echo JAVA_HOME: %JAVA_HOME%
181echo ANT_HOME: %ANT_HOME%
182echo XMLBEANS_HOME: %XMLBEANS_HOME%
183echo CYGWIN_HOME: %CYGWIN_HOME%
lhauch302e0e42006-06-09 15:26:28 +0000184echo PATH: %PATH%
185echo.
186set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar
187set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar
188set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar;%XMLBEANS_HOME%\lib\resolver.jar
lhauch08e4a412006-07-08 13:59:19 +0000189set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\SurfaceArea.jar
190set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar;%WORKSPACE%\Tools\Jars\GenBuild.jar
lhauch302e0e42006-06-09 15:26:28 +0000191set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar;%WORKSPACE%\Tools\Jars\frameworktasks.jar
192goto end
193
bbahnsen878ddf12006-04-21 22:54:32 +0000194:end
195@echo on
196