@c -*-texinfo-*-
@c
@c $Id: ede-compilers.texi,v 1.2 2001/04/27 00:19:10 zappo Exp $
@c

@c The next line is for the back-search to see what node this one
@c resides in.

@c @node Compilers,
@c @chapter Compilers

@c This command is a convenience to help rebuild this file.  Use C-x C-e
@c on the expression below to rebuild the entire index (but only
@c after loading in all relevant source files.)

@c (eieiodoc-class ede-compilation-program "cm")
@menu
* ede-compilation-program ::
*  ede-compiler ::
*   ede-object-compiler ::
*  ede-linker ::
@end menu


@node ede-compilation-program, ede-compiler,  , Compilers
@comment  node-name,  next,  previous,  up
@section ede-compilation-program
@cmindex ede-compilation-program

@table @asis
@item Inheritance Tree:
@table @code
@item eieio-instance-inheritor
@table @code
@item ede-compilation-program
@table @asis
@item Children:
@w{@xref{ede-compiler},} @w{@xref{ede-linker}.} 
@end table

@end table

@end table
@end table

  Create a new object with name NAME of class type ede-compilation-program

@table @asis
@item Slots:

@table @code
@item :parent-instance
Type: @code{eieio-instance-inheritor}

The parent of this instance.
If a slot of this class is reference, and is unbound, then  the parent
is checked for a value.
@refill

@item :name
Type: @code{string}

Name of this type of compiler.
@refill

@item :variables
Type: @code{list}

Variables needed in the Makefile for this compiler.
An assoc list where each element is (VARNAME . VALUE) where VARNAME
is a string, and VALUE is either a string, or a list of strings.
For example, GCC would define CC=gcc, and emacs would define EMACS=emacs.
@refill

@item :sourcetype
Type: @code{list}

A list of @code{ede-sourcecode} @xref{ede-sourcecode}. objects this class will handle.
This is used to match target objects with the compilers and linkers
they can use, and which files this object is interested in.
@refill

@item :rules
Type: @code{list} @*
Default Value: @code{nil}

Auxiliary rules needed for this compiler to run.
For example, yacc/lex files need additional chain rules, or inferences.
@refill

@item :commands
Type: @code{list}

The commands used to execute this compiler.
The object which uses this compiler will place these commands after
it's rule definition.
@refill

@item :autoconf
Type: @code{list} @*
Default Value: @code{nil}

Autoconf function to call if this type of compiler is used.
When a project is in Automake mode, this defines the autoconf function to
call to initialize automake to use this compiler.
For example, there may be multiple C compilers, but they all probably
use the same autoconf form.
@refill

@item :objectextention
Type: @code{string}

A string which is the extention used for object files.
For example, C code uses .o on unix, and Emacs Lisp uses .elc.
@refill

@end table

@end table
@subsection Specialized Methods

@deffn Method ede-proj-flush-autoconf :PRIMARY this 
Flush the configure file (current buffer) to accomodate @var{THIS}.
@end deffn

@deffn Method ede-proj-makefile-insert-rules :PRIMARY this 
Insert rules needed for @var{THIS} compiler object.
@end deffn

@deffn Method ede-proj-makefile-insert-variables :PRIMARY this 
Insert variables needed by the compiler @var{THIS}.
@end deffn

@deffn Method ede-proj-makefile-insert-commands :PRIMARY this 
Insert the commands needed to use compiler @var{THIS}.
The object creating makefile rules must call this method for the
compiler it decides to use after inserting in the rule.
@end deffn

@deffn Method ede-object-sourcecode :PRIMARY this 
Retrieves the slot @code{sourcetype} from an object of class @code{ede-compilation-program}
@end deffn

@deffn Method ede-proj-tweak-autoconf :PRIMARY this 
Tweak the configure file (current buffer) to accomodate @var{THIS}.
@end deffn


@node ede-compiler, ede-object-compiler, ede-compilation-program, Compilers
@comment  node-name,  next,  previous,  up
@section ede-compiler
@cmindex ede-compiler

@table @asis
@item Inheritance Tree:
@table @code
@item eieio-instance-inheritor
@table @code
@item @w{@xref{ede-compilation-program}.}
@table @code
@item ede-compiler
@table @asis
@item Children:
@w{@xref{ede-object-compiler}.} 
@end table

@end table

@end table

@end table
@end table

  Create a new object with name NAME of class type ede-compiler

@table @asis
@item Slots:

@table @code
@item :parent-instance
Type: @code{eieio-instance-inheritor}

The parent of this instance.
If a slot of this class is reference, and is unbound, then  the parent
is checked for a value.
@refill

@item :name
Type: @code{string}

Name of this type of compiler.
@refill

@item :variables
Type: @code{list}

Variables needed in the Makefile for this compiler.
An assoc list where each element is (VARNAME . VALUE) where VARNAME
is a string, and VALUE is either a string, or a list of strings.
For example, GCC would define CC=gcc, and emacs would define EMACS=emacs.
@refill

@item :sourcetype
Type: @code{list}

A list of @code{ede-sourcecode} @xref{ede-sourcecode}. objects this class will handle.
This is used to match target objects with the compilers and linkers
they can use, and which files this object is interested in.
@refill

@item :commands
Type: @code{list}

The commands used to execute this compiler.
The object which uses this compiler will place these commands after
it's rule definition.
@refill

@item :objectextention
Type: @code{string}

A string which is the extention used for object files.
For example, C code uses .o on unix, and Emacs Lisp uses .elc.
@refill

@item :makedepends
Type: @code{boolean} @*
Default Value: @code{nil}

Non-@code{nil} if this compiler can make dependencies.
@refill

@item :uselinker
Type: @code{boolean} @*
Default Value: @code{nil}

Non-@code{nil} if this compiler creates code that can be linked.
This requires that the containing target also define a list of available
linkers that can be used.
@refill

@end table

@end table
@subsection Specialized Methods

@deffn Method initialize-instance :AFTER this &rest fields 
Make sure that all ede compiler objects are cached in 
@code{ede-compiler-list}.
@end deffn

@deffn Method ede-proj-makefile-insert-object-variables :PRIMARY this targetname sourcefiles 
Insert an OBJ variable to specify object code to be generated for @var{THIS}.
The name of the target is @var{TARGETNAME} as a string.  @var{SOURCEFILES} is the list of
files to be objectified.
Not all compilers do this.
@end deffn

@deffn Method ede-compiler-intermediate-objects-p :PRIMARY this 
Return non-@code{nil} if @var{THIS} has intermediate object files.
If this compiler creates code that can be linked together,
then the object files created by the compiler are considered intermediate.
@end deffn

@deffn Method ede-compiler-intermediate-object-variable :PRIMARY this targetname 
Return a string based on @var{THIS} representing a make object variable.
@var{TARGETNAME} is the name of the target that these objects belong to.
@end deffn


@node ede-object-compiler, ede-linker, ede-compiler, Compilers
@comment  node-name,  next,  previous,  up
@section ede-object-compiler
@cmindex ede-object-compiler

@table @asis
@item Inheritance Tree:
@table @code
@item eieio-instance-inheritor
@table @code
@item @w{@xref{ede-compilation-program}.}
@table @code
@item @w{@xref{ede-compiler}.}
@table @code
@item ede-object-compiler
No children
@end table

@end table

@end table

@end table
@end table

  Create a new object with name NAME of class type ede-object-compiler

@table @asis
@item Slots:

@table @code
@item :parent-instance
Type: @code{eieio-instance-inheritor}

The parent of this instance.
If a slot of this class is reference, and is unbound, then  the parent
is checked for a value.
@refill

@item :name
Type: @code{string}

Name of this type of compiler.
@refill

@item :variables
Type: @code{list}

Variables needed in the Makefile for this compiler.
An assoc list where each element is (VARNAME . VALUE) where VARNAME
is a string, and VALUE is either a string, or a list of strings.
For example, GCC would define CC=gcc, and emacs would define EMACS=emacs.
@refill

@item :sourcetype
Type: @code{list}

A list of @code{ede-sourcecode} @xref{ede-sourcecode}. objects this class will handle.
This is used to match target objects with the compilers and linkers
they can use, and which files this object is interested in.
@refill

@item :commands
Type: @code{list}

The commands used to execute this compiler.
The object which uses this compiler will place these commands after
it's rule definition.
@refill

@item :objectextention
Type: @code{string}

A string which is the extention used for object files.
For example, C code uses .o on unix, and Emacs Lisp uses .elc.
@refill

@item :uselinker
Type: @code{boolean} @*
Default Value: @code{t}

@xref{ede-compiler}.
@item :dependencyvar
Type: @code{list}

A variable dedicated to dependency generation.
@refill

@end table

@end table
@subsection Specialized Methods

@deffn Method ede-proj-makefile-insert-variables :PRIMARY this 
Insert variables needed by the compiler @var{THIS}.
@end deffn


@node ede-linker,  , ede-object-compiler, Compilers
@comment  node-name,  next,  previous,  up
@section ede-linker
@cmindex ede-linker

@table @asis
@item Inheritance Tree:
@table @code
@item eieio-instance-inheritor
@table @code
@item @w{@xref{ede-compilation-program}.}
@table @code
@item ede-linker
No children
@end table

@end table

@end table
@end table

  Create a new object with name NAME of class type ede-linker

@table @asis
@item Slots:

@table @code
@item :parent-instance
Type: @code{eieio-instance-inheritor}

The parent of this instance.
If a slot of this class is reference, and is unbound, then  the parent
is checked for a value.
@refill

@item :name
Type: @code{string}

Name of this type of compiler.
@refill

@item :variables
Type: @code{list}

Variables needed in the Makefile for this compiler.
An assoc list where each element is (VARNAME . VALUE) where VARNAME
is a string, and VALUE is either a string, or a list of strings.
For example, GCC would define CC=gcc, and emacs would define EMACS=emacs.
@refill

@item :sourcetype
Type: @code{list}

A list of @code{ede-sourcecode} @xref{ede-sourcecode}. objects this class will handle.
This is used to match target objects with the compilers and linkers
they can use, and which files this object is interested in.
@refill

@item :commands
Type: @code{list}

The commands used to execute this compiler.
The object which uses this compiler will place these commands after
it's rule definition.
@refill

@item :objectextention
Type: @code{string}

A string which is the extention used for object files.
For example, C code uses .o on unix, and Emacs Lisp uses .elc.
@refill

@end table

@end table
@subsection Specialized Methods

@deffn Method initialize-instance :AFTER this &rest fields 
Make sure that all ede compiler objects are cached in 
@code{ede-linker-list}.
@end deffn


