`
coderplay
  • 浏览: 571337 次
  • 性别: Icon_minigender_1
  • 来自: 广州杭州
社区版块
存档分类
最新评论

erlc

阅读更多

erlc

命令

erlc

概要

编译器

描述

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提供了一个公共的途径来运行Erlang系统的所有编译器. erlc 会根据于各输入文件的扩展名,来调用合适的编译器.你无须关心哪个编译器被使用了.它们都使用相同的参数,例如include路径和输出目录.

输出


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.

Erlc编译一个或一个以上文件.文件必须包括它们的扩展名.例如.erl代表Erlang源代码,而.yrl代表Yecc源代码.Erlc用扩展名来调用正确的编译器.

一般的有用标记

The following flags are supported:
下面的标记都支持:

-I directory
Instructs the compiler to search for include files in the specified directory. When encountering an -include or -include_dir directive, the compiler searches for header files in the following directories:
指示编译器在指定的目录去查找include文件.编译器每碰到一个 -include或-include_dir标记, 就会在其后指定的目录中查找头文件.
  1. ".", the current working directory of the file server;
    ".", 当前工作目录
  2. the base name of the compiled file;

  3. the directories specified using the -I option. The directory specified last is searched first.
    -I 选项指定目录, 最后指定的目录,却最先被查找.
-o directory
The directory where the compiler should place the output files. If not specified, output files will be placed in the current working directory.
编译器输出文件的目录.如果没定义,输出文件将放置在当前工作目录.
-Dname
Defines a macro.
定义一条宏.
-Dname=value
Defines a macro with the given value. The value can be any Erlang term. Depending 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.
定义一条拥有给定值的宏. 这个值可以是任意Erlang项.根据平台,如果shell自身会解释特定的字符,这个值可能需要用引号标注.在Unix中, 包含元组和list的项必须用引号标注. 有空格的项在所有平台,都得用引号标注.
-Wnumber
Sets warning level to number. Default is 1. Use -W0 to turn off warnings.
将警告级别定义为number级. 默认为1. 用-W0关闭警告.
-W
Same as -W1. Default.
-W1意义一样.默认的.
-v
Enables verbose output.
打开详细输出
-b output-type
Specifies the type of output file. Generally, output-type is the same as the file extension of the output file but without the period. This option will be ignored by compilers that have a a single output format.
指定输入文件类型.一般output-type 如果输出类型只有一种,这个选项就会被忽略.
-hybrid
Compile using the hybrid-heap emulator. This is mainly useful for compiling native code, which needs to be compiled with the same run-time system that it should be run on.
用混合堆模拟器编译. 这对于编译原生代码很有用,同时还需要编译此原生代码能运行的运行时系统.
-smp
Compile using the SMP emulator. This is mainly useful for compiling native code, which needs to be compiled with the same run-time system that it should be run on.
用SMP模拟器编译. 这对于编译原生代码很有用,同时还需要编译此原生代码能运行的运行时系统.
--
Signals that no more options will follow. The rest of the arguments will be treated as file names, even if they start with hyphens.
告诉编译器之后没有选项了.它之后的参数全被当作文件名,尽管以连字符开头也一样.  (译注, 连字符-后面一般是编译器选项,但定义了这个之后,就不是选项了)
+term
A flag starting with a plus ('+') rather than a hyphen will be converted to an Erlang term and passed unchanged to the compiler. For instance, the export_all option for the Erlang compiler can be specified as follows:
一个以加号 ('+')开头而不是连字符开头的选项,会被转义成一个Erlang项,且被原样传入编译器. 例如, Erlang 编译器的export_all选项可以写成如下形式: 
代码
  1. erlc +export_all file.erl  

Depending 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.
根据平台,如果shell自身会解释特定的字符,这个值可能需要用引号标注.在Unix中, 包含元组和list的项必须用引号标注. 有空格的项在所有平台,都得用引号标注.

特殊标记

The flags in this section are useful in special situations such as re-building the OTP system.
此节的标记在特殊情况下有用,比如重编译OTP系统.

-pa directory
Appends directory to the front of the code path in the invoked Erlang emulator. This can be used to invoke another compiler than the default one.
-pz directory
Appends directory to the code path in the invoked Erlang emulator.

支持的编译器

.erl
Erlang source code. It generates a .beam file.
The options -P, -E, and -S are equivalent to +'P', +'E', and +'S', except that it is not necessary to include the single quotes to protect them from the shell.
Supported options: -I, -o, -D, -v, -W, -b.
Erlang源文件.生成 .beam文件.
.yrl
Yecc source code. It generates an .erl file.
Use the -I option with the name of a file to use that file as a customized prologue file (the includefile option).
Supported options: -o, -v, -I, -W (see above).
.mib
MIB for SNMP. It generates a .bin file.
Supported options: -I, -o, -W.
.bin
A compiled MIB for SNMP. It generates a .hrl file.
Supported options: -o, -v.
.rel
Script file. It generates a boot file.
Use the -I to name directories to be searched for application files (equivalent to the path in the option list for systools:make_script/2).
Supported options: -o.
脚本文件. 生成boot 文件.
.asn1
ASN1 file.
Creates an .erl, .hrl, and .asn1db file from an .asn1 file. Also compiles the .erl using the Erlang compiler unless the +noobj options is given.
Supported options: -I, -o, -b, -W.
.idl
IC file.
Runs the IDL compiler.
Supported options: -I, -o.

环境变量

ERLC_EMULATOR
The command for starting the emulator. Default is erl in the same directory as the erlc program itself, or if it doesn't exist, erl in any of the directories given in the PATH environment variable.
启动模拟器的命令. 默认erlerlc程序在同一目录, 如果此环境变量不存在, erlPATH环境变量给出的一个目录中.

另见

erl(1), compile(3), yecc(3), snmp(3)

分享到:
评论

相关推荐

    SublimeLinter-contrib-erlc:[Python]用于Erlang的SublimeLinter插件,使用erlc

    崇高的梦想 这对棉短绒插件提供了一个接口 。 它将与具有Erlang或Erlang Improved... 一旦安装并配置了erlc ,您可以继续安装SublimeLinter-contrib-erlc插件(如果尚未安装)。 插件安装 请使用安装linter插件。 这

    Eric6-17.12汉化文件以及2020.1版源文件

    最近项目需要使用PyQt5进行GUI开发,而与PyQt配合最为默契、最能够提高开发效率的就非Eric6莫属。目前Eric6的最新版本可以从官网免费下载,但与之相配的中文版却在17年12月之后便停止了更新,而且前一段时间官方也将...

    erl_unused_includes

    如果您正在使用 Make 并且您有一个配置变量来指定要使用的 erlc,例如: ERLC=/path/to/erlc那么你应该能够简单地插入这个脚本,以便在你所有的 .erl 文件上运行它: ERLC=/path/to/erl_unused_includes.sh /path/...

    bazel-erlang

    load ( "@bazel-erlang//:bazel_erlang_lib.bzl" , "bazel_erlang_lib" , "erlang_lib" , "erlc" ) load ( "@bazel-erlang//:ct.bzl" , "ct_suite" ) APP_NAME = "my_cool_app" APP_VERSION = " 0.1 . 0 erlang_lib ...

    file-transfer:文件传输(通过 TCP 上传下载文件)

    erlc *.erl; 脚本服务器.erl ##启动客户端 在源文件夹中创建客户端文件夹。 更改 config.hrl 中的 HOST 宏。 (设置你的服务器ip地址) erlc *.erl; 脚本客户端.erl ##DOWNLOAD 下载文件名(带扩展名) ##...

    atom-lint:过时的

    erlc for Erlang(需要安装language-erlang包) 特征 与 Atom 无缝集成,就好像它是一个内置包一样。 代码突出显示 – 您无需将视线从代码上移开即可查看违规情况。 干净的用户界面 - 它尊重您最喜欢的 Atom ...

    erlyberly:大众的erlang追踪

    erlyberly正在寻找参与者,特别是如果您想编写Java代码。 看看问题或在 ping我。犯规 erlyberly是使用erlang跟踪的erlang, 和LFE调试器... 您将需要在路径上erlc(二郎编译器)和JDK 8u20或更高版本安装到erlyberly运

    mod_http_offline:ejabberd 模块在用户离线时发送帖子

    Ejabberd 模块在用户... erlc -I /lib/ejabberd/include/ -pa ~/ejabberd/deps/lager/ebin/ mod_http_offline.erl 将 .beam 文件移动到 ejabberd ebin 文件夹: sudo mv mod_http_offline.beam /lib/ejabberd/ebin

    atc872:ATC872 - 轻量级、快速、有弹性、基于浏览器的实时聊天服务器

    ATC872概述ATC872 是一个多频道聊天服务器。 用户通过网络浏览器访问 ATC872,以便在对话频道中关注、贡献和搜索。 ATC872 是使用 Erlang ( ) 构建的,旨在跨多... 编译atc872.erl: erlc atc872.erl 设置 Erlang 的 Mn

    ejabberd-stanza-ack:ejabberd 13.xx的ejabberd节确认模块

    erlc -I $ {EJABBERD_SRC} mod_stanza_ack.erl {EJABBERD_SRC}必须替换为ejabberd源文件的实际位置,例如/ home / foobar / ejabberd / src。 可以在找到此文件夹的示例。 使用以下命令将已编译的.beam文件移动到...

    mod_last_seen:类似于上次使用通用odbc驱动程序的功能的whatsapp

    安装说明首先,我们需要通过运行以下命令将此.erl文件编译为.beam文件: erlc -I $ {EJABBERD_SRC} mod_last_seen.erl {EJABBERD_SRC}必须替换为ejabberd源文件的实际位置,例如/ home / foobar / ejabberd / src。...

    forms:一个简化使用Erlang抽象格式的库

    形式 一个简化使用。 上提供了。 如果您想进一步了解forms可以为您做什么,请检查以下... 需要注意的是,为了能够获取一个束文件的AST Erlang的二进制文件必须已经使用编译debug_info选项(例如, erlc -o ebin +de

    pierl:Erlang 中的异步 pi 演算

    π-erl:在 Erlang 中建模的异步 pi 演算 欢迎! 可能你在谷歌上搜索/duckduckgo'ed/搜索(希望不是bing'ed)类似“pi-calculus erlang”的东西,也许你甚至不确定你在找什么。... erlc -o ebin/ src/*.

    AtomVM:Tiny Erlang VM

    erlc( )是构建AtomVM所必需的 运行标准BEAM文件(不带未压缩文字扩展名)时,可选地需要zlib( )。 可选地需要使用gcov和lcov来生成覆盖率报告(进行覆盖)。 可选用doxygen生成文档(制作doc)。 支持平台 ...

    erlang-html5-chatroom:一个聊天室demo,用来测试html5 websocket 和 erlang 的通信

    erlang-html5-chatroom 一个聊天室demo,用来测试html5 websocket 和 erlang 的通信 服务端 编译: cd server erlc *.erl 运行: erl 1>chatroom:start(9000).

    sonic_pi_interface:声波接口

    sonic_pi_interface 声波接口要运行这个手动编译 sonic.erl erlc sonic.erl 然后编译erlang-osc-master cd erlang-osc-master make 启动 sonic pi 并发出命令./run.sh

    springboot集成mariaDB,mybatis自动生成对应的mapper,pojo,dao类文件

    springboot集成MariaDB以及阿里druid线程池,通过公共Mapper工具自动生成表所对应的xml,pojo,dao文件,从而简化大量的sql文件编写以及节省工作量。

    SpringBoot项目生成war包

    SpringBoot项目生成war包

    SpringBoot集成Druid+MariaDB+Lombok+Mybatis-Plus详解

    Druid:是阿里巴巴开源平台上一个数据库连接池实现,它结合了C3P0、DBCP、PROXOOL等DB池的优点,同时加入了日志监控,可以很好的监控DB池连接和SQL的执行情况 MariaDB:是最流行的开源关系型数据库之一。...

    SpringBoot启动图片banner -- 佛祖保佑 永不宕机 永无BUG

    自定义SpringBoot启动图片banner -- 佛祖保佑 永不宕机 永无BUG

Global site tag (gtag.js) - Google Analytics