Lard Toolkit User Guide

lcd - Lard Compiler Driver

Name

lcd - driver program providing a simplified interface to the compiler, optimiser, assembler and linker.

Synopsis

lcd [options] source

Description

lcd undertakes all the tasks necessary to turn a source lard program into a bcode file. This may be either a file that can be executed by the interpretter li or an object file that can be linked with others. The steps taken are:

The environment variable LCD_OPTS is parsed prior to the command line arguments. This may be used to add library directories and other options. See the overview for a standard setup.

Typical Usage

Typical usage falls into two categories:

Compilation to create a library

To compile a file my_lib.l into a library that can be used by other programs, use the command

	lcd -mklib my_lib.l
The result of this is a pair of files, my_lib.bcode and my_lib.dcode.

Compilation to create an executable

To compile the program main_prog.l with the libraries my_lib and lib2 use the command line

	lcd -lmy_lib -llib2 main_prog.l
Note that this looks for the dcode and bcode files for my_lib and lib2 in the directories specified by -L flags. If they are in the current directory you must put -L. in your LCD_OPTS environment variable.

Options

-g

Enable source code debugging in the executable. This will result in slower execution.

-mklib

Make a library. Final linking is omitted and a dcode file is created.

-lLIB

Include the library LIB. lcd looks for LIB.dcode in each of the directories specified by preceeding -L options in turn until it finds it.

-Llibdir

Add directory libdir to the list of places to search for libraries.

-syms

Include symbols in the output. This is required for icode debugging, coverage analysis profiling - though the latter two are not supported in version 7.

-noenv

Don't read from LCD_OPTS.

-Copt

Pass option opt to the compiler.

-Aopt

Pass option opt to the assembler.

-Oopt

Pass option opt to the optimiser.

-v

Be verbose - display the commands passed to the subprograms as they are executed.

-pres

Preserve the intermediate icode and bcode files, which are normally deleted.

-help

Display usage information.