1 @REM ******************************************************************************
2 @REM * FILE PURPOSE: Environment Setup for building Bootloader
3 @REM ******************************************************************************
4 @REM * FILE NAME: setupenv.bat
5 @REM *
6 @REM * DESCRIPTION:
7 @REM * Configures and sets up the Build Environment for Bootloader in DOS environment.
8 @REM *
9 @REM * Customers are expected to modify this file as per their build environment.
10 @REM *
11 @REM * USAGE:
12 @REM * setupenv.bat
13 @REM * :bypass
14 @REM * configure environment without checking tools. This option is
15 @REM * is used when the user will manually configure the tools.
16 @REM *
17 @REM * :enable_write
18 @REM * [*** DANGEROUS OPTION ***]
19 @REM * Updates the tool in local drive
20 @REM *
21 @REM * :No arguments: Sets the environment for building, Verifies local
22 @REM * tools and reports if any tool update is required
23 @REM *
24 @REM * Copyright (C) 2010, Texas Instruments, Inc.
25 @REM *****************************************************************************
27 @echo off
29 REM Setup the ibl build environment
31 REM Modify following lines based on target environment for the toolset installed
32 REM Dependency is related to path for Cygwin and CGEN installed
34 set PATH=t:\gen\gnu\99-11-01\cygwin-b20\H-i586-cygwin32\bin;C:\PROGRA~1\TEXASI~1\C6000C~1.12\bin
35 set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%;
37 set PERL=//t/gen/perl/activestate/5_6_1_635/bin/perl
38 set PERLDOS=t:\gen\perl\activestate\5_6_1_635\bin\perl
40 set CYGWINPATH=//t/gen/gnu/99-11-01/cygwin-b20/H-i586-cygwin32/bin
41 set TOOLSC6X=C:/PROGRA~1/TEXASI~1/C6000C~1.12
42 set TOOLSC6XDOS=C:\PROGRA~1\TEXASI~1\C6000C~1.12
44 set TOOLC6XSRC=t:\c6xx\cgen6_1_12\c6000\cgtools
45 set TOOLC6XDST=C:\PROGRA~1\TEXASI~1\C6000C~1.12
48 rem ************************* Tools Copy/Validation **************************
49 rem If the "bypass" option is not provided, validate/copy the tools
50 rem *********************************************************************
51 if "%1" == "bypass" goto environment
53 rem check, but don't copy tools
54 if "%1" == "" goto toolcheck
56 rem copy tools if check fails
57 if "%1" == "enable_write" goto toolcopy
59 rem error: invalid argument
60 echo =========================== INVALID ARGUMENT ============================
61 echo Option "%1" is invalid. Valid options are:
62 echo "bypass": configure environment without checking tools
63 echo "enable_write": *****ERASE***** all files in %TOOLDST%,
64 echo and replace with correct tools
65 echo =========================== INVALID ARGUMENT ============================
66 goto end
68 :toolcheck
69 echo Verifying local tools
70 goto toolperl
72 :toolcopy
73 echo UPDATING local tools
74 :toolperl
75 %PERLDOS% make\cpytools\cpytools.pl %TOOLC6XSRC% %TOOLC6XDST% %1
76 rem note: windows is stupid; "errorlevel 1" means "retval >= 1"
77 if errorlevel 1 goto error
79 echo Local tools are good
80 goto environment
83 rem ************************** Bad Tools *************************************
84 rem Tools are bad; deconfigure environment and print error
85 rem **************************************************************************
86 :error
87 set TOOLS=
88 set TOOLSDOS=
90 echo ============================== BAD TOOLS =================================
91 echo * Build environment is NOT configured. You may rerun script with:
92 echo *
93 echo * %0 bypass
94 echo * configure environment without checking tools. This option is
95 echo * is used when the user will manually configure the tools.
96 echo *
97 echo * %0 enable_write
98 echo * [*** DANGEROUS OPTION ***]
99 echo * This option
100 echo * 1) *** DANGER *** Recursively deletes all files in subdirectories
101 echo * %DST365% and %TOOLDST%
102 echo * 2) Copies correct tools from the subdirectories
103 echo * %SRC365% and %TOOLSRC%
104 echo *
105 echo ============================== BAD TOOLS =================================
107 :environment
108 :end