Here's a handy little batch file to set up your build environment for a specific project that I use. It is also the basis for several other useful batch files I will introduce later. It assumes that Visual Studio 2005 or Visual Studio 2008 are already in your build path and the ASL compiler is in C:\ASL.
Just go to the root directory of your SecureCore Tiano™ 2.0 source code and type:
su <project-name> [<project-version>]
If you just type 'su', it will list all projects available. If you type 'su' and a project name and there is only a single version, that will automatically be selected. If there is more than one version available, then the possible versions will be listed.
The batch file sets up two environment variables: PROJECTROOT (which is the root directory of the code) and PROJECTTIP (which is the build directory).
@if not "%1" == "" goto projectroot
@echo.
@echo Usage:
@echo su project-name [project-version]
@echo.
@echo Options:
@echo project-name Name of the SecureCore Tiano(TM) project.
@echo project-version Version of the SecureCore Tiano(TM) project. Must be
@echo three numeric digits. If not specified, then 000 will
@echo be assumed.
@echo.
@echo Description:
@echo This script sets up the key environment variables for building a project
@echo for SecureCore Tiano(TM) 2.0.
@echo.
@echo Select project-name from one of the following:
@dir /b Projects
@goto end
:projectroot
@if not "%PROJECTROOT%" == "" goto projectrev
@set PROJECTROOT=%CD%
@path=%PROJECTROOT%\tools;%path%
:defaultprojectrev :project :projecttip :end
:projectrev
@set PROJECTTIPREV=%2
@if not "%PROJECTTIPREV%" == "" goto project
@if not exist "%PROJECTROOT%\Projects\%1\001\project.def" goto defaultprojectrev
@echo More than one project revision present at %PROJECTROOT%\Projects\%1.
@echo Please choose with su %1 xxx (where xxx is the revision) from the following:
@dir /b %PROJECTROOT%\Projects\%1
@goto end
@set PROJECTTIPREV=000
@if exist "%PROJECTROOT%\Projects\%1\%PROJECTTIPREV%\project.def" goto projecttip
@echo Could not find project file at %PROJECTROOT%\Projects\%1\%PROJECTTIPREV%.
@goto end
@set PROJECTTIP=%PROJECTROOT%\Projects\%1\%PROJECTTIPREV%



Comments