Merge pull request #3 in PROCESSOR-SDK/traceframework from CATREQ-2702 to master
[keystone-rtos/traceframework.git] / tfsetupenv.bat
1 @REM ******************************************************************************
2 @REM * FILE PURPOSE: Sample Environment Setup for building Trace Framework Producer Library
3 @REM ******************************************************************************
4 @REM * FILE NAME: tfsetupenv.bat
5 @REM *
6 @REM * DESCRIPTION: 
7 @REM *  Configures and sets up the Build Environment for Trace Framework Producer Lib
9 @REM *  The batch file expects an optional argument:PDK_INSTALL_PATH: Location of the PDK package.
10 @REM *   If the argument is not specified the  batch file assumes that the PDK 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 *  pdksetupenv.bat "C:/Program Files/Texas Instruments/pdk_C6670_1_0_0_15/packages"
15 @REM *      --- OR ---
16 @REM *  pdksetupenv.bat
17 @REM *
18 @REM * Copyright (C) 2011, Texas Instruments, Inc.
19 @REM *****************************************************************************
20 @echo off
21 @REM *******************************************************************************
22 @REM ********************** GET PARAMETERS PASSED THROUGH ARGUMENT   ***************
23 @REM *******************************************************************************
24 @REM Parameter Validation: Check if the argument was passed to the batch file and
25 @REM if so we use that else we default to the working directory where the batch 
26 @REM file was invoked from
28 IF DEFINED PDK_INSTALL_PATH  GOTO endparameter
29 set tempVar=%1
30 IF NOT DEFINED tempVar GOTO noparameter
31 set PDK_INSTALL_PATH=%~fs1\..\..\..
32 goto done1
33 :noparameter
34 set PDK_INSTALL_PATH="%CD%\..\..\.."
35 :done1
37 :endparameter
39 @echo ---------------------------------------
40 @echo Configuring Trace Framework Producer Lib Build Environment
42 @REM *******************************************************************************
43 @REM ********************** CHECK REQUIRED ENVIRONMENT DEFINES BEGIN ***************
44 @REM *******************************************************************************
45 if not defined C6X_GEN_INSTALL_PATH      goto HLP_C6X_GEN_INSTALL_PATH
46 set C6X_GEN_INSTALL_PATH=%C6X_GEN_INSTALL_PATH:\=/%
48 if not defined XDC_INSTALL_PATH  goto HLP_XDC_INSTALL_PATH
50 if not defined CG_XML_BIN_INSTALL_PATH   goto HLP_CG_XML_BIN_INSTALL_PATH
51 if not defined UIA_INSTALL_PATH goto HLP_UIA_INSTALL_PATH
53 @REM *******************************************************************************
54 @REM ********************** CHECK REQUIRED ENVIRONMENT DEFINES END ***************
55 @REM *******************************************************************************
58 @echo *******************************************************************************
59 @echo Configuring PDK Build Environment
60 @echo off
62 @REM *******************************************************************************
63 @REM *************************** OPTIONAL ENVIRONMENT DEFINES **********************
64 @REM *************************** NOT REQUIRED FOR BUILDING THE PDK *****************
65 @REM *******************************************************************************
66 @REM STATIC_ANALYZE_PATH: Environment Variable for tool to do STATIC Analysis 
67 @REM                      of the code
68 @REM 
69 @REM DOXYGEN_INSTALL_PATH: DOXYGEN Version 1.7.3 [Only needed for generating Doxygen]
70 @REM 
71 @REM HTML_HELP_WORKSHOP_INSTALL_PATH: HTML Help compiler.[Only needed for generating Doxygen]
72 @REM *******************************************************************************
73 @REM *******************************************************************************
74 @REM *******************************************************************************
76 @REM PDK PARTNO
78 set CGTOOLS=%C6X_GEN_INSTALL_PATH%
80 @REM *******************************************************************************
81 @REM ** Convert C6X_GEN_INSTALL_PATH and PDK_INSTALL_PATH to short name and to UNIX STYLE PATH  for XDC build **
82 @REM *******************************************************************************
83 if not defined XDC_INSTALL_PATH goto END_SHORT_CONVERSION
84 set PATH=%PATH%;%XDC_INSTALL_PATH%\packages\xdc\services\io\release
86 @REM *******************************************************************************
87 @REM This file requires path2dos.exe utility available from XDC tools. If path2dos.exe 
88 @REM is not available in the build environment then short names for paths SHOULD be 
89 @REM provided to environment variables e.g. C:\PROGRA~1\TEXASI~1\PDK_TC~4\packages. 
90 @REM In Windows environment, "dir /x" and "dir /-n" displays the short names generated 
91 @REM for non-8dot3 file and directory names.
92 @REM *******************************************************************************
94 @REM for /f "tokens=1* delims=" %%a in ('cmd /q/c path2dos %PDK_INSTALL_PATH%') do set PDK_INSTALL_PATH=%%a
95 @REM for /f "tokens=1* delims=" %%a in ('cmd /q/c path2dos %C6X_GEN_INSTALL_PATH%') do set C6X_GEN_INSTALL_PATH=%%a
97 for /f "tokens=1* delims=" %%a in ('cmd /q/c path2dos %PDK_INSTALL_PATH%') do set PDK_INSTALL_PATH=%%a
99 for /f "tokens=1* delims=" %%a in ('cmd /q/c path2dos %C6X_GEN_INSTALL_PATH%') do set C6X_GEN_INSTALL_PATH=%%a
101 for /f "tokens=1* delims=" %%a in ('cmd /q/c path2dos %UIA_INSTALL_PATH%') do set UIA_INSTALL_PATH=%%a
103 :END_SHORT_CONVERSION
104 if not defined C6X_GEN_INSTALL_PATH   set C6X_GEN_INSTALL_PATH=%C6X_GEN_INSTALL_PATH:\=/%
105 if not defined PDK_INSTALL_PATH   set PDK_INSTALL_PATH=%PDK_INSTALL_PATH:\=/%
106 if not defined UIA_INSTALL_PATH   set UIA_INSTALL_PATH=%UIA_INSTALL_PATH:\=/%
108 @REM ---------------------------------
109 @REM Enabling debug flags
110 @REM ---------------------------------
111 set EXTDBGFLAGS=-mn -g --optimize_with_debug
113 set XDCCGROOT=%C6X_GEN_INSTALL_PATH%
114 echo CGTOOL INSTALL Directory %C6X_GEN_INSTALL_PATH%
115 echo PDK Directory %PDK_INSTALL_PATH%
117 @echo off
118 @REM *******************************************************************************
119 @REM *************************** XDC PATH Configuration ****************************
120 @REM *******************************************************************************
122 @REM Ensure that all the components inside PDK are a part of the XDC Path; such that
123 @REM one component can use another.
124 set XDCPATH=%XDC_INSTALL_PATH%/packages;%PDK_INSTALL_PATH%/.;%C6X_GEN_INSTALL_PATH%/include;%UIA_INSTALL_PATH%/packages
126 @REM Eclipse Help Plugin (Not required by customers)
127 if defined XDC_ECLIPSE_PLUGIN_INSTALL_PATH set XDCPATH=%XDCPATH%;%XDC_ECLIPSE_PLUGIN_INSTALL_PATH%/.
129 if defined XDC_FILTER_INSTALL_PATH set XDCPATH=%XDCPATH%;%XDC_FILTER_INSTALL_PATH%/.
131 @REM *******************************************************************************
132 @REM ************************** Build Tools Configuration **************************
133 @REM *******************************************************************************
135 @REM Windows Path
136 set PATH=C:\Windows\System32;C:\ccs54\ccsv5\ccs_base\scripting\bin
138 @REM XDC Tools location:
139 set PATH=%PATH%;%XDC_INSTALL_PATH%;%XDC_INSTALL_PATH%\bin
141 @REM Compiler Tools: 
142 set PATH=%PATH%;%C6X_GEN_INSTALL_PATH%\bin
144 @REM CG-XML Package:
145 set PATH=%PATH%;%CG_XML_BIN_INSTALL_PATH%
147 @REM Third Party Tools: Doxygen
148 if defined DOXYGEN_INSTALL_PATH  set PATH=%PATH%;%DOXYGEN_INSTALL_PATH%
150 @REM Third Party Tools: HTML Help compiler.
151 if defined HTML_HELP_WORKSHOP_INSTALL_PATH  set PATH=%PATH%;%HTML_HELP_WORKSHOP_INSTALL_PATH%;
153 @REM Third Party Tools: Install-Jammer (Not required by customers)
154 if defined INSTALL_JAMMER_DIR set PATH=%PATH%;%INSTALL_JAMMER_DIR%
156 @REM Third Party Tools: Coverity 
157 if defined STATIC_ANALYZE_PATH set PATH=%PATH%;%STATIC_ANALYZE_PATH%\bin
159 @REM Set the Title Window appropiately.
160 Title TraceFramework LLD Build Environment
162 goto SUCCESS
164 :HLP_UIA_INSTALL_PATH
165 @echo "ENVIRONMENT VARIABLE UIA_INSTALL_PATH: UIA install Dir path NOT CONFIGURED!!!!"
166 @echo EXAMPLE [DEFAULT LOCATION]: Note the forward slash would be required in windows environment
167 @echo Example: set UIA_INSTALL_PATH=C:/ti/uia_1_01_02_23
168  
169 goto ERROR
171 :HLP_C6X_GEN_INSTALL_PATH
172 @echo "ENVIRONMENT VARIABLEC6X_GEN_INSTALL_PATH: Code Generation Tool NOT CONFIGURED!!!!"
173 @echo Example [NOTE ""]:set C6X_GEN_INSTALL_PATH="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4"
175 goto ERROR
177 :HLP_XDC_INSTALL_PATHpath
178 @echo "ENVIRONMENT VARIABLE XDC_INSTALL_PATH: XDC NOT CONFIGURED!!!!"
179 @echo XDC_INSTALL_PATH EXAMPLE [DEFAULT LOCATION]:
180 @echo  set XDC_INSTALL_PATH=C:/Program Files/Texas Instruments/xdctools_3_22_01_21
181 goto ERROR
183 :HLP_CG_XML_BIN_INSTALL_PATH
184 @echo "ENVIRONMENT VARIABLE CG_XML_BIN_INSTALL_PATH: Code Generation Tools XML package NOT CONFIGURED!!!!"
185 @echo CG_XML_BIN_INSTALL_PATH EXAMPLE [DEFAULT LOCATION]:
186 @echo  set CG_XML_BIN_INSTALL_PATH=C:/Program Files/Texas Instruments/cg_xml/bin
188 goto ERROR
190 :SUCCESS
191 @echo PDK BUILD ENVIRONMENT CONFIGURED
192 @echo *******************************************************************************
193 goto DONE
195 :ERROR
196 @echo ERROR CONFIGURING PDK BUILD ENVIRONMENT
197 @echo *******************************************************************************
199 :DONE