niruiyu | 7708d08 | 2011-07-01 04:48:45 +0000 | [diff] [blame] | 1 | @REM ## @file
|
| 2 | @REM #
|
| 3 | @REM # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
|
| 4 | @REM #
|
| 5 | @REM # This program and the accompanying materials
|
| 6 | @REM # are licensed and made available under the terms and conditions of the BSD License
|
| 7 | @REM # which accompanies this distribution. The full text of the license may be found at
|
| 8 | @REM # http://opensource.org/licenses/bsd-license.php
|
| 9 | @REM # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
| 10 | @REM # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
| 11 | @REM #
|
| 12 | @REM #
|
| 13 | @REM ##
|
| 14 |
|
| 15 |
|
| 16 | @REM Read the variables from Conf/target.txt
|
| 17 | @REM Because we can't add '=' as a delimiter in 'for', each variable is read in 2 parts:
|
| 18 | @REM First we read the "= xyz" part of the variable assignation which we use, along with
|
| 19 | @REM the original equal sign for our first assignation. Then we trim any left whitespaces.
|
| 20 | @REM NB: default token delimiters for "for /f" are tab and space.
|
| 21 |
|
| 22 | @set CONFIG_FILE=%WORKSPACE%\Conf\target.txt
|
| 23 |
|
| 24 | @for /f "tokens=1*" %%i in ('type %CONFIG_FILE% ^| find "TOOL_CHAIN_TAG" ^| find /V "#"') do @set TOOL_CHAIN_TAG%%j
|
| 25 | @for /f "tokens=*" %%i in ("%TOOL_CHAIN_TAG%") do @set TOOL_CHAIN_TAG=%%i
|
| 26 |
|
| 27 | @for /f "tokens=1*" %%i in ('type %CONFIG_FILE% ^| find "TARGET" ^| find /V "#" ^| find /V "TARGET_ARCH"') do @set TARGET%%j
|
| 28 | @for /f "tokens=*" %%i in ("%TARGET%") do @set TARGET=%%i
|
| 29 |
|
| 30 | @for /f "tokens=1*" %%i in ('type %CONFIG_FILE% ^| find "TARGET_ARCH" ^|find /V "#"') do @set TARGET_ARCH%%j
|
| 31 | @for /f "tokens=*" %%i in ("%TARGET_ARCH%") do @set TARGET_ARCH=%%i
|
| 32 |
|
| 33 |
|
| 34 | @REM Set defaults if above variables are undefined in target.txt
|
| 35 |
|
| 36 | @if "%TOOL_CHAIN_TAG%%"=="" @set TOOL_CHAIN_TAG=MYTOOLS
|
| 37 | @if "%TARGET%"=="" @set TARGET=DEBUG
|
| 38 | @if "%TARGET_ARCH%"=="" @set TARGET_ARCH=IA32
|