Configuring Command-Line Tools

This chapter explains:

Setting CodeWarrior Environment Variables

Use environment variables on the host system to specify to the CodeWarrior command line tools where to find CodeWarrior files for compiling and linking. The table below describes these environment variables.

Table 1. Environment variables for CodeWarrior command-line tools
The environment variable... specifies this information
CWFolder CodeWarrior installation path on the host system.
MWCIncludes Directories on the host system for system header files for the CodeWarrior compiler.
MWLibraries Directories on the host system for system libraries for the CodeWarrior linker.

A system header file is a header file that is enclosed with the "<" and ">" characters in include directives. For example

  #include <stdlib.h> /* stdlib.h system header. */ 

Typically, you define the MWCIncludes and MWLibraries environment variables to refer to the header files and libraries in the subdirectories of your CodeWarrior software.

To specify more than one directory for the MWCIncludes and MWLibraries variables, use the conventional separator for your host operating system command-line shell.

Note: CWFolder environment variable specifies the CodeWarrior installation path on a host system. Verify the CodeWarrior installation path on the host system before setting the CWFolder environment variable.
Listing 1. Setting environment variables in Microsoft® Windows® operating systems
rem Use ; to separate directory paths
set CWFolder=Replace this text with the CodeWarrior installation path on the host system.

set 
MWCIncludes=%CWFolder%\PA_Support\ewl\EWL_C\include;%CWFolder%\PA_Supp
ort\ewl\EWL_C++\include;%CWFolder%\PA_Support\ewl\EWL_Runtime\Runtime_
PA\Include

set MWLibraries=%CWFolder%\PA_Support\ewl\lib

Setting the PATH Environment Variable

The PATH variable should include the paths for your CodeWarrior tools, shown in Example of setting PATH. Toolset represents the name of the folder that contains the command line tools for your build target.

Listing 2. Example of setting PATH
Set CWFolder=Replace this text with the CodeWarrior installation path on the host system.

set PATH=%PATH%;%CWFolder%\MCU\Bin;%CWFolder%\MCU\PA_Tools\Command_Line_Tools