我的一个依赖项没有使用rebar --它使用了Makefile。如何让rebar运行这个Makefile,而不是尝试编译源代码本身?
请注意,我想继续使用rebar来做其他事情。
发布于 2013-12-09 17:38:44
查看rebar.config example file,您可以将依赖项标记为raw,这意味着它不是由rebar编译的。然后,您可以添加一个预编译或编译后钩子,以在该依赖目录中运行make。rebar generate命令应该仍然能够拾取在那里构建的任何Erlang应用程序,假设它们具有动态口令文件结构。
发布于 2013-12-11 20:05:03
如果您通过make使用rebar,则可以将此类代码添加到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。
此代码片段来自erl.mk https://github.com/fenollp/erl-mk/blob/master/erl.mk#L17-L21
https://stackoverflow.com/questions/20466064
复制相似问题