`
hideto
  • 浏览: 2650045 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Erlang里的make

阅读更多
Erlang自带一个make工具
我们看一个例子

目录结构:
--Emakefile
-include
 --test.hrl
-src
 --test.erl
-ebin


Emakefile:
{'src/*', [{i, "include"}, {outdir, "ebin"}]}.


test.hrl:
-record(server_opts,
  {port,
   ip="127.0.0.1",
   max_connections=10}).


test.erl:
-module(test).
-include("test.hrl").

-export([start/0]).

start() ->
  Opts1 = #server_opts{port=80},
  io:format("~p~n", [Opts1#server_opts.ip]),
  io:format("~p~n", [Opts1#server_opts.port]),
  io:format("~p~n", [Opts1#server_opts.max_connections]).


使用Erlang的make:
erl -make


运行:
erl -noshell -pa ./ebin -s test start -s init stop


结果:
"127.0.0.1"
80
10
分享到:
评论
2 楼 zdx3578 2010-11-19  
个人感觉  Erlang自带的Emakefile  简单方便 很好
1 楼 xuexixht 2010-01-18  
学习了。
Erlang自带的Emakefile与Makefile区别挺大的,Joe的书在第6章讲到了Makefile,但是不是很详细,楼主能否就二者在Erlang编译环境中的应用详细总结下呢?感谢。

相关推荐

    erlang-mmake.erl

    好东西,一个erlang并行编译的源码。通过对make.erl(otp/lib/tools/src/make.erl)进行修改,提供一个支持多进程编译的mmake.erl。其接口和make.erl相似,只是第一个参数为并发编译数

    mmake:优化Erlang多核编译 Erlang compiler optimization of multi process

    mmaker为多进程编译,修改自otp/lib/tools/src/make.erl,可以启动多个process进行编译,从而提高编译速度。 本版本优化编译等待,一个文件编译完成后,立即进行后续文件编译,不用等待分组完成。 Usage: erl -pa ebin ...

    erlang19安装包

    Erlang/OTP 19.1 is a service release containing mostly bug fixes, as well as a number of new features and characteristics improvements. Some highlights of the release are: erts: Improved dirty ...

    erlang otp_src_20.2安装包

    此文件为otp_src_20.2.tar.gz 的二次压缩文件 解压先用unzip otp_src_20.2.zip 出来, 然后就是安装时的 tar -zxvf otp_src_20.2.tar.gz内容了, 此文件为了自己使用是方便找到,请把分数定为1分,谢谢

    erlang_ls:Erlang 语言服务器

    最低要求 快速开始编译项目: make要在/usr/local/bin安装生成的erlang_ls escript: make install命令行参数这些是可以提供给erlang_ls脚本的命令行参数: Usage: Erlang LS [-v] [-t [ < transport> ]] [-p [ ...

    Erlang and OTP in Action

    Erlang, and the OTP platform, make it possible to deliver more robust applications that satisfy rigorous uptime and performance requirements. Erlang and OTP in Action teaches you to apply Erlang’s ...

    Erlang and OTP in Action MEAP May 2010

    Erlang and OTP in Action Martin Logan, Eric Merritt, and Richard Carlsson ...Chapter Fifteen: Make it Faster Appendix A – Installing Erlang Appendix B – Lists and Referential Transparency

    Erlang生态的分布式Pythonpy.zip

    Make module-level calls Get module-level constants Instantiate objects Call object methods Get object attributes Call builtins and operators with convenient wrappers 在分布式环境中运行 Python...

    erlang启动多节点,跨节点调用函数

    1.完成makefile,直接运行/script目录中的makefile.cmd就能编译文件 2.完成启动多节点的脚本,运行/script目录中的run.cmd可以启动3个节点, 节点的配置在/config目录config.txt中 3.完成跨节点函数的调用,记录...

    安装erlang环境

    wget http://erlang.org/download/otp_src_18.2.1.tar.gz tar xvfz otp_src_18.2.1.tar.gz ./configure make install

    erlang-oauth:Erlang OAuth 1.0实现

    erlang-oauth 的Erlang实现。 ... Erlang / OTP兼容性 Erlang / OTP 21或更高版本。... $ make ... $ erl -pa ebin -s crypto -s inets ... 1> Consumer = {"key", "secret", hmac_sha1}. ... 2> RequestTokenURL =

    erlang-kafka:Erlang 的 Kafka 消费者协议

    要构建运行make 。 客户 Kafka 协议客户端作为 OTP gen_server运行。 范围 描述 默认 笔记 主持人 要连接的 Kafka 代理的主机名 本地主机 主机名或 IP 地址作为元组 港口 Kafka 代理使用的端口号 9092 客户编号 ...

    Erlang 24.0 Linux

    Erlang 24.0 使用方式解压./configure && make && make install

    erlang_v8_lib:一个小包装器,围绕erlang-v8创建一个迷你框架

    erlang_v8_lib 建立在erlang_v8之上的自以为是JavaScript框架。 erlang_v8_lib是一个Erlang应用程序,其中包括一个小型框架,以简化向脚本环境添加功能的任务。 该应用程序添加了三个主要组件来完成此任务: v8...

    eimp:Erlang图像处理过程

    要求GNU Make 海湾合作委员会Erlang / OTP 17及更高版本libgd libwebp libpng libjpeg 注意:很难说需要哪个版本的C库,但是似乎不太老的版本应该能很好地工作。安装 $ ./configure$ make请注意,强烈建议运行...

    erlang 23.2 版本

    erlang 23.2 版本可以直接解压后进入文件夹 执行./otp_build autoconf 之后 ./configure && make && make install

    Building Web Applications with Erlang

    basic truth that must be recognized: when you pick up your phone to make a call, it normally just works. So people have started to realize that telecom folks must be doing something right!

    erlang-irc-bot:Erlang中的一个简单的可扩展irc机器人

    用Erlang编写的可扩展ircbot 当我决定需要学习Erlang时,一切就开始了。... make 其次,编辑settings.cfg.example文件并将其重命名为settings.cfg 。 然后启动一个Erlang REPL shell。 确保将模块路径设置为./ebin/目

    erlang_docker

    Erlang Docker用于在 MacOS 上为 Ubuntu 构建 Erlang 项目将这些文件复制到项目的子文件夹中,我总是使用/docker make docker.build然后运行make docker.build成功后您可以运行make docker.shell这将启动您的 Docker...

    v6hex:Erlang 的 IPv6 十六进制地址库

    v6hex:Erlang 的 IPv6 十六进制... make 构建脚本基于 。 去做 Edoc 兼容文档 测试用例 代码作者: 健二力武 Tuncer Ayaz 用于support/getrebar脚本 谢谢: 弗朗切斯科·塞萨里尼 Frédéric Trottier-Hébert 中

Global site tag (gtag.js) - Google Analytics