]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/sa-lld.git/blob - sasetupenv.bat
[PDK-6923] Fix build issues due to PDK_COMMON_*_COMP
[keystone-rtos/sa-lld.git] / sasetupenv.bat
1 @REM ******************************************************************************
2 @REM * FILE PURPOSE: Environment Setup for building SA LLD
3 @REM ******************************************************************************
4 @REM * FILE NAME: sasetupenv.bat
5 @REM *
6 @REM * DESCRIPTION: 
7 @REM *  Configures and sets up the Build Environment for SA LLD
8 @REM *
9 @REM *  The batch file expects an optional argument:SALLD_INSTALL_PATH: Location of the SA LLD package.
10 @REM *   If the argument is not specified the  batch file assumes that the SA LLD is installed in the same location 
11 @REM *   where the batch file is located and is being executed.
12 @REM *
13 @REM * USAGE:
14 @REM *  sasetupenv.bat "C:/Program Files/Texas Instruments/salld_2_0_0_0/packages" 
15 @REM *      --- OR ---
16 @REM *  sasetupenv.bat
17 @REM *
18 @REM *  This batch file may be modified per local build environment.
19 @REM *****************************************************************************
21 @echo *******************************************************************************
22 @echo Configuring SA LLD Build Environment
23 @echo off
25 @REM *******************************************************************************
26 @REM ********************** GET PARAMETERS PASSED THROUGH ARGUMENT   ***************
27 @REM *******************************************************************************
28 @REM Parameter Validation: Check if the argument was passed to the batch file and
29 @REM if so we use that else we default to the working directory where the batch 
30 @REM file was invoked from
32 set tempVar=%1
33 IF NOT DEFINED tempVar GOTO noparameter
34 set SALLD_INSTALL_PATH=%~fs1
35 goto done1
36 :noparameter
37 set SALLD_INSTALL_PATH=%~sdp0
38 :done1
40 REM *******************************************************************************
41 REM ********************** CHECK REQUIRED ENVIRONMENT DEFINES BEGIN ***************
42 REM *******************************************************************************
43 if not defined XDC_INSTALL_PATH   @echo "XDC_INSTALL_PATH: XDC NOT CONFIGURED!!!!. REQUIRED FOR XDC BUILD"
44 if not defined C6X_GEN_INSTALL_PATH  goto HLP_C6X_GEN_INSTALL_PATH
45 if not defined PDK_INSTALL_PATH   goto HLP_PDK_INSTALL_PATH 
47 REM *******************************************************************************
48 REM *************************** OPTIONAL ENVIRONMENT DEFINES **********************
49 REM *************************** NOT REQUIRED FOR BUILDING SA LLD  *****************
50 REM *******************************************************************************
51 REM *******************************************************************************
52 REM *******************************************************************************
53 REM *******************************************************************************
55 REM *******************************************************************************
56 REM *************************** Build Variables ***********************************
57 REM *******************************************************************************
59 REM To re-build the SA LLD, it is necessary to set the following environment variables
60 REM based on the build environment .
63 set C6X_GEN_INSTALL_PATH=%C6X_GEN_INSTALL_PATH:\=/%
64 @REM *******************************************************************************
65 @REM ** Convert C6X_GEN_INSTALL_PATH to short name and to UNIX STYLE PATH         **
66 @REM *******************************************************************************
67 if not defined XDC_INSTALL_PATH goto END_SHORT_CONVERSION
68 set PATH=%PATH%;%XDC_INSTALL_PATH%\packages\xdc\services\io\release
69 @REM for /f "tokens=1* delims=" %%a in ('cmd /q/c path2dos %C6X_GEN_INSTALL_PATH%') do set C6X_GEN_INSTALL_PATH=%%a 
71 for /f "tokens=1* delims=" %%a in ('cmd /q/c path2dos %C6X_GEN_INSTALL_PATH%') do set C6X_GEN_INSTALL_PATH=%%a
73 :END_SHORT_CONVERSION
75 REM This is the location where the tools are installed. Please ensure that the names
76 REM are in short format.
77 REM Path of C66 tools 
78 set C66CODEGENTOOL=%C6X_GEN_INSTALL_PATH%
79 set C66X_GEN_INSTALL_DIR=%C6X_GEN_INSTALL_PATH%
82 REM SA Low Level Driver depends upon the following packages:-
83 REM     - CSL Package for the CSL PA Register Layer & Base Address
84 REM These packages should be installed before trying to build the driver else 
85 REM compilations will fail.
87 REM CSL should be included at the PDK
88 set PDK_INSTALL_PATH=%PDK_INSTALL_PATH:\=/%
89 set CSL_INSTALL_DIR=%PDK_INSTALL_PATH%/packages
91 REM SA Install path
92 set SA_INSTALL_DIR=%SALLD_INSTALL_PATH:\=/%
94 REM # Module build options
95 set ARGS_XS=%SA_INSTALL_DIR%\ti\drv\sa\xdcargs.xs
97 REM # Create environment variables for XDC. Modify and enable below variables
98 REM # for location of xdc and XDCPATH
99 REM # 
100 set XDC_INSTALL_DIR=%XDC_INSTALL_PATH%
101 set xdc=%XDC_INSTALL_DIR%/xdc.exe $*
102 set XDCPATH=%SA_INSTALL_DIR%;%CSL_INSTALL_DIR%
104 REM # Windows path
105 set PATH=%SystemRoot%;%SystemRoot%/system32
107 REM # Add XDC path
108 set PATH=%PATH%;%XDC_INSTALL_DIR%;%XDC_INSTALL_DIR%/bin
110 REM # set XDC PATH
111 set XDCPATH=%XDCPATH%;%XDC_INSTALL_DIR%/packages
113 goto SUCCESS
115 :HLP_C6X_GEN_INSTALL_PATH
116 @echo "ENVIRONMENT VARIABLE C6X_GEN_INSTALL_PATH: Code Generation Tool NOT CONFIGURED!!!!"
117 @echo EXAMPLE [DEFAULT LOCATION]: Note the forward slash would be required in windows environment
118 @echo Example: set C6X_GEN_INSTALL_PATH=c:\ti\ccsv5\tools\compiler\c6000_7.4.2
120 goto ERROR
122 :HLP_XDC_INSTALL_DIR
123 @echo EXAMPLE [DEFAULT LOCATION]:
124 @echo  set XDC_INSTALL_PATH=C:/Program Files/Texas Instruments/xdctools_3_22_04_46
126 goto ERROR
128 :HLP_PDK_INSTALL_DIR
129 :HLP_PDK_INSTALL_PATH
130 @echo "ENVIRONMENT VARIABLE PDK_INSTALL_PATH: XDC NOT CONFIGURED!!!!"
131 @echo EXAMPLE [DEFAULT LOCATION]:
132 @echo set PDK_INSTALL_PATH=c:\ti\pdk_keystone2_3_01_00_00\packages
134 goto ERROR
136 :SUCCESS
137 @echo on
138 @echo SA LLD BUILD ENVIRONMENT CONFIGURED
139 @echo *******************************************************************************
140 @echo off
141 goto DONE
143 :ERROR
144 @echo on
145 @echo ERROR CONFIGURING PDK BUILD ENVIRONMENT
146 @echo *******************************************************************************
147 :DONE
149 REM # End of file