【问题标题】:How to get rebar to run 'make' for a dependency?如何让钢筋为依赖项运行“make”?
【发布时间】:2013-12-11 20:05:03
【问题描述】:

我的一个依赖项不使用rebar——它使用了一个Makefile。如何让rebar 运行此 Makefile,而不是尝试编译源代码本身?

请注意,我想继续将钢筋用于其他一切。

【问题讨论】:

    标签: erlang rebar


    【解决方案1】:

    查看rebar.config example file,您可以将依赖项标记为raw,这意味着它不是由rebar 编译的。然后,您可以添加预编译或后编译挂钩以在该依赖目录中运行 make。 rebar generate 命令应该仍然能够获取任何在那里构建的 Erlang 应用程序,假设它们具有 OTP 文件结构。

    【讨论】:

      【解决方案2】:

      如果您使用rebarmake,您可以将这种代码添加到您的 Makefile:

          @if [[ -f $@/Makefile ]]; \
          then echo 'make -C $@ all' ; \
                     make -C $@ all  ; \
          else echo 'cd $@ && rebar get-deps compile && cd ../..' ; \
                     cd $@ && rebar get-deps compile && cd ../..  ; fi
      

      它检查$@ 是否有Makefile,然后决定是使用make 还是rebar

      这个sn-p来自erl.mkhttps://github.com/fenollp/erl-mk/blob/master/erl.mk#L17-L21

      【讨论】:

        猜你喜欢
        • 2012-08-06
        • 1970-01-01
        • 2017-03-17
        • 2012-10-03
        • 1970-01-01
        • 2015-03-30
        • 2016-08-05
        • 2015-04-09
        • 1970-01-01
        相关资源
        最近更新 更多