Tornado API Reference : Project Scripting Library

cmpScriptLib

NAME

cmpScriptLib - TCL scripting commands for project manipulation

TCL PROCEDURES

cmpProjOpen - open a project
cmpProjClose - close the currently open project
cmpProjCreate - create a project and open it
cmpProjCopy - create a copy of an existing project and open it
cmpProjDelete - delete the currently open project
cmpProjHandleGet - get the handle to the currently open project
cmpBuild - build the project
cmpBuildRuleSet - set the build rule for the project
cmpBuildSpecSet - set the active buildSpec
cmpBuildSpecCreate - create a new buildSpec
cmpBuildMacroSet - set a build macro
cmpBuildMacroGet - get a build macro
cmpBuildFlagsAdd - add flags to the build
cmpAdd - add components to vxWorks
cmpRemove - remove components from vxWorks
cmpListGet - get a list of components in vxWorks
cmpParamSet - set a parameter in the current project
cmpParamGet - get a parameter
cmpFileListGet - get a list of files in the project
cmpFileAdd - add a file to the project
cmpFileRemove - remove a file from the project
cmpLoad - dynamically load components
autoscale - automatically scale vxWorks
cmpUnavailListGet - list unavailable components
cmpValidate - validate the component configuration
cmpTest - test the component descriptor files for errors
cmpInfo - get info about a set of components

DESCRIPTION

Tornado comes with a project facility that allows one to graphically organize source files into projects, change the build rules, and configure the operating system. See the Tornado Users Guide for details on what facilities the project facility offers. This library provides a way to perform these tasks in a script. To use this library, one must first source this library from wtxtcl. As an example, suppose you wanted to do a clean build of your project every night. One could write a script as follows:

example.tcl:

source [wtxPath host resource app-config Project cmpScriptLib.tcl]
cmpProjOpen  myProjectFile.wpj
cmpBuild     clean
cmpBuild
One can execute the script from a UNIX or Windows command shell by typing "wtxtcl example.tcl." Alternatively, one can type the scripting commands directly into the wtxtcl shell.

SEE ALSO

cmpScriptLib, dataDocLib


Project Scripting Library : Tcl Procedures

cmpProjOpen

NAME

cmpProjOpen - open a project

DESCRIPTION

This routine opens a project file and sets it as the active project for all subsequent scripting commands. This first closes any project that was previously opened.

PARAMETERS

prjFile - project file to open

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpProjClose

NAME

cmpProjClose - close the currently open project

DESCRIPTION

Close and save the currently open project.

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpProjCreate

NAME

cmpProjCreate - create a project and open it

DESCRIPTION

This routine creates a project and opens it. If the project already exists, it just opens it. The last argument to this routine is prjType, which can be either vxWorks (a system image project), or vxApp (a downloadable application). The default is vxWorks. The project file to be created must live in a directory which does not already exists, and by convension should end in a .wpj extension.

For vxWorks projects, arg should be the name of a BSP directory in target/config (e.g., pc386) If no project file name is specified, a default project name of $(WIND_BASE)/target/proj/bsp_vx/bsp_vx.wpj is used, where bsp is the name of the BSP directory.

For vxApp projects, arg should be the name of a toolchain, in the form ::tc_CPUTOOL (e.g., ::tc_PPC604gnu).

PARAMETERS

arg - prjType-specific argument
prjFile - name of the project file to be created
prjType - type of project (vxWorks or vxApp)

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpProjCopy

NAME

cmpProjCopy - create a copy of an existing project and open it

DESCRIPTION

Make a copy of an existing project, and open the copy. This is useful if you want to make configuration changes but not disturb the original project. The project file being created has the same restrictions as described in cmpProjCreate.

PARAMETERS

newPrjFile - project file to create
oldPrjFile - existing project file

SEE ALSO

cmpScriptLib, cmpProjCreate

RETURNS

N/A


Project Scripting Library : Tcl Procedures

cmpProjDelete

NAME

cmpProjDelete - delete the currently open project

DESCRIPTION

Delete the currently open project.

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpProjHandleGet

NAME

cmpProjHandleGet - get the handle to the currently open project

DESCRIPTION

This routine returns the "project handle" to the currently open project. Since this library supports only one open project at a time, one does not need to use this routine in order to use this library. However this library is built on top of lower-level libraries that must be passed a project handle. These libraries are currently not documented

RETURNS

a project handle

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpBuild

NAME

cmpBuild - build the project

DESCRIPTION

This routine builds the project using the currently active buildSpec. The build output goes to stdout and stderr. If no rule is specified, it builds the default rule for the currently active buildSpec. The "clean" rule removes all binaries.

PARAMETERS

rule - (optional) build rule to invoke

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpBuildRuleSet

NAME

cmpBuildRuleSet - set the build rule for the project

DESCRIPTION

This routine sets the default build rule for the active buildSpec within the currently open project. Available build rules depend on the project type. For example, vxWorks projects support clean, vxWorks, vxWorks_rom, vxWorks_romResident, and vxWorks_romCompress. vxApp projects support linkedObjs, archive, and objects.

PARAMETERS

rule - build rule to set

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpBuildSpecSet

NAME

cmpBuildSpecSet - set the active buildSpec

DESCRIPTION

A project can contain one or more buildSpecs. This routine is used to set the active buildSpec.

PARAMETERS

build - name of the buildSpec to set as active

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpBuildSpecCreate

NAME

cmpBuildSpecCreate - create a new buildSpec

DESCRIPTION

Create a new buildSpec for the project, and set it as the active buildSpec. One can create a buildSpec by copying an existing buildSpec, or create a new one for a different toolchain. If arg is of the form ::tc_CPUTOOL (e.g., ::tc_PPC604gnu), then a build is created for that toolchain. Otherwise arg is interpreted to be the name of an existing build.

PARAMETERS

build - name of the buildSpec to create
arg - name of a toolchain or existing build

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpBuildMacroSet

NAME

cmpBuildMacroSet - set a build macro

DESCRIPTION

Set the value of a build macro for the active buildSpec. Build macros include RAM_LOW_ADRS, CFLAGS, etc.

PARAMETERS

macro - name of the build macro to set
value - value to assign the macro

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpBuildMacroGet

NAME

cmpBuildMacroGet - get a build macro

DESCRIPTION

Get the value of a build macro for the active buildSpec. Build macros include RAM_LOW_ADRS, CFLAGS, etc.

PARAMETERS

macro - name of the build macro to set
value - value to assign the macro

RETURNS

The value of the macro

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpBuildFlagsAdd

NAME

cmpBuildFlagsAdd - add flags to the build

DESCRIPTION

This routine is just a quick way to append to the build macros CFLAGS and CFLAGS_AS. It could also be acheived using cmpBuildMacro[GS]et

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpAdd

NAME

cmpAdd - add components to vxWorks

DESCRIPTION

This routine adds one or more optional vxWorks components to the project. For example, one can "cmpAdd INCLUDE_NFS" to add the NFS client to the vxWorks image. If a folder is specified (e.g., FOLDER_NETWORK), then all default components below that folder are added. The tool will also add any other components needed by the ones being added, as determined by dependency analysis. If the global tcl variable cmpInteractive is set to "true", then the user will be prompted to confirm before the components and dependencies are added.

PARAMETERS

components - list of components to add

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpRemove

NAME

cmpRemove - remove components from vxWorks

DESCRIPTION

This routine removes one or more optional vxWorks components from the project. For example, one can "cmpRemove INCLUDE_NFS" to remove the NFS client from the vxWorks image. If a folder is specified (e.g., FOLDER_NETWORK), then all components below that folder are removed. The tool will also remove any components that require by the ones being removed, as determined by dependency analysis. If the global tcl variable cmpInteractive is set to "true", then the user will be prompted to confirm before the components and dependencies are removed.

PARAMETERS

components - list of components to remove

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpListGet

NAME

cmpListGet - get a list of components in vxWorks

DESCRIPTION

This routine returns the list of components in the current vxWorks project.

RETURNS

a list of components

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpParamSet

NAME

cmpParamSet - set a parameter in the current project

DESCRIPTION

This routine sets the value of a component parameter. For example, the component INCLUDE_IOS has parameter MAX_FDS (max # file descriptors that can be open at once). One can use "cmpParamSet MAX_FDS 60" to increase the value to 60.

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpParamGet

NAME

cmpParamGet - get a parameter

DESCRIPTION

This routine gets the value of a component parameter. For example, the component INCLUDE_IOS has parameter MAX_FDS (max # file descriptors that can be open at once). One can use "cmpParamGet MAX_FDS" to get the current value of that parameter.

RETURNS

the parameter value, or an empty string if no such parameter exists

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpFileListGet

NAME

cmpFileListGet - get a list of files in the project

DESCRIPTION

This routine returns the list of source files in the project.

RETURNS

a list of files in the project

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpFileAdd

NAME

cmpFileAdd - add a file to the project

DESCRIPTION

This routine adds a source file to the project

PARAMETERS

file - full path to the file being added

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpFileRemove

NAME

cmpFileRemove - remove a file from the project

DESCRIPTION

This routine removes a source file from the project

PARAMETERS

file - full path to the file being removed

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpLoad

NAME

cmpLoad - dynamically load components

DESCRIPTION

This routine dynamically loads one or more components to a running target. To use this, you must first be connected to a tgtsvr using wtxToolAttach. This routine will extract all needed object modules from the vxWorks archive, and link them together. It will also build the initialization code needed to initialize the component(s) and all dependent components. It then loads the modules and the initialization code, and calls the initialization code.

Example: To load the vxWorks target shell, do "cmpLoad FOLDER_SHELL"

PARAMETERS

cmps - components to load
mods - (optional) set of additional object modules to load

RETURNS

N/A

SEE ALSO

cmpScriptLib, wtxToolAttach


Project Scripting Library : Tcl Procedures

autoscale

NAME

autoscale - automatically scale vxWorks

DESCRIPTION

configure vxWorks components based on what is required by the project source files. The default is to tell you what scaling can/should be done, and why. Passing parameter "terse" prints only terse information. Passing paramter "shrink" causes autoscaling to actually be done.

PARAMETERS

arg - (optional) default is verbose. can also be shrink or terse.

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpUnavailListGet

NAME

cmpUnavailListGet - list unavailable components

DESCRIPTION

This routine returns a list of components that are known but not available. A component is not available if it is not installed in the tree (e.g., an optional product), or it requires an unavailable component.

RETURNS

a list of components

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpValidate

NAME

cmpValidate - validate the component configuration

DESCRIPTION

Check if the current component configuration is valid. It returns a list of the form {{cmp1 err1} {cmp2 err2} ...} where cmpX is the name of a misconfigured component, and errX is an error string describing what is wrong with the component.

RETURNS

an error list, or an empty string if the configuration is valid.

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpTest

NAME

cmpTest - test the component descriptor files for errors

DESCRIPTION

This routine tests the component descriptor files for semantic errors. For example, it makes sure all components are contained in exactly one folder. It prints all diagnostic information to stdout. This routine is a diagnostic tool for component developers to test that their new components were written correctly. It has two optional parameters. components allows one to restrict the set of components being tested. buildTest allows one to verify that each component can be built individually. The most common reason a component would fail the build test is if the component descriptor does not have a HDR_FILE containing a prototype for the components initialization routine.

PARAMETERS

components - (optional) list of components to test (default is all)
buildTest - (optional) pass any value to see if components can build

RETURNS

N/A

SEE ALSO

cmpScriptLib


Project Scripting Library : Tcl Procedures

cmpInfo

NAME

cmpInfo - get info about a set of components

DESCRIPTION

Print basic information about a component, including the subtree (other components required by this component), and supertree (other components that require this component). The subtree and supertree are computed using the engine's dependency analyizer. This routine is primarily used by component authors who want to check on the scalability of their components.

PARAMETERS

components - list of components to analyze

RETURNS

N/A

SEE ALSO

cmpScriptLib