Setting Up the Code Generation Environment
4-8
Environment variable options are specified in the same way and have the
same meaning as they do on the command line. For example, if you want to
always run quietly (the –q option), enable C source interlisting (the –s option),
and link (the –z option), set up the C_OPTION environment variable as follows:
For C shells:
setenv C_OPTION ”–qs –z”
For Bourne or Korn shells:
C_OPTION=”–qs –z”
export C_OPTION
In the following examples, each time you run the compiler shell, it runs the
linker. Any options following –z on the command line or in C_OPTION are
passed to the linker. This enables you to use the C_OPTION environment vari-
able to specify default compiler and linker options and then specify additional
compiler and linker options on the shell command line. If you have set –z in
the environment variable and want to compile only, use the –c option of the
shell. These additional examples assume C_OPTION is set as shown above:
cl470 *.c ; compiles and links
cl470 –c *.c ; only compiles
cl470 *.c –z lnk.cmd ; compiles and links using a
; command file
cl470 –c *.c –z lnk.cmd ; only compiles (–c overrides –z)
For more information about shell options, see the
TMS470R1x Optimizing C
Compiler User’s Guide
. For more information on linker options, see the
TMS470R1x Assembly Language Tools User’s Guide.
Specifying a temporary file directory (TMP)
The compiler shell program creates intermediate files as it processes your
program. By default, the shell puts intermediate files in the current directory.
However, you can name a specific directory for temporary files by using the
TMP environment variable.
Using the TMP environment variable allows use of a RAM disk or other file
systems. It also allows you to compile source files from a remote directory with-
out writing any files into the directory where the source resides. This is useful
for protected directories.