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 following table describes these environment variables.

Table 1. Environment variables for CodeWarrior command-line tools
This environment variable... specifies this information
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. MWLibraries are used with the automatic library selection linker flag, -lavender.
CWFolder CodeWarrior installation path on the host system.

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.

Listing: Setting environment variables in Microsoft® Windows® operating systems


rem Use ; to separate directory paths 
set CWFolder=C:\Freescale\CodeWarrior 
set MWCIncludes=%CWFolder%\MCU\ARM_EABI_Support\ewl\EWL_C\Include 
set MWCIncludes=%MWCIncludes%;%CWFolder%\MCU\ARM_EABI_Support\ewl\EWL_C++\Include 
set MWCIncludes=%MWCIncludes%;%CWFolder%\MCU\ARM_EABI_Support\ewl\EWL_C\Include\sys 

set MWLibraries=%CWFolder%\MCU\ARM_EABI_Support\ewl\lib