]>
Commit | Line | Data |
---|---|---|
1 | @REM @file\r | |
2 | @REM Windows batch file to setup a WORKSPACE environment\r | |
3 | @REM\r | |
4 | @REM Copyright (c) 2006 - 2008, Intel Corporation\r | |
5 | @REM All rights reserved. This program and the accompanying materials\r | |
6 | @REM are licensed and made available under the terms and conditions of the BSD License\r | |
7 | @REM which accompanies this distribution. The full text of the license may be found at\r | |
8 | @REM http://opensource.org/licenses/bsd-license.php\r | |
9 | @REM\r | |
10 | @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | @REM\r | |
13 | \r | |
14 | @REM set CYGWIN_HOME=C:\cygwin\r | |
15 | \r | |
16 | @REM usage: \r | |
17 | @REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]\r | |
18 | @REM if the argument, skip is present, only the paths and the\r | |
19 | @REM test and set of environment settings are performed. \r | |
20 | \r | |
21 | @REM ##############################################################\r | |
22 | @REM # You should not have to modify anything below this line\r | |
23 | @REM #\r | |
24 | \r | |
25 | @echo off\r | |
26 | \r | |
27 | @REM\r | |
28 | @REM Set the WORKSPACE to the current working directory\r | |
29 | @REM\r | |
30 | pushd .\r | |
31 | cd %~dp0\r | |
32 | set WORKSPACE=%CD%\r | |
33 | \r | |
34 | @if /I "%1"=="-h" goto Usage\r | |
35 | @if /I "%1"=="-help" goto Usage\r | |
36 | @if /I "%1"=="--help" goto Usage\r | |
37 | @if /I "%1"=="/h" goto Usage\r | |
38 | @if /I "%1"=="/?" goto Usage\r | |
39 | @if /I "%1"=="/help" goto Usage\r | |
40 | \r | |
41 | @if /I not "%1"=="--nt32" goto no_nt32\r | |
42 | \r | |
43 | @REM Flag, --nt32 is set\r | |
44 | @REM The Nt32 Emluation Platform requires Microsoft Libraries\r | |
45 | @REM and headers to interface with Windows.\r | |
46 | \r | |
47 | if not defined VCINSTALLDIR (\r | |
48 | if defined VS71COMNTOOLS (\r | |
49 | call "%VS71COMNTOOLS%\vsvars32.bat"\r | |
50 | ) else (\r | |
51 | if defined VS80COMNTOOLS (\r | |
52 | call "%VS80COMNTOOLS%\vsvars32.bat"\r | |
53 | ) else (\r | |
54 | echo.\r | |
55 | echo !!! WARNING !!! Cannot find Visual Studio !!!\r | |
56 | echo.\r | |
57 | )\r | |
58 | )\r | |
59 | )\r | |
60 | shift\r | |
61 | \r | |
62 | :no_nt32\r | |
63 | @if /I "%1"=="NewBuild" shift\r | |
64 | @if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r | |
65 | @IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools\r | |
66 | @call %EDK_TOOLS_PATH%\toolsetup.bat %*\r | |
67 | @if /I "%1"=="Reconfig" shift\r | |
68 | @goto check_cygwin\r | |
69 | \r | |
70 | :BadBaseTools\r | |
71 | @REM\r | |
72 | @REM Need the BaseTools Package in order to build\r | |
73 | @REM\r | |
74 | echo.\r | |
75 | echo !!! ERROR !!! The BaseTools Package was not found !!!\r | |
76 | echo.\r | |
77 | echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,\r | |
78 | echo For example,\r | |
79 | echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools\r | |
80 | echo The setup script, toolsetup.bat must reside in this folder.\r | |
81 | echo.\r | |
82 | @goto end\r | |
83 | \r | |
84 | :check_cygwin\r | |
85 | @if exist c:\cygwin (\r | |
86 | @set CYGWIN_HOME=c:\cygwin\r | |
87 | ) else (\r | |
88 | @echo.\r | |
89 | @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!\r | |
90 | @echo.\r | |
91 | )\r | |
92 | \r | |
93 | @if NOT "%1"=="" goto Usage\r | |
94 | @goto end\r | |
95 | \r | |
96 | :Usage\r | |
97 | @echo.\r | |
98 | @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"\r | |
99 | @echo --nt32 Call vsvars32.bat for NT32 platform build.\r | |
100 | @echo.\r | |
101 | @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.\r | |
102 | @echo.\r | |
103 | @echo Note that target.template, tools_def.template and build_rules.template\r | |
104 | @echo will be only copied to target.txt, tools_def.txt and build_rule.txt\r | |
105 | @echo respectively if they do not exist. Using option [Reconfig] to force the copy. \r | |
106 | @echo.\r | |
107 | @goto end\r | |
108 | \r | |
109 | :end\r | |
110 | @popd\r | |
111 | @echo on\r | |
112 | \r |