[erlang-questions] Build tools

Loïc Hoguin <>
Wed Dec 17 15:59:48 CET 2014


On 12/17/2014 03:38 PM, Zachary Kessin wrote:
> 1) Use a makefile, even if it is a very simple makefile that simply has
> an "all" target that calls mix or rebar

This is what erlang.mk does. It does not care that the dep is written in 
Erlang, LFE, or even that it is an Erlang related project. It'll work 
even if the dep is a set of JS libs that are minified, or a library 
written in C... It just runs "make" on the dep.

Do note that it does not need an "all" target but rather that the result 
of running "make" on that Makefile only builds the project (this is 
expected behavior of a Makefile). The main target can have any name, it 
does not have to be named "all".

Using a Makefile like this also solves the issue that rebar currently 
has in that projects are tested against a version of rebar (often 
included in the repository) and then that version of rebar is ignored 
when building because the top-level rebar builds everything. This means 
that if the top-level rebar has a regression (or an unfortunate "fix") 
your project may not build when used as a dep.

The side effect of doing it this way for rebar however is that rebar 
becomes even slower than it already is as you now have to start the 
Erlang VM and rebar many times and this takes a lot of time.

Note that I say rebar here, because it's what I used in the past, but it 
probably applies to similar tools in the other languages.

-- 
Loïc Hoguin
http://ninenines.eu


More information about the erlang-questions mailing list