Convert to unix format.
[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 WORKSPACE=C:\mdk
15
16
17 @REM ##############################################################
18 @REM # You should not have to modify anything below this line
19 @REM #
20
21 @echo off
22
23 :check_vc
24 if defined VCINSTALLDIR goto check_java
25 if defined VS71COMNTOOLS (
26 call "%VS71COMNTOOLS%vsvars32.bat"
27 ) else (
28 echo.
29 echo !!! WARNING !!!! Cannot find Visual Studio !!!
30 echo.
31 )
32
33 :check_java
34 if "%JAVA_HOME%"=="" goto no_jdk
35 echo.
36 echo JAVA_HOME: %JAVA_HOME%
37
38 @REM Set the WORKSPACE to the Current Working Directory
39 set WORKSPACE=%~dp0
40 echo WORKSPACE: %WORKSPACE%
41
42 :set_cygwin
43 if not defined CYGWIN_HOME (
44 if exist c:\cygwin (set CYGWIN_HOME=c:\cygwin) else (
45 echo.
46 echo !!! Not set CYGWIN_HOME, gcc build may not be used !!!
47 echo.
48 )
49 ) else (
50 echo CYGWIN_HOME: %CYGWIN_HOME%
51 )
52
53 if "%ANT_HOME%"=="" goto no_ant
54 echo ANT_HOME: %ANT_HOME%
55 if not exist %ANT_HOME%\lib\ant-contrib.jar goto no_antcontrib
56
57 if "%XMLBEANS_HOME%"=="" goto no_xmlbeans
58 echo XMLBEANS_HOME: %XMLBEANS_HOME%
59
60 set Framework_Tools_Path=%WORKSPACE%\Tools\bin
61
62
63 set PATH=%Framework_Tools_Path%;%PATH%
64
65 echo PATH: %PATH%
66 echo.
67
68 if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8
69
70 echo Building the Tiano Tools
71
72 @REM We are going to create the SurfaceArea.jar file first so that other Java Program can use it
73 set CLASSPATH=%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar;%XMLBEANS_HOME%\lib\saxon8.jar
74
75 call ant -f %WORKSPACE%Tools\build.xml SurfaceArea
76
77 @REM Now we can make the other Java Programs
78 set CLASSPATH=%WORKSPACE%Tools\Jars\SurfaceArea.jar;%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar;%XMLBEANS_HOME%\lib\saxon8.jar
79
80 call ant -f %WORKSPACE%Tools\build.xml JavaCode
81
82 @REM We have all of the Java Programs and add-in classes created, so we can start using the cpp-tasks to create our tools
83 set CLASSPATH=%WORKSPACE%Tools\Jars\SurfaceArea.jar;%WORKSPACE%Tools\Jars\GenBuild.jar;%WORKSPACE%Tools\Jars\cpptasks.jar;%WORKSPACE%Tools\Jars\frameworktasks.jar;%XMLBEANS_HOME%\lib\jsr173_1.0_api.jar;%XMLBEANS_HOME%\lib\xbean.jar;%XMLBEANS_HOME%\lib\xbean_xpath.jar;%XMLBEANS_HOME%\lib\xmlpublic.jar;%XMLBEANS_HOME%\lib\saxon8.jar
84
85 call ant -f %WORKSPACE%Tools\build.xml C_Code
86
87 goto end
88
89 :no_jdk
90 echo.
91 echo !!! Please install Java, and set JAVA_HOME !!!
92 echo.
93 goto end
94
95 :no_ant
96 echo.
97 echo !!! Please install Apache Ant, and set ANT_HOME !!!
98 echo.
99 goto end
100
101 :no_antcontrib
102 echo.
103 echo !!! Please install Ant-contrib to ANT_HOME !!!
104 echo.
105 goto end
106
107 :no_xmlbeans
108 echo.
109 echo !!! Please install XML Beans, and set XMLBEANS_HOME !!!
110 echo.
111 goto end
112
113 :no_saxon8
114 echo.
115 echo !!! Please copy saxon8.jar file to XMLBEANS_HOME\lib !!!
116 echo.
117 goto end
118
119 :end
120 @echo on
121