home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / man / compile.txt < prev    next >
Text File  |  1999-06-05  |  4KB  |  105 lines

  1.  
  2.                             The compile command
  3.                                       
  4.    Usage
  5.    
  6.    compile [-clean] [-verbose] [[1] compile_to_c_options] <Root-Class>
  7.    [<Root-Procedure>]
  8.    
  9.    Command compile is the SmallEiffel compiler.
  10.    Source code is Eiffel and target code is ANSI C code.
  11.    
  12.    Command compile executes in two major steps:
  13.    
  14.    Step 1 - command compile_to_c is called to produce various C files
  15.    (*.h and *.c). A script file is also produced by command compile_to_c.
  16.    The name of the script file is also printed by command compile_to_c
  17.    (*.make on Unix or *.BAT on DOS for example).
  18.    Step 2 - The script file produced during step 1 is runned, launching
  19.    the C compilation and linking of all the C files produced during the
  20.    previous step .
  21.    
  22.    Thus, command compile is a simple launcher used to sequentially call
  23.    command [2]compile_to_c, the C compiler and the linker.
  24.    
  25.    Like command compile_to_c, command compile must have at least one
  26.    argument to indicate the starting execution point of the system. Thus
  27.    execution will start in <Root-Procedure> of <Root-Class>. The default
  28.    <Root-Procedure> is make.
  29.    
  30.    Options
  31.    
  32.    -clean:
  33.           By default, the generated C files and object files are kept
  34.           from one invocation of command compile to another. This enables
  35.           incremental C compilation, since only the C files which have
  36.           been modified since the last invocation of command compile will
  37.           be recompiled. Because the Eiffel to C compilation performed by
  38.           SmallEiffel is generally much faster than the C compilation
  39.           itself, incremental C compilation saves times. However, there
  40.           are situations where you want to get rid of all the previously
  41.           generated C and object files, to start afresh. This occurs, for
  42.           example, when you change the C compiler options: these new
  43.           options apply only to the C files which are actually recompiled
  44.           (see example 3 below).
  45.           Option -clean removes the C and object files previously
  46.           generated by making command clean be called at the end of the
  47.           compilation.
  48.    -verbose:
  49.           Displays (a lot of) useful information during the compilation
  50.           (full path of loaded files, type inference score, generated
  51.           files, etc).
  52.           
  53.    Examples
  54.    
  55.    Example 1
  56.    When SmallEiffel is correctly installed, you can simply type the
  57.    following command to test the hello world program:
  58.    compile hello_world
  59.           
  60.    The compiler should tell you what's wrong or should compile Eiffel
  61.    source files telling you the full path used to load the Eiffel source
  62.    code.
  63.    Under UNIX, the executable file is named "a.out" by default.
  64.    
  65.    Example 2
  66.    Type following command to finalize the hello_world simple program:
  67.    compile -boost -no_split -O3 hello_world
  68.           
  69.    Note that option -O3 is passed to the C compiler (see the manual of
  70.    your C compiler). Options -boost and -no_split are passed to command
  71.    [3]compile_to_c. This is usually the best way to finalize your
  72.    application.
  73.    Only one C file is produced (option -no_split)
  74.    
  75.    Example 3
  76.    To compile a big project (class PROJECT) with C files splitting and
  77.    require assertions checked:
  78.    compile -require_check project
  79.           
  80.    The very first time, all C files are produced and compiled. Then, if
  81.    you type the same command after some changes in the Eiffel source
  82.    files, all C files are also produced from scratch. If there are only
  83.    minor changes in the generated C files, only modified ones are passed
  84.    to the C compiler (previous object files have been saved).
  85.    Keep in mind that C compiler options are not taken into account. Thus
  86.    if you now want to do:
  87.    compile -require_check project -O3
  88.           
  89.    You must use the clean command before:
  90.    clean project
  91.           
  92.    All C files will be then recompiled using the new C option -O3. You
  93.    are thus sure that the new C options are taken into account.
  94.    
  95.                                    [Line]
  96.    Copyright © Dominique COLNET and Suzanne COLLIN - [4]<colnet@loria.fr>
  97.                   Last update: 05 June 1999, by DC & OZ. 
  98.  
  99. References
  100.  
  101.    1. file://localhost/home/colnet/SmallEiffel/man/man/compile_to_c.html
  102.    2. file://localhost/home/colnet/SmallEiffel/man/man/compile_to_c.html
  103.    3. file://localhost/home/colnet/SmallEiffel/man/man/compile_to_c.html
  104.    4. mailto:colnet@loria.fr
  105.