Starting with source files written in you can build an executable program in one command line, using the Green Hills compiler drivers C or C++.
The compiler driver performs three major functions:
You can invoke the driver from the command line. The driver calls the appropriate compiler with the correct default options. By default, the driver uses the linker to link in object files from the appropriate libraries.
The compiler driver for each language is:
The driver begins with a list of input files and looks at the extension of each filename to determine the file types and what compilation steps to perform on that file. For example, a file with a .c extension is a C source file, and a file with a .f or .for extension is a FORTRAN source file. Each file needs to be compiled with the appropriate language compiler, assembled, and then linked. Source files of different languages can be included within the same executable. See the -language option in the Mixing Languages chapter in either the Green Hills C or FORTRAN User's Guides for more information.
The syntax for the compiler driver command is:
driver_name [options] filename(s)
driver_name The name of the driver for the language that you are using.
options Represent any combination of compiler driver options. These options may be placed either before or after filename(s) on the command line.
filename(s) Represents the source file or files you wish to compile, assemble, or link. A space is required between each filename.
To build executable programs, support routines in the form of libraries and startup files are often needed in addition to the routines that you have provided. These support routines often perform tasks such as interfacing with an operating system. By default, the compiler driver will include the appropriate libraries and startup files based on the languages, target processor, and compatibility modes specified when compiling and linking.
The compiler driver recognizes certain filename extensions listed in the following table. It determines each file type from the extension and processes the file accordingly.