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