/[eiffelstudio]/vendor/gobosoft.com/gobo/current/doc/gec/usage.xml
ViewVC logotype

Contents of /vendor/gobosoft.com/gobo/current/doc/gec/usage.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 90767 - (show annotations)
Tue Jan 22 00:56:30 2013 UTC (6 years, 8 months ago) by manus
File MIME type: text/xml
File size: 6820 byte(s)
Updated svn:eol-style to be native and svn:mime-style to be text/xml

1 <?xml version="1.0"?>
2
3 <!--
4 description:
5
6 "Using gec"
7
8 tool: "Gobo Eiffel Compiler"
9 copyright: "Copyright (c) 2006-2007, Eric Bezault and others"
10 license: "MIT License"
11 date: "$Date$"
12 revision: "$Revision$"
13 -->
14
15 <chapter xmlns="http://www.gobosoft.com/eiffel/gobo/documentation" id="gec/usage">
16 <chapterinfo>
17 <copyright>
18 <year>2006</year>
19 <holder>Eric Bezault</holder>
20 </copyright>
21 <author>
22 <firstname>Eric</firstname><surname>Bezault</surname>
23 </author>
24 <email>ericb@gobosoft.com</email>
25 <date>18 March 2006</date>
26 </chapterinfo>
27
28 <title>Using gec</title>
29
30 <section><title>Command-line options</title>
31 <para>
32 The usual way to invoke <projectname>gec</projectname> is as follows:
33 <blockquote>
34 <filename>gec ace_filename</filename>
35 </blockquote>
36 This will read the description of your program in the Ace file
37 <filename>ace_filename</filename>, compile it and invoke the
38 back-end C compiler on the generated C code as explained
39 below. Here is a list of options that can be
40 used with <projectname>gec</projectname>:
41 <variablelist>
42 <varlistentry>
43 <term>
44 <filename>-h</filename>
45 </term>
46 <term>
47 <filename>--help</filename>
48 </term>
49 <listitem><para>
50 Print a summary of the command-line options of <projectname>gec</projectname> and exit.
51 </para></listitem>
52 </varlistentry>
53 <varlistentry>
54 <term>
55 <filename>--finalize</filename>
56 </term>
57 <listitem><para>
58 Compile with optimizations turned on.
59 </para></listitem>
60 </varlistentry>
61 <varlistentry>
62 <term>
63 <filename>--cat</filename>
64 </term>
65 <listitem><para>
66 CAT-call errors should be considered as fatal errors.
67 </para></listitem>
68 </varlistentry>
69 <varlistentry>
70 <term>
71 <filename>--split=&lt;no|yes&gt;</filename>
72 </term>
73 <listitem><para>
74 Should generated C code be split over several C files instead of being held in a single possibly large C file? (default: yes)
75 </para></listitem>
76 </varlistentry>
77 <varlistentry>
78 <term>
79 <filename>--split-size=&lt;size&gt;</filename>
80 </term>
81 <listitem><para>
82 Size (in bytes) of generated C files in bytes when in split mode
83 </para></listitem>
84 </varlistentry>
85 <varlistentry>
86 <term>
87 <filename>--cc=&lt;no|yes&gt;</filename>
88 </term>
89 <listitem><para>
90 Should the back-end C compiler be invoked on the generated C code? (default: yes)
91 </para></listitem>
92 </varlistentry>
93 <varlistentry>
94 <term>
95 <filename>--gc=&lt;no|boehm&gt;</filename>
96 </term>
97 <listitem><para>
98 Which garbage collector should the application be compiled with? (default: no)
99 </para></listitem>
100 </varlistentry>
101 <varlistentry>
102 <term>
103 <filename>--silent</filename>
104 </term>
105 <listitem><para>
106 Run <projectname>gec</projectname> in silent mode.
107 </para></listitem>
108 </varlistentry>
109 <varlistentry>
110 <term>
111 <filename>--verbose</filename>
112 </term>
113 <listitem><para>
114 Run <projectname>gec</projectname> in verbose mode.
115 </para></listitem>
116 </varlistentry>
117 <varlistentry>
118 <term>
119 <filename>-V</filename>
120 </term>
121 <term>
122 <filename>--version</filename>
123 </term>
124 <listitem><para>
125 Print the version number of <projectname>gec</projectname> and exit.
126 </para></listitem>
127 </varlistentry>
128 </variablelist>
129 </para>
130 </section>
131
132 <section><title>Ace files</title>
133 <para>
134 An Ace file contains the description of the Eiffel program to be compiled.
135 <projectname>gec</projectname> is able to read the same Ace files as
136 ISE Eiffel. So if you already have your Ace files the only thing you have
137 to do is to instruct <projectname>gec</projectname> to use
138 <libraryname>FreeELKS</libraryname> kernel classes instead of ISE
139 <libraryname>EiffelBase</libraryname> kernel classes. To do so you just
140 have to replace the EiffelBase clusters in your Ace file by:
141 <informalexample>
142 <filename class="directory">all free_elks: "${GOBO}/library/free_elks"</filename>
143 </informalexample>
144 If you are new to Eiffel and don't know what an Ace file is, please have
145 a look at this <link linkend="../tools/ace">description</link> from the
146 documentation of the <libraryname>Gobo Eiffel Tools Library</libraryname>
147 on which <projectname>gec</projectname> is based.
148 </para>
149 </section>
150
151 <section><title>Back-end C compiler</title>
152 <para>
153 <projectname>gec</projectname> translates your Eiffel programs into C code.
154 This C code is then passed to a back-end C compiler to generate an executable.
155 By default <projectname>gec</projectname> uses Microsoft Visual C
156 <projectname>cl</projectname> on Windows and GNU <projectname>gcc</projectname>
157 on other operating systems such as Linux. This section explains how to override
158 this default if you want to use another back-end C compiler or if you want to
159 specify different C compilation options.
160 </para>
161 <para>
162 For each C compiler that you want to use as back-end C compiler, you should
163 provide a config file that should be located in
164 <filename class="directory">$GOBO/tool/gec/config/c/</filename>. Here is an
165 example of such config file, <filename>gcc.cfg</filename> for the
166 <projectname>gcc</projectname> compiler:
167 <blockquote><programlisting>
168 cc: gcc $cflags $includes -c $c
169 link: gcc $lflags -lm -o $exe $objs $libs
170 obj: .o
171 exe:
172 cflags:
173 lflags:
174 cflags_finalize: -O2
175 lflags_finalize:
176 </programlisting></blockquote>
177 This config file is used by <projectname>gec</projectname> to generate a
178 .bat file on Windows or a shell script on other platforms that will be
179 executed to compile the generated C code. The variable "cc" represents the
180 command-line template to turn C files into object files, and "link" to
181 turn object files into executables. The variables "$cflags", "$includes",
182 "$c" in the first template, and "$lflags", "$exe", "$objs" and "$libs"
183 in the second template will be replaced by appropriate values by
184 <projectname>gec</projectname>. Next, the variables "obj" and "exe"
185 represent the file extensions for object files and executables on the
186 platform on which this C compiler will be invoked. And finally we find
187 C compilation and linker flags that should be used when
188 <projectname>gec</projectname> is invoked with or without the
189 command-line option "--finalize". Note that Eiffel-style comments,
190 starting with "--", can be included in these config files.
191 </para>
192 <para>
193 There are several ways to instruct <projectname>gec</projectname> to
194 use a different back-end C compiler. You can either write the name
195 of the chosen C compiler in the file <filename>$GOBO/tool/gec/config/c/default.cfg</filename>.
196 You might need to create this file if it does not exist yet. Alternatively
197 you can specify the name of the chosen C compiler in the environment
198 variable $GOBO_CC. Let's say that the name of your chosen C compiler
199 is <projectname>my_cc</projectname>. <projectname>gec</projectname> will
200 then look for the config file <filename>$GOBO/tool/gec/config/c/my_cc.cfg</filename>.
201 </para>
202 </section>
203
204 </chapter>

Properties

Name Value
svn:mime-type text/xml

  ViewVC Help
Powered by ViewVC 1.1.23