blob: 03fe4e671341d9c3602ceccd12ee045a6dce21c2 [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
lhauch302e0e42006-06-09 15:26:28 +000032if "%1"=="skip" goto skipbuild
33
bbahnsen878ddf12006-04-21 22:54:32 +000034:check_vc
yshi8a29212b2006-05-09 06:11:05 +000035if defined VCINSTALLDIR goto check_cygwin
bbahnsen878ddf12006-04-21 22:54:32 +000036if defined VS71COMNTOOLS (
37 call "%VS71COMNTOOLS%vsvars32.bat"
38) else (
39 echo.
40 echo !!! WARNING !!!! Cannot find Visual Studio !!!
41 echo.
42)
43
yshi8a29212b2006-05-09 06:11:05 +000044:check_cygwin
45if defined CYGWIN_HOME goto check_java
46if exist c:\cygwin (
47 set CYGWIN_HOME=c:\cygwin
lhauch42b67fc2006-04-25 19:59:29 +000048) else (
yshi8a29212b2006-05-09 06:11:05 +000049 echo.
50 echo !!! WARNING !!!! Not set CYGWIN_HOME, gcc build may not be used !!!
51 echo.
bbahnsen878ddf12006-04-21 22:54:32 +000052)
53
yshi8a29212b2006-05-09 06:11:05 +000054:check_java
55if "%JAVA_HOME%"=="" goto no_jdk
56
57:check_ant
bbahnsen02996842006-04-21 23:36:37 +000058if "%ANT_HOME%"=="" goto no_ant
lhauch42b67fc2006-04-25 19:59:29 +000059if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib
60
yshi8a29212b2006-05-09 06:11:05 +000061:check_xmlbeans
bbahnsen02996842006-04-21 23:36:37 +000062if "%XMLBEANS_HOME%"=="" goto no_xmlbeans
lhauch42b67fc2006-04-25 19:59:29 +000063if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8
64
yshi8a29212b2006-05-09 06:11:05 +000065@REM
66@REM Set the WORKSPACE to the current working directory
67@REM
68set WORKSPACE=%CD%
lhauch42b67fc2006-04-25 19:59:29 +000069
qouyang2da89682006-06-08 09:11:56 +000070set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin
wuyizhong1ae1cdb2006-05-24 06:59:36 +000071set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%XMLBEANS_HOME%\bin;%Framework_Tools_Path%;%PATH%
yshi8a29212b2006-05-09 06:11:05 +000072
73echo.
74echo JAVA_HOME: %JAVA_HOME%
75echo ANT_HOME: %ANT_HOME%
76echo XMLBEANS_HOME: %XMLBEANS_HOME%
77echo CYGWIN_HOME: %CYGWIN_HOME%
78echo WORKSPACE: %WORKSPACE%
79echo PATH: %PATH%
80echo.
81
82@REM
83@REM Start to build the Framework Tools
84@REM
85
lhauch302e0e42006-06-09 15:26:28 +000086
yshi8a29212b2006-05-09 06:11:05 +000087echo.
88echo Building the Framework Tools
89echo.
90
91@REM
92@REM We are going to create the SurfaceArea.jar file first so that the other
93@REM Java Programs can use it.
94@REM It needs the XMLBEANS libraries in order to compile.
95@REM
lhauch53cef582006-04-28 19:32:18 +000096set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar
97set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar
98set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar;%XMLBEANS_HOME%\lib\resolver.jar
bbahnsen878ddf12006-04-21 22:54:32 +000099
yshi8a29212b2006-05-09 06:11:05 +0000100call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea
bbahnsen878ddf12006-04-21 22:54:32 +0000101
yshi8a29212b2006-05-09 06:11:05 +0000102@REM
bbahnsen878ddf12006-04-21 22:54:32 +0000103@REM Now we can make the other Java Programs
lhauch53cef582006-04-28 19:32:18 +0000104@REM All of the remaining Java Programs require the SurfaceArea library to compile
yshi8a29212b2006-05-09 06:11:05 +0000105@REM
lhauch302e0e42006-06-09 15:26:28 +0000106set CLASSPATH=%CLASSPATH%;%WORKSPACE%\%Tools\Jars\SurfaceArea.jar
bbahnsen878ddf12006-04-21 22:54:32 +0000107
yshi8a29212b2006-05-09 06:11:05 +0000108call ant -f %WORKSPACE%\Tools\build.xml JavaCode
bbahnsen878ddf12006-04-21 22:54:32 +0000109
yshi8a29212b2006-05-09 06:11:05 +0000110@REM
111@REM We have all of the Java Programs and add-in classes created, so we can start
112@REM using the cpp-tasks to create our tools
113@REM
lhauch302e0e42006-06-09 15:26:28 +0000114set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\GenBuild.jar
yshi8a29212b2006-05-09 06:11:05 +0000115set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar;%WORKSPACE%\Tools\Jars\frameworktasks.jar
bbahnsen878ddf12006-04-21 22:54:32 +0000116
yshi8a29212b2006-05-09 06:11:05 +0000117call ant -f %WORKSPACE%\Tools\build.xml C_Code
bbahnsen878ddf12006-04-21 22:54:32 +0000118
yshi8a29212b2006-05-09 06:11:05 +0000119@REM
120@REM Done!!!
121@REM
bbahnsen878ddf12006-04-21 22:54:32 +0000122goto end
123
124:no_jdk
125echo.
bbahnsen02996842006-04-21 23:36:37 +0000126echo !!! Please install Java, and set JAVA_HOME !!!
127echo.
yshi8a29212b2006-05-09 06:11:05 +0000128goto end
bbahnsen02996842006-04-21 23:36:37 +0000129
130:no_ant
131echo.
132echo !!! Please install Apache Ant, and set ANT_HOME !!!
133echo.
yshi8a29212b2006-05-09 06:11:05 +0000134goto end
bbahnsen02996842006-04-21 23:36:37 +0000135
lhauch42b67fc2006-04-25 19:59:29 +0000136:no_antcontrib
137echo.
138echo !!! Please install Ant-contrib to ANT_HOME !!!
139echo.
yshi8a29212b2006-05-09 06:11:05 +0000140goto end
lhauch42b67fc2006-04-25 19:59:29 +0000141
bbahnsen02996842006-04-21 23:36:37 +0000142:no_xmlbeans
143echo.
144echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!
bbahnsen878ddf12006-04-21 22:54:32 +0000145echo.
yshi8a29212b2006-05-09 06:11:05 +0000146goto end
bbahnsen878ddf12006-04-21 22:54:32 +0000147
lhauch42b67fc2006-04-25 19:59:29 +0000148:no_saxon8
149echo.
150echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!
151echo.
yshi8a29212b2006-05-09 06:11:05 +0000152goto end
lhauch42b67fc2006-04-25 19:59:29 +0000153
lhauch302e0e42006-06-09 15:26:28 +0000154:skipbuild
155@REM
156@REM This just sets up the CLASSPATH, the rest of the environment should have been set already.
157@REM
158set WORKSPACE=%CD%
159set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin
160if exist c:\cygwin set CYGWIN_HOME=c:\cygwin
161echo.
162echo JAVA_HOME: %JAVA_HOME%
163echo ANT_HOME: %ANT_HOME%
164echo XMLBEANS_HOME: %XMLBEANS_HOME%
165echo CYGWIN_HOME: %CYGWIN_HOME%
166echo WORKSPACE: %WORKSPACE%
167echo PATH: %PATH%
168echo.
169set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar
170set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar
171set CLASSPATH=%CLASSPATH%;%XMLBEANS_HOME%\lib\saxon8.jar;%XMLBEANS_HOME%\lib\resolver.jar
172set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\SurfaceArea.jar;%WORKSPACE%\Tools\Jars\GenBuild.jar
173set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar;%WORKSPACE%\Tools\Jars\frameworktasks.jar
174goto end
175
bbahnsen878ddf12006-04-21 22:54:32 +0000176:end
177@echo on
178