SPRU514Z July 2001 – October 2023 SM320F28335-EP
You might find it useful to set the compiler, assembler, and linker default options using the C2000_C_OPTION environment variable. If you do this, the compiler uses the default options and/or input filenames that you name C2000_C_OPTION every time you run the compiler.
Setting the default options with these environment variables is useful when you want to run the compiler repeatedly with the same set of options and/or input files. After the compiler reads the command line and the input filenames, it looks for the C2000_C_OPTION environment variable and processes it.
The table below shows how to set the C2000_C_OPTION environment variable. Select the command for your operating system:
Operating System | Enter |
---|---|
UNIX (Bourne shell) | C2000_C_OPTION=" option1 [option2 . . .]"; export C2000_C_OPTION |
Windows | set C2000_C_OPTION= option1 [option2 . . .] |
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 --quiet option), enable C/C++ source interlisting (the --src_interlist option), and link (the --run_linker option) for Windows, set up the C2000_C_OPTION environment variable as follows:
set C2000_C_OPTION=--quiet --src_interlist --run_linker
Any options following --run_linker on the command line or in C2000_C_OPTION are passed to the linker. Thus, you can use the C2000_C_OPTION environment variable to specify default compiler and linker options and then specify additional compiler and linker options on the command line. If you have set --run_linker in the environment variable and want to compile only, use the compiler --compile_only option. These additional examples assume C2000_C_OPTION is set as shown above:
cl2000 *c ; compiles and links
cl2000 --compile_only *.c ; only compiles
cl2000 *.c --run_linker lnk.cmd ; compiles and links using a command file
cl2000 --compile_only *.c --run_linker lnk.cmd
; only compiles (--compile_only overrides --run_linker)
For details on compiler options, see Section 2.3. For details on linker options, see the Linker Description chapter in the TMS320C28x Assembly Language Tools User's Guide.