2 @REM Windows batch file to setup a WORKSPACE environment
4 @REM Copyright
(c
) 2006 - 2016, Intel Corporation. All rights reserved.
<BR
>
5 @REM
(C
) Copyright
2016 Hewlett Packard Enterprise Development LP
<BR
>
6 @REM This program and the accompanying materials
7 @REM are licensed and made available under the terms and conditions of the BSD License
8 @REM which accompanies this distribution. The full text of the license may be found at
9 @REM http
://opensource.org
/licenses
/bsd
-license.php
11 @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN
"AS IS" BASIS
,
12 @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND
, EITHER EXPRESS OR IMPLIED.
15 @REM
set CYGWIN_HOME
=C
:\cygwin
18 @REM edksetup.bat
[--nt32
] [AntBuild
] [Rebuild
] [ForceRebuild
] [Reconfig
]
19 @REM
if the argument
, skip is present
, only the paths and the
20 @REM test and
set of environment settings are performed.
22 @REM ##############################################################
23 @REM # You should
not have to modify anything below this line
29 @REM
Set the WORKSPACE to the current working directory
34 if not defined WORKSPACE
(
38 if %WORKSPACE% == %CD% (
39 @REM Workspace is
not changed.
44 @REM
set new workspace
45 @REM clear EFI_SOURCE and EDK_SOURCE
for the new workspace
46 if not defined WORKSPACE
(
53 if /I
"%1"=="-h" goto Usage
54 if /I
"%1"=="-help" goto Usage
55 if /I
"%1"=="--help" goto Usage
56 if /I
"%1"=="/h" goto Usage
57 if /I
"%1"=="/?" goto Usage
58 if /I
"%1"=="/help" goto Usage
60 if /I
"%1"=="NewBuild" shift
61 if not defined EDK_TOOLS_PATH
(
62 if exist %WORKSPACE%\BaseTools
(
63 set EDK_TOOLS_PATH
=%WORKSPACE%\BaseTools
65 if defined PACKAGES_PATH
(
66 for %%i IN
(%PACKAGES_PATH%) DO (
67 if exist %%~fi\BaseTools
(
68 set EDK_TOOLS_PATH
=%%~fi\BaseTools
74 echo !!! ERROR
!!! Cannot
find BaseTools
!!!
82 if exist %EDK_TOOLS_PATH%\Source
set BASE_TOOLS_PATH
=%EDK_TOOLS_PATH%
84 @REM The Nt32 Emluation Platform requires Microsoft Libraries
85 @REM and headers to interface with Windows.
86 if /I
"%1"=="--nt32" (
89 call "%BASE_TOOLS_PATH%\Scripts\SetVisualStudio.bat"
91 call "%BASE_TOOLS_PATH%\get_vsvars.bat"
97 IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
98 call %EDK_TOOLS_PATH%\toolsetup.bat
%*
99 if /I
"%1"=="Reconfig" shift
105 REM Need the BaseTools Package in order to build
108 @
echo !!! ERROR
!!! The BaseTools Package was
not found
!!!
110 @
echo Set the system environment variable
, EDK_TOOLS_PATH to the BaseTools
,
112 @
echo set EDK_TOOLS_PATH
=C
:\MyTools\BaseTools
113 @
echo The setup script
, toolsetup.bat must reside in this folder.
118 if not defined NASM_PREFIX
(
120 @
echo !!! WARNING
!!! NASM_PREFIX environment variable is
not set
121 @
if exist "C:\nasm\nasm.exe" @
set "NASM_PREFIX=C:\nasm\"
122 @if exist "C
:\nasm
\nasm.exe
" @echo Found nasm.exe, setting the environment variable to C:\nasm\
123 @if not exist "C
:\nasm
\nasm.exe
" echo Attempting to build modules that require NASM will fail.
127 if defined CYGWIN_HOME (
128 if not exist "%CYGWIN_HOME%" (
130 @echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!
135 set CYGWIN_HOME=c:\cygwin
138 @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
148 @echo Usage: "%0 [-h |
-help |
--help |
/h |
/help |
/?
] [--nt32
[X64
]] [Reconfig
]"
149 @echo --nt32 [X64] If a compiler tool chain is not available in the
150 @echo environment, call a script to attempt to set one up.
151 @echo This flag is only required if building the
152 @echo Nt32Pkg/Nt32Pkg.dsc system emulator.
153 @echo If the X64 argument is set, and a compiler tool chain is
154 @echo not available, attempt to set up a tool chain that will
155 @echo create X64 binaries. Setting these two options have the
156 @echo potential side effect of changing tool chains used for a
159 @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.
161 @echo Note that target.template, tools_def.template and build_rules.template
162 @echo will only be copied to target.txt, tools_def.txt and build_rule.txt
163 @echo respectively if they do not exist. Use option [Reconfig] to force the copy.