VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/edksetup.bat@ 83298

Last change on this file since 83298 was 80721, checked in by vboxsync, 5 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • Property svn:eol-style set to CRLF
  • Property svn:executable set to *
File size: 4.4 KB
Line 
1@REM @file
2@REM Windows batch file to setup a WORKSPACE environment
3@REM
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 SPDX-License-Identifier: BSD-2-Clause-Patent
7@REM
8
9@REM set CYGWIN_HOME=C:\cygwin
10
11@REM usage:
12@REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]
13@REM if the argument, skip is present, only the paths and the
14@REM test and set of environment settings are performed.
15
16@REM ##############################################################
17@REM # You should not have to modify anything below this line
18@REM #
19
20@echo off
21
22@REM
23@REM Set the WORKSPACE to the current working directory
24@REM
25pushd .
26cd %~dp0
27
28if not defined WORKSPACE (
29 goto SetWorkSpace
30)
31
32if %WORKSPACE% == %CD% (
33 @REM Workspace is not changed.
34 goto ParseArgs
35)
36
37:SetWorkSpace
38@REM set new workspace
39if not defined WORKSPACE (
40 set WORKSPACE=%CD%
41)
42
43:ParseArgs
44if /I "%1"=="-h" goto Usage
45if /I "%1"=="-help" goto Usage
46if /I "%1"=="--help" goto Usage
47if /I "%1"=="/h" goto Usage
48if /I "%1"=="/?" goto Usage
49if /I "%1"=="/help" goto Usage
50
51if /I "%1"=="NewBuild" shift
52if not defined EDK_TOOLS_PATH (
53 goto SetEdkToolsPath
54) else (
55 goto checkNt32Flag
56)
57
58:SetEdkToolsPath
59if %WORKSPACE:~-1% EQU \ (
60 @set EDK_BASETOOLS=%WORKSPACE%BaseTools
61) else (
62 @set EDK_BASETOOLS=%WORKSPACE%\BaseTools
63)
64if exist %EDK_BASETOOLS% (
65 set EDK_TOOLS_PATH=%EDK_BASETOOLS%
66 set EDK_BASETOOLS=
67) else (
68 if defined PACKAGES_PATH (
69 for %%i IN (%PACKAGES_PATH%) DO (
70 if exist %%~fi\BaseTools (
71 set EDK_TOOLS_PATH=%%~fi\BaseTools
72 goto checkNt32Flag
73 )
74 )
75 ) else (
76 echo.
77 echo !!! ERROR !!! Cannot find BaseTools !!!
78 echo.
79 goto BadBaseTools
80 )
81)
82
83:checkNt32Flag
84if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
85
86:checkBaseTools
87IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
88call %EDK_TOOLS_PATH%\toolsetup.bat %*
89if /I "%1"=="Reconfig" shift
90goto check_NASM
91goto check_cygwin
92
93:BadBaseTools
94 @REM
95 REM Need the BaseTools Package in order to build
96 @REM
97 @echo.
98 @echo !!! ERROR !!! The BaseTools Package was not found !!!
99 @echo.
100 @echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,
101 @echo For example,
102 @echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools
103 @echo The setup script, toolsetup.bat must reside in this folder.
104 @echo.
105 goto end
106
107:check_NASM
108if not defined NASM_PREFIX (
109 @echo.
110 @echo !!! WARNING !!! NASM_PREFIX environment variable is not set
111 @if exist "C:\nasm\nasm.exe" @set "NASM_PREFIX=C:\nasm\"
112 @if exist "C:\nasm\nasm.exe" @echo Found nasm.exe, setting the environment variable to C:\nasm\
113 @if not exist "C:\nasm\nasm.exe" echo Attempting to build modules that require NASM will fail.
114)
115
116:check_cygwin
117if defined CYGWIN_HOME (
118 if not exist "%CYGWIN_HOME%" (
119 @echo.
120 @echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!
121 @echo.
122 )
123) else (
124 if exist c:\cygwin (
125 set CYGWIN_HOME=c:\cygwin
126 ) else (
127 @echo.
128 @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
129 @echo.
130 )
131)
132
133:cygwin_done
134if /I "%1"=="Rebuild" shift
135if /I "%1"=="ForceRebuild" shift
136if /I "%1"=="VS2017" shift
137if /I "%1"=="VS2015" shift
138if /I "%1"=="VS2013" shift
139if /I "%1"=="VS2012" shift
140if "%1"=="" goto end
141
142:Usage
143 @echo.
144 @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Rebuild] [ForceRebuild] [VS2017] [VS2015] [VS2013] [VS2012]"
145 @echo.
146 @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.
147 @echo Rebuild Perform incremental rebuild of BaseTools binaries.
148 @echo ForceRebuild Force a full rebuild of BaseTools binaries.
149 @echo VS2012 Set the env for VS2012 build.
150 @echo VS2013 Set the env for VS2013 build.
151 @echo VS2015 Set the env for VS2015 build.
152 @echo VS2017 Set the env for VS2017 build.
153 @echo.
154 @echo Note that target.template, tools_def.template and build_rules.template
155 @echo will only be copied to target.txt, tools_def.txt and build_rule.txt
156 @echo respectively if they do not exist. Use option [Reconfig] to force the copy.
157 @echo.
158 goto end
159
160:end
161 popd
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette