]> git.proxmox.com Git - mirror_edk2.git/blame - DuetPkg/GetVariables.bat
DuetPkg: Use 'echo off' in BATCH script files
[mirror_edk2.git] / DuetPkg / GetVariables.bat
CommitLineData
ea4511d1 1@echo off\r
7708d081
RN
2@REM ## @file\r
3@REM #\r
4@REM # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
5@REM #\r
6@REM # This program and the accompanying materials\r
7@REM # are licensed and made available under the terms and conditions of the BSD License\r
8@REM # which accompanies this distribution. The full text of the license may be found at\r
9@REM # http://opensource.org/licenses/bsd-license.php\r
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@REM #\r
14@REM ##\r
15\r
16\r
17@REM Read the variables from Conf/target.txt\r
18@REM Because we can't add '=' as a delimiter in 'for', each variable is read in 2 parts:\r
19@REM First we read the "= xyz" part of the variable assignation which we use, along with\r
20@REM the original equal sign for our first assignation. Then we trim any left whitespaces.\r
21@REM NB: default token delimiters for "for /f" are tab and space.\r
22\r
ea4511d1 23set CONFIG_FILE=%WORKSPACE%\Conf\target.txt\r
7708d081 24\r
ea4511d1
HW
25for /f "tokens=1*" %%i in ('type %CONFIG_FILE% ^| find "TOOL_CHAIN_TAG" ^| find /V "#"') do @set TOOL_CHAIN_TAG%%j\r
26for /f "tokens=*" %%i in ("%TOOL_CHAIN_TAG%") do @set TOOL_CHAIN_TAG=%%i\r
7708d081 27\r
ea4511d1
HW
28for /f "tokens=1*" %%i in ('type %CONFIG_FILE% ^| find "TARGET" ^| find /V "#" ^| find /V "TARGET_ARCH"') do @set TARGET%%j\r
29for /f "tokens=*" %%i in ("%TARGET%") do @set TARGET=%%i\r
7708d081 30\r
ea4511d1
HW
31for /f "tokens=1*" %%i in ('type %CONFIG_FILE% ^| find "TARGET_ARCH" ^|find /V "#"') do @set TARGET_ARCH%%j\r
32for /f "tokens=*" %%i in ("%TARGET_ARCH%") do @set TARGET_ARCH=%%i\r
7708d081
RN
33\r
34\r
ea4511d1 35REM Set defaults if above variables are undefined in target.txt\r
7708d081 36\r
ea4511d1
HW
37if "%TOOL_CHAIN_TAG%%"=="" @set TOOL_CHAIN_TAG=MYTOOLS\r
38if "%TARGET%"=="" @set TARGET=DEBUG\r
39if "%TARGET_ARCH%"=="" @set TARGET_ARCH=IA32\r