The compiler driver

 

The lc.exe compiler driver has the following format:

 

lc [ compiler options] files… [linker options]

 

This means that you give it all the compiler options first, then the files you want to compile, then and the options you want for the linker pass. Things in brackets are optional. You can just use lc file.c and the driver will call the compiler without any options, as well as the linker if all compilation steps happen without any error.

Note that you can pass to the driver an ambiguous file specification like

lc *.c –o prog.exe

 

The “-o” option is to name the executable output file, and it is a linker option, that’s why it is placed after the c files proper.

 

The driver will assume that rc files should be compiled with the resource compiler lrc, and asm files will be assembled with lcc.

If more than one source file is given, the driver will write to stderr the name of the file that is currently being compiled, and will echo the linker command line.

If there are errors during the compilation of any one file, the compilation goes on with the next file, but the process will stop before the link step. The result code will be the number of errors in either the compilation or in the linking step.