我的一个依赖项不使用rebar
- 它使用Makefile。我如何得到rebar
来运行这个Makefile,而不是试图编译源码本身?如何让钢筋为依赖运行'make'?
请注意,我想继续使用螺纹钢的一切。
我的一个依赖项不使用rebar
- 它使用Makefile。我如何得到rebar
来运行这个Makefile,而不是试图编译源码本身?如何让钢筋为依赖运行'make'?
请注意,我想继续使用螺纹钢的一切。
看着rebar.config example file,你可以标记依赖关系为raw
,这意味着它不是由钢筋编译的。然后你可以添加一个pre或post编译钩子来在该依赖目录中运行make。假设他们具有OTP文件结构,那么rebar generate
命令应该仍然能够获取在那里构建的任何Erlang应用程序。
如果使用rebar
通过make
,你可以这样的代码添加到您的Makefile:
@if [[ -f [email protected]/Makefile ]]; \
then echo 'make -C [email protected] all' ; \
make -C [email protected] all ; \
else echo 'cd [email protected] && rebar get-deps compile && cd ../..' ; \
cd [email protected] && rebar get-deps compile && cd ../.. ; fi
它检查是否有[email protected]
一个Makefile然后决定是否使用make
或rebar
。
这段代码是从erl.mk
https://github.com/fenollp/erl-mk/blob/master/erl.mk#L17-L21