Top
Menu
compile_to_c
The se-compile command is the SmallEiffel compiler. There are
two invocation modes: traditional and ACE. In traditional mode, a
variety of compiler options can be specified on the command line. In
ACE mode, these options are not permitted; it is presumed that the
required compiler options are listed in the ACE file.
Traditional mode
se-compile [general_options]
[compile_to_c_options]
<RootClass>
[<RootProcedure>]
ACE mode
se-compile [general_options]
<ACEfile.ace>
In ACE mode, the name of the ACE file must end with the .ace
suffix. For examples of how to use ACE files, have a look in the
/usr/lib/smalleiffel/lib_show/ace directory.
Source code is in Eiffel and target code is in ANSI C.
The se-compile command executes in two major steps:
Step 1 - | the
compile_to_c command is called to produce various
C files (*.h and *.c). A script file is also produced
by compile_to_c. The name of the script file
is also printed by compile_to_c (*.make on
Unix or *.BAT on DOS, for example).
|
Step 2 - | The script file produced during
step 1 is run, launching the C compilation(s) and linking of
all the C files produced during the previous step.
|
Thus, the se-compile command is a simple launcher used to
call the compile_to_c command,
the C compiler, and the linker in sequence.
Like the compile_to_c command, the se-compile command must have at least
one argument to indicate the starting execution point of the system.
Thus execution will start in <RootProcedure> of <RootClass>.
The default <RootProcedure> is make.
-
-clean:
- By default, the generated C files and object files are retained from one invocation
of the se-compile command
to another. This enables incremental C compilation, since only the
C files which have been modified since the last invocation of
the se-compile command will be recompiled. Because the Eiffel
to C compilation performed by SmallEiffel is generally much faster
than the C compilation itself, incremental C compilation saves time.
However, there are situations where you want to get rid of all
the previously generated C and object files, to start afresh.
This occurs, for example, when you change the C compiler options;
these new options apply only to the C files which are actually
recompiled (see example 3 below).
The -clean option removes the C and object files previously
generated, by
invoking the clean command at the end of the compilation.
-
-help:
-
Display a brief summary of the command-line syntax and a complete
list of compiler options.
-
-verbose:
-
Displays (a lot of) useful information during the compilation (full path of
loaded files, type inference score, generated files, etc.).
-
-version:
-
Display the version number
of the SmallEiffel release you're using.
Examples of traditional mode |
Example 1
When SmallEiffel is correctly installed, you can type
the following command to test the hello world program:
-
se-compile hello_world
The compiler should tell you what's wrong or should compile
Eiffel source files telling you the full path used to load
the Eiffel source code.
Under UNIX, the executable file is named "a.out" by default.
Example 2
Type the following command to finalize the hello_world simple
program:
-
se-compile -boost -no_split -O3 hello_world
Note that the -O3 option is passed to the C compiler (see the manual
of your C compiler). The -boost and -no_split options
are passed to the
compile_to_c
command.
This is usually the best way to finalize your application.
Only one C file is produced (option -no_split).
Example 3
To compile a big project (class PROJECT) with C file splitting and
require assertions checked:
-
se-compile -require_check project
The very first time, all C files are produced and compiled.
Then, if you type the same command after some changes in the
Eiffel source files, all C files are also produced from scratch.
If there are only minor changes in the generated
C files, only modified ones are passed to the C compiler
(previous object files have been saved).
Keep in mind that C compiler options are not taken into account.
Thus if you now want to do:
-
se-compile -require_check project -O3
You must use the clean command first:
-
clean project
All C files will be then recompiled using the new C option -O3.
You are thus sure that the new C options are taken into account.
Copyright © Dominique COLNET and Suzanne COLLIN -
<SmallEiffel@loria.fr>
Last modified: Sun Jul 15 13:41:34 MET DST 2001
Top
Menu
compile_to_c
This page was last changed for the Debian SmallEiffel package by
Oliver Elphick on 24th July 2001.