3.9. Specifying Temp Directories

The cl2000 compiler provides several options that allow you to control where a temporary file is written during a given compilation. However, the c29clang compiler does not provide an analogous capability for controlling the location of the temporary files that are generated during a compilation.

In most, if not all, cases, the c29clang compiler places temporary files in the current working directory (that is, whichever directory the c29clang executable was invoked from). Ordinarily, temporary files are removed when they are no longer needed by the c29clang compiler. However, like the cl2000 compiler, the c29clang compiler does support command-line options that keep one or more of the temporary files that are generated during a given compilation.

cl2000 Option (and alias)

c29clang Option

--abs_directory=<dir> (-fb)

not supported

The cl2000 compiler supports an absolute listing capability (-abs), which is not provided in the c29clang toolset. Thus the c29clang compiler does not provide an option to control where an absolute listing file would be written.

cl2000 Option (and alias)

c29clang Option

--asm_directory=<dir> (-fs)

-S

-save-temps

The cl2000 compiler allows you to indicate where a temporary compiler-generated assembly file should be written, but the c29clang compiler does not provide this capability. The c29clang compiler’s -S option instructs the compiler to write the compiler-generated assembly file to the current working directory and then stop the compiler before actually assembling the file into an object file.

The c29clang compiler’s -save-temps option keeps all temporary files generated during compilation and linking without halting either the compiler or the linker. The typical temporary files that are generated during compilation and linking include: an intermediate file (.i extension), a bitcode intermediate file (non-readable with .bc extension), a compiler-generated assembly file (.s extension), and an object file generated from the c29clang assembler (.o extension).

Note that the use of assembly language is discouraged for c29clang, except for assembly code that is embedded in C/C++ source files via asm() statements, which are processed inline by the c29clang integrated GNU-syntax assembler. Assembly language source files should be rewritten in C/C++. See Migrating Assembly Language Source Code for more information.

cl2000 Option (and alias)

c29clang Option

--list_directory=<dir> (-ff)

not supported

The cl2000 tools support the capability to generate an assembly listing file, which displays the encoded object code alongside the assembly language source that was either generated by the compiler or was provided in an assembly language source file. The cl2000’s --list_directory option allows you to indicate where to write the assembly listing file during the compilation.

The c29clang compiler does not provide the analogous capability to generate an assembly listing file. Thus, there is no need for an option to direct where an assembly listing file is to be written.

cl2000 Option (and alias)

c29clang Option

--obj_directory=<dir> (-fr)

-c

-save-temps

The cl2000 compiler allows you to indicate where a temporary assembler-generated object file should be written, but the c29clang compiler does not provide this capability. The c29clang compiler’s -c option instructs the compiler to write the compiler-generated object file to the current working directory and then stop the compiler before actually linking the file into an application.

The c29clang compiler’s -save-temps option keeps all temporary files generated during compilation and linking without halting either the compiler or the linker. The typical temporary files that are generated during compilation and linking include: an intermediate file (.i extension), a bitcode intermediate file (non-readable with .bc extension), a compiler-generated assembly file (.s extension), and an object file generated from the c29clang assembler (.o extension).

cl2000 Option (and alias)

c29clang Option

--output_file=<file> (-o)

-o <file>

Both the cl2000 and c29clang compilers support a -o option, which allows you to specify the name and location of the linked output file.

cl2000 Option

c29clang Option

--pp_directory=<dir>

-E

The cl2000 compiler supports generating a pre-processor file that is emitted after the parser portion of the compiler completes processing of all pre-processing directives (using the -ppo option, for example). The cl2000’s --pp_directory option allows you to specify where to write the pre-processor file (.pp extension) during a given compilation.

Whereas the cl2000 compiler can be made to generate a pre-processor file with a .pp extension, the c29clang compiler supports the -E option, which writes the pre-processor output to stdout. You can direct c29clang’s pre-processor output to a file using the appropriate UNIX or MS-DOS “pipe” command notation.

cl2000 Option (and alias)

c29clang Option

--temp_directory=<dir> (-ft)

not supported

The cl2000 compiler provides the --temp_directory option to allow you to specify an alternate directory (from the current work directory) where temporary files are to be written.

The c29clang compiler writes temporary files to the current working directory (where c29clang is invoked from). Normally, temporary files are automatically removed during the compilation process when the compiler no longer needs a given temporary file, but you can keep all of the temporary files generated during a given compilation by specifying c29clang’s -save-temps option. The c29clang compiler does not provide an option to write temporary files to an alternate directory.