~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to erts/doc/src/erlc.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE comref SYSTEM "comref.dtd">
 
3
 
 
4
<comref>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>1997</year>
 
8
      <year>2007</year>
 
9
      <holder>Ericsson AB, All Rights Reserved</holder>
 
10
    </copyright>
 
11
    <legalnotice>
 
12
  The contents of this file are subject to the Erlang Public License,
 
13
  Version 1.1, (the "License"); you may not use this file except in
 
14
  compliance with the License. You should have received a copy of the
 
15
  Erlang Public License along with this software. If not, it can be
 
16
  retrieved online at http://www.erlang.org/.
 
17
 
 
18
  Software distributed under the License is distributed on an "AS IS"
 
19
  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
20
  the License for the specific language governing rights and limitations
 
21
  under the License.
 
22
 
 
23
  The Initial Developer of the Original Code is Ericsson AB.
 
24
    </legalnotice>
 
25
 
 
26
    <title>erlc</title>
 
27
    <prepared>Bj&ouml;rn Gustavsson</prepared>
 
28
    <responsible>Bjarne D&auml;cker</responsible>
 
29
    <docno>1</docno>
 
30
    <approved>Bjarne D&auml;cker</approved>
 
31
    <checked></checked>
 
32
    <date>97-03-24</date>
 
33
    <rev>A</rev>
 
34
    <file>erlc.sgml</file>
 
35
  </header>
 
36
  <com>erlc</com>
 
37
  <comsummary>Compiler</comsummary>
 
38
  <description>
 
39
    <p>The <c><![CDATA[erlc]]></c> program provides a common way to run
 
40
      all compilers in the Erlang system.
 
41
      Depending on the extension of each input file, <c><![CDATA[erlc]]></c>
 
42
      will invoke the appropriate compiler.
 
43
      Regardless of which compiler is used, the same flags are used to provide parameters such as include paths and output directory.</p>
 
44
    <p></p>
 
45
  </description>
 
46
  <funcs>
 
47
    <func>
 
48
      <name>erlc flags file1.ext file2.ext...</name>
 
49
      <fsummary>Compile files</fsummary>
 
50
      <desc>
 
51
        <p><c><![CDATA[Erlc]]></c> compiles one or more files.
 
52
          The files must include the extension, for example <c><![CDATA[.erl]]></c>
 
53
          for Erlang source code, or <c><![CDATA[.yrl]]></c> for Yecc source code.
 
54
          <c><![CDATA[Erlc]]></c> uses the extension to invoke the correct compiler.</p>
 
55
      </desc>
 
56
    </func>
 
57
  </funcs>
 
58
 
 
59
  <section>
 
60
    <title>Generally Useful Flags</title>
 
61
    <p>The following flags are supported:
 
62
      </p>
 
63
    <taglist>
 
64
      <tag>-I <em>directory</em></tag>
 
65
      <item>
 
66
        <p>Instructs the compiler to search for include files in
 
67
          the specified directory. When encountering an
 
68
          <c><![CDATA[-include]]></c> or <c><![CDATA[-include_dir]]></c> directive, the
 
69
          compiler searches for header files in the following
 
70
          directories:</p>
 
71
        <list type="ordered">
 
72
          <item>
 
73
            <p><c><![CDATA["."]]></c>, the current working directory of the
 
74
              file server;</p>
 
75
          </item>
 
76
          <item>
 
77
            <p>the base name of the compiled file;</p>
 
78
          </item>
 
79
          <item>
 
80
            <p>the directories specified using the <c><![CDATA[-I]]></c> option.
 
81
              The directory specified last is searched first.</p>
 
82
          </item>
 
83
        </list>
 
84
      </item>
 
85
      <tag>-o <em>directory</em></tag>
 
86
      <item>
 
87
        <p>The directory where the compiler should place the output files.
 
88
          If not specified, output files will be placed in the current working
 
89
          directory.</p>
 
90
      </item>
 
91
      <tag>-D<em>name</em></tag>
 
92
      <item>
 
93
        <p>Defines a macro.</p>
 
94
      </item>
 
95
      <tag>-D<em>name</em>=<em>value</em></tag>
 
96
      <item>
 
97
        <p>Defines a macro with the given value.
 
98
          The value can be any Erlang term.
 
99
          Depending on the platform, the value may need to be
 
100
          quoted if the shell itself interprets certain characters.
 
101
          On Unix, terms which contain tuples and list
 
102
          must be quoted. Terms which contain spaces
 
103
          must be quoted on all platforms.</p>
 
104
      </item>
 
105
      <tag>-W<em>number</em></tag>
 
106
      <item>
 
107
        <p>Sets warning level to <em>number</em>. Default is <c><![CDATA[1]]></c>.
 
108
          Use <c><![CDATA[-W0]]></c> to turn off warnings.</p>
 
109
      </item>
 
110
      <tag>-W</tag>
 
111
      <item>
 
112
        <p>Same as <c><![CDATA[-W1]]></c>. Default.</p>
 
113
      </item>
 
114
      <tag>-v</tag>
 
115
      <item>
 
116
        <p>Enables verbose output.</p>
 
117
      </item>
 
118
      <tag>-b <em>output-type</em></tag>
 
119
      <item>
 
120
        <p>Specifies the type of output file.
 
121
          Generally, <em>output-type</em> is the same as the file extension
 
122
          of the output file but without the period.
 
123
          This option will be ignored by compilers that have a
 
124
          a single output format.</p>
 
125
      </item>
 
126
      <tag>-hybrid</tag>
 
127
      <item>
 
128
        <p>Compile using the hybrid-heap emulator. This is mainly useful
 
129
          for compiling native code, which needs to be compiled with the same
 
130
          run-time system that it should be run on.</p>
 
131
      </item>
 
132
      <tag>-smp</tag>
 
133
      <item>
 
134
        <p>Compile using the SMP emulator. This is mainly useful
 
135
          for compiling native code, which needs to be compiled with the same
 
136
          run-time system that it should be run on.</p>
 
137
      </item>
 
138
      <tag>--</tag>
 
139
      <item>
 
140
        <p>Signals that no more options will follow.
 
141
          The rest of the arguments will be treated as file names,
 
142
          even if they start with hyphens.</p>
 
143
      </item>
 
144
      <tag>+<em>term</em></tag>
 
145
      <item>
 
146
        <p>A flag starting with a plus ('<em>+</em>') rather than a hyphen
 
147
          will be converted to an Erlang term and passed unchanged to
 
148
          the compiler.
 
149
          For instance, the <c><![CDATA[export_all]]></c> option for the Erlang
 
150
          compiler can be specified as follows:</p>
 
151
        <pre>
 
152
erlc +export_all file.erl</pre>
 
153
        <p>Depending on the platform, the value may need to be
 
154
          quoted if the shell itself interprets certain characters.
 
155
          On Unix, terms which contain tuples and list
 
156
          must be quoted. Terms which contain spaces
 
157
          must be quoted on all platforms.</p>
 
158
      </item>
 
159
    </taglist>
 
160
  </section>
 
161
 
 
162
  <section>
 
163
    <title>Special Flags</title>
 
164
    <p>The flags in this section are useful in special situations
 
165
      such as re-building the OTP system.</p>
 
166
    <taglist>
 
167
      <tag>-pa <em>directory</em></tag>
 
168
      <item>
 
169
        <p>Appends <em>directory</em> to the front of the code path in
 
170
          the invoked Erlang emulator.
 
171
          This can be used to invoke another
 
172
          compiler than the default one.</p>
 
173
      </item>
 
174
      <tag>-pz <em>directory</em></tag>
 
175
      <item>
 
176
        <p>Appends <em>directory</em> to the code path in
 
177
          the invoked Erlang emulator.</p>
 
178
      </item>
 
179
    </taglist>
 
180
  </section>
 
181
 
 
182
  <section>
 
183
    <title>Supported Compilers</title>
 
184
    <taglist>
 
185
      <tag>.erl</tag>
 
186
      <item>
 
187
        <p>Erlang source code. It generates a <c><![CDATA[.beam]]></c> file.</p>
 
188
        <p>The options -P, -E, and -S are equivalent to +'P',
 
189
          +'E', and +'S', except that it is not necessary to include the single quotes to protect them
 
190
          from the shell.</p>
 
191
        <p>Supported options: -I, -o, -D, -v, -W, -b.</p>
 
192
      </item>
 
193
      <tag>.yrl</tag>
 
194
      <item>
 
195
        <p>Yecc source code. It generates an <c><![CDATA[.erl]]></c> file.</p>
 
196
        <p>Use the -I option with the name of a file to use that file
 
197
          as a customized prologue file (the <c><![CDATA[includefile]]></c> option).</p>
 
198
        <p>Supported options: -o, -v, -I, -W (see above).</p>
 
199
      </item>
 
200
      <tag>.mib</tag>
 
201
      <item>
 
202
        <p>MIB for SNMP. It generates a <c><![CDATA[.bin]]></c> file.</p>
 
203
        <p>Supported options: -I, -o, -W.</p>
 
204
      </item>
 
205
      <tag>.bin</tag>
 
206
      <item>
 
207
        <p>A compiled MIB for SNMP. It generates a <c><![CDATA[.hrl]]></c> file.</p>
 
208
        <p>Supported options: -o, -v.</p>
 
209
      </item>
 
210
      <tag>.rel</tag>
 
211
      <item>
 
212
        <p>Script file. It generates a boot file.</p>
 
213
        <p>Use the -I to name directories to be searched for application
 
214
          files (equivalent to the <c><![CDATA[path]]></c> in the option list for
 
215
          <c><![CDATA[systools:make_script/2]]></c>).</p>
 
216
        <p>Supported options: -o.</p>
 
217
      </item>
 
218
      <tag>.asn1</tag>
 
219
      <item>
 
220
        <p>ASN1 file.</p>
 
221
        <p>Creates an <c><![CDATA[.erl]]></c>, <c><![CDATA[.hrl]]></c>, and <c><![CDATA[.asn1db]]></c> file from
 
222
          an <c><![CDATA[.asn1]]></c> file. Also compiles the <c><![CDATA[.erl]]></c> using the Erlang
 
223
          compiler unless the <c><![CDATA[+noobj]]></c> options is given.</p>
 
224
        <p>Supported options: -I, -o, -b, -W.</p>
 
225
      </item>
 
226
      <tag>.idl</tag>
 
227
      <item>
 
228
        <p>IC file.</p>
 
229
        <p>Runs the IDL compiler.</p>
 
230
        <p>Supported options: -I, -o.</p>
 
231
      </item>
 
232
    </taglist>
 
233
  </section>
 
234
 
 
235
  <section>
 
236
    <title>Environment Variables</title>
 
237
    <taglist>
 
238
      <tag>ERLC_EMULATOR</tag>
 
239
      <item>The command for starting the emulator.
 
240
       Default is <em>erl</em> in the same directory as the <em>erlc</em> program
 
241
       itself, or if it doesn't exist, <em>erl</em> in any of the directories
 
242
       given in the <em>PATH</em> environment variable.</item>
 
243
    </taglist>
 
244
  </section>
 
245
 
 
246
  <section>
 
247
    <title>SEE ALSO</title>
 
248
    <p><seealso marker="erl">erl(1)</seealso>,
 
249
      <seealso marker="compiler:compile">compile(3)</seealso>,
 
250
      <seealso marker="parsetools:yecc">yecc(3)</seealso>,
 
251
      <seealso marker="snmp:snmp">snmp(3)</seealso></p>
 
252
  </section>
 
253
</comref>
 
254