]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Scripts/ShowEnvironment.bat
BaseTools/tools_def.template: Remove DDK3790
[mirror_edk2.git] / BaseTools / Scripts / ShowEnvironment.bat
1 @REM @file
2 @REM Windows batch file to display the Windows environment
3 @REM
4 @REM This script will be used to show the current EDK II build environment.
5 @REM it may be called by the Edk2Setup.bat (that will be renamed to edksetup.bat) or
6 @REM run as stand-alone application.
7 @REM
8 @REM Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
9 @REM This program and the accompanying materials
10 @REM are licensed and made available under the terms and conditions of the BSD License
11 @REM which accompanies this distribution. The full text of the license may be found at
12 @REM http://opensource.org/licenses/bsd-license.php
13 @REM
14 @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 @REM
17 @echo off
18 @set SE_SVN_REVISION=$Revision: 8 $
19 @set SE_VERSION=0.7.0.
20 @if "%SCRIPT%"=="EDKSETUP_BAT" goto SkipCmdlineArgumentCheck
21
22 :parse_cmd_line
23 @if /I "%1"=="-h" @goto Usage
24 @if /I "%1"=="--help" @goto Usage
25 @if /I "%1"=="/?" @goto Usage
26 @if /I "%1"=="-v" @goto Version
27 @if /I "%1"=="--version" @goto Version
28
29 :Usage
30 @echo Usage: ShowEnvironment.bat [Options]
31 @echo Copyright(c) 2014, Intel Corporation. All rights reserved.
32 @echo.
33 @echo Options:
34 @echo --help, -h Print this help screen and exit
35 @echo --version, -v Print this tool's version and exit
36 @echo.
37 @goto End
38
39 :Version
40 @echo ShowEnvironment.bat Version: %SE_VERSION%%SE_SVN_REVISION:~11,-1%
41 @echo Copyright(c) 2014, Intel Corporation. All rights reserved.
42
43 :SkipCmdlineArgumentCheck
44 if defined SRC_CONF @goto SetEnv
45
46 @echo.
47 @echo #############################################################################
48 @if defined WORKSPACE @echo WORKSPACE = %WORKSPACE%
49 @if not defined WORKSPACE @echo WORKSPACE = Not Set
50 @if defined PACKAGES_PATH @echo PACKAGES_PATH = %PACKAGES_PATH%
51 @if defined EDK_TOOLS_PATH @echo EDK_TOOLS_PATH = %EDK_TOOLS_PATH%
52 @if not defined EDK_TOOLS_PATH @echo EDK_TOOLS_PATH = Not Set
53 @if defined BASE_TOOLS_PATH @echo BASE_TOOLS_PATH = %BASE_TOOLS_PATH%
54 @if defined EDK_TOOLS_BIN @echo EDK_TOOLS_BIN = %EDK_TOOLS_BIN%
55 @if "%NT32PKG%"=="TRUE" (
56 @echo.
57 @echo NOTE: Please configure your build to use the following TOOL_CHAIN_TAG
58 @echo when building NT32Pkg/Nt32Pkg.dsc
59 @if defined VCINSTALLDIR @call :CheckVsVer
60 @set TEST_VS=
61 )
62 @if defined HIDE_PATH goto End
63
64
65 @echo ############################## PATH #########################################
66 @setlocal DisableDelayedExpansion
67 @set "var=%PATH%"
68 @set "var=%var:"=""%"
69 @set "var=%var:^=^^%"
70 @set "var=%var:&=^&%"
71 @set "var=%var:|=^|%"
72 @set "var=%var:<=^<%"
73 @set "var=%var:>=^>%"
74 @set "var=%var:;=^;^;%"
75 @set var=%var:""="%
76 @set "var=%var:"=""Q%"
77 @set "var=%var:;;="S"S%"
78 @set "var=%var:^;^;=;%"
79 @set "var=%var:""="%"
80 @setlocal EnableDelayedExpansion
81 @set "var=!var:"Q=!"
82 @for %%a in ("!var:"S"S=";"!") do (
83 @if "!!"=="" endlocal
84 @if %%a neq "" echo %%~a
85 )
86 @goto End
87
88 :CheckVsVer
89 @set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 9.0\"
90 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
91 @echo TOOL_CHAIN_TAG = VS2008x86
92 @goto :EOF
93 )
94 @set "TEST_VS=C:\Program Files\Microsoft Visual Studio 9.0\"
95 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
96 @echo TOOL_CHAIN_TAG = VS2008
97 @goto :EOF
98 )
99
100 @set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\"
101 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
102 @echo TOOL_CHAIN_TAG = VS2010x86
103 @goto :EOF
104 )
105 @set "TEST_VS=C:\Program Files\Microsoft Visual Studio 10.0\"
106 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
107 @echo TOOL_CHAIN_TAG = VS2010
108 @goto :EOF
109 )
110
111 @set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\"
112 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
113 @echo TOOL_CHAIN_TAG = VS2012x86
114 @goto :EOF
115 )
116 @set "TEST_VS=C:\Program Files\Microsoft Visual Studio 11.0\"
117 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
118 @echo TOOL_CHAIN_TAG = VS2012
119 @goto :EOF
120 )
121
122 @set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\"
123 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
124 @echo TOOL_CHAIN_TAG = VS2013x86
125 @goto :EOF
126 )
127 @set "TEST_VS=C:\Program Files\Microsoft Visual Studio 12.0\"
128 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
129 @echo TOOL_CHAIN_TAG = VS2013
130 @goto :EOF
131 )
132
133 @set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\"
134 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
135 @echo TOOL_CHAIN_TAG = VS2015x86
136 @goto :EOF
137 )
138 @set "TEST_VS=C:\Program Files\Microsoft Visual Studio 14.0\"
139 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
140 @echo TOOL_CHAIN_TAG = VS2015
141 @goto :EOF
142 )
143 @goto :EOF
144
145 :SetEnv
146 @set FIRST_COPY=FALSE
147 @set MISSING_TARGET_TEMPLATE=FALSE
148 @set MISSING_TOOLS_DEF_TEMPLATE=FALSE
149 @set MISSING_BUILD_RULE_TEMPLATE=FALSE
150 @if not exist "%SRC_CONF%\target.template" @set MISSING_TARGET_TEMPLATE=TRUE
151 @if not exist "%SRC_CONF%\tools_def.template" @set MISSING_TOOLS_DEF_TEMPLATE=TRUE
152 @if not exist "%SRC_CONF%\build_rule.template" @set MISSING_BUILD_RULE_TEMPLATE=TRUE
153
154 @if not exist "%WORKSPACE%\Conf\target.txt" (
155 @if "%MISSING_TARGET_TEMPLATE%"=="TRUE" @goto MissingTemplates
156 @echo copying ... target.template to %WORKSPACE%\Conf\target.txt
157 @copy /Y "%SRC_CONF%\target.template" "%WORKSPACE%\Conf\target.txt" > nul
158 @set FIRST_COPY=TRUE
159 )
160 @if not exist "%WORKSPACE%\Conf\tools_def.txt" (
161 @if "%MISSING_TOOLS_DEF_TEMPLATE%"=="TRUE" @goto MissingTemplates
162 @echo copying ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt
163 @copy /Y "%SRC_CONF%\tools_def.template" "%WORKSPACE%\Conf\tools_def.txt" > nul
164 @set FIRST_COPY=TRUE
165 )
166 @if not exist "%WORKSPACE%\Conf\build_rule.txt" (
167 @if "%MISSING_BUILD_RULE_TEMPLATE%"=="TRUE" @goto MissingTemplates
168 @echo copying ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt
169 @copy /Y "%SRC_CONF%\build_rule.template" "%WORKSPACE%\Conf\build_rule.txt" > nul
170 @set FIRST_COPY=TRUE
171 )
172
173 @if "%FIRST_COPY%"=="TRUE" @goto End
174 @if not "%RECONFIG%"=="TRUE" @goto End
175
176 @if "%RECONFIG%"=="TRUE" (
177 @echo.
178 @echo Over-writing the files in the WORKSPACE\Conf directory
179 @echo using the default template files
180 @echo.
181 @if "%MISSING_TARGET_TEMPLATE%"=="TRUE" @goto MissingTemplates
182 @echo over-write ... target.template to %WORKSPACE%\Conf\target.txt
183 @copy /Y "%SRC_CONF%\target.template" "%WORKSPACE%\Conf\target.txt" > nul
184
185 @if "%MISSING_TOOLS_DEF_TEMPLATE%"=="TRUE" @goto MissingTemplates
186 @echo over-write ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt
187 @copy /Y "%SRC_CONF%\tools_def.template" "%WORKSPACE%\Conf\tools_def.txt" > nul
188
189 @if "%MISSING_BUILD_RULE_TEMPLATE%"=="TRUE" @goto MissingTemplates
190 @echo over-write ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt
191 @copy /Y "%SRC_CONF%\build_rule.template" "%WORKSPACE%\Conf\build_rule.txt" > nul
192 @goto End
193 )
194
195 :MissingTemplates
196 @echo.
197 @if "%RECONFIG%"=="TRUE" @echo ERROR : Reconfig failed
198 @if "%MISSING_TARGET_TEMPLATE%"=="TRUE" @echo ERROR : Unable to locate: "%SRC_CONF%\target.template"
199 @if "%MISSING_TOOLS_DEF_TEMPLATE%"=="TRUE" @echo ERROR : Unable to locate: "%SRC_CONF%\tools_def.template"
200 @if "%MISSING_BUILD_RULE_TEMPLATE%"=="TRUE" @echo ERROR : Unable to locate: "%SRC_CONF%\build_rule.template"
201 @echo.
202 @set MISSING_TARGET_TEMPLATE=
203 @set MISSING_TOOLS_DEF_TEMPLATE=
204 @set MISSING_BUILD_RULE_TEMPLATE=
205 @set FIRST_COPY=
206 @set SE_VERSION=
207 @set SE_SVN_REVISION=
208 @if not "%SCRIPT%"=="EDKSETUP_BAT" @echo on
209 exit /B 1
210
211 :End
212 @set MISSING_TARGET_TEMPLATE=
213 @set MISSING_TOOLS_DEF_TEMPLATE=
214 @set MISSING_BUILD_RULE_TEMPLATE=
215 @set FIRST_COPY=
216 @set SE_VERSION=
217 @set SE_SVN_REVISION=
218 @if not "%SCRIPT%"=="EDKSETUP_BAT" @echo on
219 exit /B 0