X-Git-Url: https://git.ti.com/gitweb?p=processor-sdk%2Fpdk.git;a=blobdiff_plain;f=packages%2Fpdksetupenv.bat;h=d3f04e363cc55f8f3415f3572eb1cb48d2b5252b;hp=3f6122eb3cfdb06196e9a0946c814fa1d11f411a;hb=f966f3e8d7dc4e9433ab78e94772aa4d6d12dbb2;hpb=42b8a9ad5c48b2921e49cc8a65d9959ff7e6596d diff --git a/packages/pdksetupenv.bat b/packages/pdksetupenv.bat index 3f6122eb3..d3f04e363 100644 --- a/packages/pdksetupenv.bat +++ b/packages/pdksetupenv.bat @@ -3,7 +3,7 @@ @REM ****************************************************************************** @REM * FILE NAME: pdksetupenv.bat @REM * -@REM * DESCRIPTION: +@REM * DESCRIPTION: @REM * Configures and sets up the Build Environment for PDK. @REM * @REM * The batch file expects an optional argument:PDK_INSTALL_PATH: Location @@ -23,45 +23,56 @@ @REM ********************** GET PARAMETERS PASSED THROUGH ARGUMENT *************** @REM ******************************************************************************* @REM Parameter Validation: Check if the argument was passed to the batch file and -@REM if so we use that else we default to the working directory where the batch +@REM if so we use that else we default to the working directory where the batch @REM file was invoked from +@REM PDK_INSTALL_PATH if it is passed as an argument. +set pdk_path=%1 + +set PDK_INSTALL_PATH=%CD% + +if defined pdk_path ( +@REM Use the PDK install path if passed as an argument +set PDK_INSTALL_PATH=%pdk_path% +) + +@REM Find the PDK_SOC/PDK_VER by going to the procsdk\pdk directory. +cd %PDK_INSTALL_PATH%\.. -@REM Find the PDK SOC and Version from the directory name -cd ..\ set s=%CD:\= % for %%a in (%s%) do ( - set pdkdir=%%a + set pdkdir=%%a ) - -for /f "tokens=1,2,3,4,5 delims=/_" %%a in ("%pdkdir%") do set pdk_soc=%%b&set v1=%%c&set v2=%%d&set v3=%%e +for /f "tokens=1,2,3,4,5 delims=/_" %%a in ("%pdkdir%") do set pdksoc=%%b&set v1=%%c&set v2=%%d&set v3=%%e set pdkdir_ver=%v1%_%v2%_%v3% -@REM Find the SDK directory to set SDK_INSTALL_PATH if it is not already set -cd .. -set sdkdir=%CD% +@REM When pdk folder represents a device family, set a default SOC for that family +if %pdksoc% == jacinto ( + set pdksoc=j721e +) -@REM return to the original directory (pdk_*/packages) -cd %pdkdir% -cd packages +@REM Go to the SDK install directory +cd %PDK_INSTALL_PATH%\..\.. +@REM Find the SDK directory to set SDK_INSTALL_PATH if it is not already set +set sdkdir=%CD:\=/% if not defined SDK_INSTALL_PATH ( set SDK_INSTALL_PATH=%sdkdir% ) -if not defined PDK_INSTALL_PATH ( - set PDK_INSTALL_PATH=%SDK_INSTALL_PATH%/%pdkdir%/packages -) @REM PDK SoC and version if not defined PDK_SOC ( - set PDK_SOC=%pdk_soc% + set PDK_SOC=%pdksoc% ) if not defined PDK_VERSION ( set PDK_VERSION=%pdkdir_ver% ) +@REM return to the original directory (pdk_*/packages) +cd %PDK_INSTALL_PATH% + @REM Find the XDC version from pdk/packages/ti/build/pdk_tools_path.mk for /f %%i IN ('findstr "XDC_VERSION=" %PDK_INSTALL_PATH%\ti\build\pdk_tools_path.mk') do set xdcver=%%i for /f "tokens=1,2 delims=//=" %%a in ("%xdcver%") do set XDC_VERSION=%%b @@ -70,10 +81,11 @@ if not defined GMAKE_INSTALL_PATH ( set GMAKE_INSTALL_PATH=%SDK_INSTALL_PATH%/xdctools_%XDC_VERSION% ) set GMAKE_INSTALL_PATH=%GMAKE_INSTALL_PATH:\=/% -@REM GMAKE Tool location; Uncomment the following line to set the +@REM GMAKE Tool location; Uncomment the following line to set the @REM gmake install path into env PATH variable. set PATH=%GMAKE_INSTALL_PATH:/=\%;%PATH% +set PDK_INSTALL_PATH=%PDK_INSTALL_PATH:\=/% @REM Define Rules.make set RULES_MAKE=%PDK_INSTALL_PATH%/ti/build/Rules.make