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