IntelFsp2WrapperPkg: Fix a typo in the comment
[mirror_edk2.git] / edksetup.bat
CommitLineData
8014e7ce 1@REM @file\r
2@REM Windows batch file to setup a WORKSPACE environment\r
878ddf1f 3@REM\r
cc7c6a37 4@REM Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
24542fb2 5@REM This program and the accompanying materials\r
878ddf1f 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
a29212b2 9@REM\r
878ddf1f 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
a29212b2 14@REM set CYGWIN_HOME=C:\cygwin\r
878ddf1f 15\r
8014e7ce 16@REM usage: \r
17@REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]\r
302e0e4a 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
878ddf1f 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
3fab94ed 27@REM\r
28@REM Set the WORKSPACE to the current working directory\r
29@REM\r
b7509087 30pushd .\r
31cd %~dp0\r
d27bd9e9 32\r
dff2673e 33if not defined WORKSPACE (\r
7ef23d9c 34 goto SetWorkSpace\r
d27bd9e9
LG
35)\r
36\r
dff2673e
LG
37if %WORKSPACE% == %CD% (\r
38 @REM Workspace is not changed.\r
7ef23d9c 39 goto ParseArgs\r
dff2673e
LG
40)\r
41\r
42:SetWorkSpace\r
d27bd9e9
LG
43@REM set new workspace\r
44@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace\r
dcc80786
LG
45if not defined WORKSPACE (\r
46 set WORKSPACE=%CD%\r
47 set EFI_SOURCE=\r
48 set EDK_SOURCE=\r
49)\r
3fab94ed 50\r
d27bd9e9 51:ParseArgs\r
7ef23d9c
OM
52if /I "%1"=="-h" goto Usage\r
53if /I "%1"=="-help" goto Usage\r
54if /I "%1"=="--help" goto Usage\r
55if /I "%1"=="/h" goto Usage\r
56if /I "%1"=="/?" goto Usage\r
57if /I "%1"=="/help" goto Usage\r
8014e7ce 58\r
7ef23d9c 59if /I not "%1"=="--nt32" goto no_nt32\r
8014e7ce 60\r
61@REM Flag, --nt32 is set\r
62@REM The Nt32 Emluation Platform requires Microsoft Libraries\r
63@REM and headers to interface with Windows.\r
64\r
402bbc76 65if not defined VCINSTALLDIR (\r
5d9cd24e
WY
66 if defined VS140COMNTOOLS (\r
67 call "%VS140COMNTOOLS%\vsvars32.bat"\r
402bbc76 68 ) else (\r
5d9cd24e
WY
69 if defined VS120COMNTOOLS (\r
70 call "%VS120COMNTOOLS%\vsvars32.bat"\r
71 ) else ( \r
72 if defined VS110COMNTOOLS (\r
73 call "%VS110COMNTOOLS%\vsvars32.bat"\r
c16243d8 74 ) else (\r
5d9cd24e
WY
75 if defined VS100COMNTOOLS (\r
76 call "%VS100COMNTOOLS%\vsvars32.bat"\r
48604ef9 77 ) else (\r
5d9cd24e
WY
78 if defined VS90COMNTOOLS (\r
79 call "%VS90COMNTOOLS%\vsvars32.bat"\r
4c633da4 80 ) else (\r
5d9cd24e
WY
81 if defined VS80COMNTOOLS (\r
82 call "%VS80COMNTOOLS%\vsvars32.bat"\r
b1763338 83 ) else (\r
5d9cd24e
WY
84 if defined VS71COMNTOOLS (\r
85 call "%VS71COMNTOOLS%\vsvars32.bat"\r
86 ) else (\r
87 echo.\r
88 echo !!! WARNING !!! Cannot find Visual Studio !!!\r
89 echo.\r
90 )\r
b1763338 91 )\r
4c633da4 92 )\r
48604ef9 93 )\r
c16243d8 94 )\r
402bbc76 95 )\r
96 )\r
97)\r
b7509087 98shift\r
b7509087 99\r
3a6b4559 100:no_nt32\r
dcc80786 101\r
7ef23d9c 102if /I "%1"=="NewBuild" shift\r
cc7c6a37
LG
103if not defined EDK_TOOLS_PATH (\r
104 if exist %WORKSPACE%\BaseTools (\r
105 set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
106 ) else (\r
107 if defined PACKAGES_PATH (\r
108 for %%i IN (%PACKAGES_PATH%) DO (\r
109 if exist %%~fi\BaseTools (\r
110 set EDK_TOOLS_PATH=%%~fi\BaseTools\r
111 goto checkBaseTools\r
112 )\r
dcc80786 113 )\r
cc7c6a37
LG
114 ) else (\r
115 echo.\r
116 echo !!! ERROR !!! Cannot find BaseTools !!!\r
117 echo. \r
118 goto BadBaseTools\r
dcc80786 119 )\r
dcc80786
LG
120 )\r
121)\r
122if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
123\r
124:checkBaseTools\r
7ef23d9c
OM
125IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools\r
126call %EDK_TOOLS_PATH%\toolsetup.bat %*\r
127if /I "%1"=="Reconfig" shift\r
910e2062 128goto check_NASM\r
7ef23d9c 129goto check_cygwin\r
8014e7ce 130\r
131:BadBaseTools\r
132 @REM\r
7ef23d9c 133 REM Need the BaseTools Package in order to build\r
8014e7ce 134 @REM\r
7ef23d9c
OM
135 @echo.\r
136 @echo !!! ERROR !!! The BaseTools Package was not found !!!\r
137 @echo.\r
138 @echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,\r
139 @echo For example,\r
140 @echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools\r
141 @echo The setup script, toolsetup.bat must reside in this folder.\r
142 @echo.\r
143 goto end\r
8014e7ce 144\r
910e2062
YZ
145:check_NASM\r
146if not defined NASM_PREFIX (\r
147 @echo.\r
148 @echo !!! WARNING !!! NASM_PREFIX environment variable is not set\r
149 @if exist "C:\nasm\nasm.exe" @set "NASM_PREFIX=C:\nasm\"\r
150 @if exist "C:\nasm\nasm.exe" @echo Found nasm.exe, setting the environment variable to C:\nasm\\r
151 @if not exist "C:\nasm\nasm.exe" echo Attempting to build modules that require NASM will fail.\r
152)\r
153\r
a29212b2 154:check_cygwin\r
1f9c8606
OM
155if defined CYGWIN_HOME (\r
156 if not exist "%CYGWIN_HOME%" (\r
157 @echo.\r
158 @echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!\r
159 @echo.\r
160 )\r
161) else (\r
7ef23d9c
OM
162 if exist c:\cygwin (\r
163 set CYGWIN_HOME=c:\cygwin\r
8014e7ce 164 ) else (\r
3a6b4559 165 @echo.\r
166 @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!\r
167 @echo.\r
8014e7ce 168 )\r
1f9c8606 169)\r
878ddf1f 170\r
1f9c8606
OM
171:cygwin_done\r
172if "%1"=="" goto end\r
2fcfed38 173\r
70edbc34 174:Usage\r
3a6b4559 175 @echo.\r
176 @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"\r
177 @echo --nt32 Call vsvars32.bat for NT32 platform build.\r
178 @echo.\r
179 @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.\r
180 @echo.\r
181 @echo Note that target.template, tools_def.template and build_rules.template\r
1f9c8606
OM
182 @echo will only be copied to target.txt, tools_def.txt and build_rule.txt\r
183 @echo respectively if they do not exist. Use option [Reconfig] to force the copy.\r
3a6b4559 184 @echo.\r
7ef23d9c 185 goto end\r
3fab94ed 186\r
878ddf1f 187:end\r
7ef23d9c 188 popd\r
878ddf1f 189\r