The erlc
program provides a common way to run
all compilers in the Erlang system.
Depending on the extension of each input file, erlc
will invoke the appropriate compiler.
Regardless of which compiler is used, the same flags are used to provide parameters such as include paths and output directory.
erlc flags file1.ext file2.ext...
Erlc
compiles one or more files.
The files must include the extension, for example .erl
for Erlang source code, or .yrl
for Yecc source code.
Erlc
uses the extension to invoke the correct compiler.
The following flags are supported:
-include
or -include_dir
directive, the
compiler searches for header files in the following
directories:"."
, the current working directory of the
file server;-I
option.
The directory specified last is searched first.1
.
Use -W0
to turn off warnings.
-W1
. Default.
export_all
option for the Erlang
compiler can be specified as follows:
erlc +export_all file.erlDepending on the platform, the value may need to be quoted if the shell itself interprets certain characters. On Unix, terms which contain tuples and list must be quoted. Terms which contain spaces must be quoted on all platforms.
The flags in this section are useful in special situations such as re-building the OTP system.
.beam
file.
.erl
file.
includefile
option).
.bin
file.
.hrl
file.
path
in the option list for
systools:make_script/2
).
.erl
, .hrl
, and .asn1db
file from
an .asn1
file. Also compiles the .erl
using the Erlang
compiler unless the +noobj
options is given.