Compiling an Eiffel system for CECIL

Compiling your Eiffel system for CECIL

It is very simple to "Cecilize" your Eiffel system, that is to say make its features available from the outside through CECIL. You will compile it as you normally would - either freeze it or finalize it. The only supplementary precaution is to make the features and classes that will be used by CECIL visible.

Building a CECIL archive

The EiffelStudio compiler produces both C code and a "Makefile". The Makefile compiles and links that C code in a subdirectory one level below the EIFGENs directory of a project. For frozen/melted code, the Makefile is located in the W_code subdirectory. For finalized code, it is in the F_code subdirectory. To produce a CECIL library, you must: open a shell (unix) or the MS-DOS prompt (Windows), go to the subdirectory that contains the Makefile, and then type:

	make cecil    (on unix and on windows with Borland)
	nmake cecil   (on windows with VC++)

This generates a CECIL archive whose name derived from the name system name of the Eiffel system, as follows:

	lib<system name>.a     (on unix)
	lib<system name>.lib   (on Windows)

For example, the corresponding archive for an Eiffel system called "test", would be called either "libtest.a" (Unix) or "libtest.lib" (Windows). Note that through CECIL you can use an Eiffel system compiled in any of the Eiffel compilation modes:

  • Finalized C code.
  • Workbench (melted/frozen) code, usually for development purposes. In this case you must copy the <system name>.melted file ( where <system name> is the name of your system) located in EIFGENs\<target_name>\W_code to the directory where you intend to execute your C application from.

Note: each time you melt the Eiffel system, the <system name>. melted file is updated.

Caution: In the second case (workbench mode), it is not possible to call through the CECIL interface any routine that has been melted in the last compilation; this would raise the run-time exception:
$ applied to melted routine
The solution is simply to refreeze the system.

94a549df-1919-9dcd-82b3-1cd82e064a03
cached: 09/23/2017 10:55:19.000 AM