• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

mmake: emakefile的并行编译

原作者: [db:作者] 来自: 网络 收藏 邀请

#usage

  • this file based on otp_src/lib/tools/src/make.erl, support the multiple processes compile.
  • the exported functions are like make.erl, except for add the Worker Number as the first argument for every functions.

e.g. mmake:all(5), means you compile the codes defined in Emakefile by 5 workers.

in your Makefile or script :

erl -eval "case make:files([\"mmake.erl\"], [{outdir, \"ebin\"}]) of error -> halt(1); _ -> ok end"     -eval "case mmake:all(8,[$(MAKE_OPTS)]) of up_to_date -> halt(0); error -> halt(1) end."

使用

  • 这个编译文件基于 otp_src/lib/tools/src/make.erl, 支持多进程编译。
  • 模块的导出函数跟make.erl文件类似, 增加了Worker Number 作为每个函数的第一个参数。

举例:mmake:all(5), 指通过5个workers进程来编译你来的代码。

在你的Makefile、script或者.bat(windows下的批处理文件)中加入下述代码:

erl -eval "case make:files([\"mmake.erl\"], [{outdir, \"ebin\"}]) of error -> halt(1); _ -> ok end"     -eval "case mmake:all(8,[$(MAKE_OPTS)]) of up_to_date -> halt(0); error -> halt(1) end."

注意:通常mmake.erl的存放路径为: "deps/mmake/mmake.erl"


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap