[99s-extend] Trying to grok erlang.mk
Ivan Uemlianin
ivan at llaisdy.com
Fri Mar 7 13:37:27 CET 2014
Dear Lloyd
I've just tried this with file layout and contents copied from your
email, and make works fine here I'm afraid.
One odd thing I noticed in your make output ...
> /min$ make
> ERLC min.erl
> APP min .app.src
> cat: src/min: No such file or directory
> cat: .app.src: No such file or directory
> sed: can't read .app: No such file or directory
> make: *** [app] Error 2
... is that in the APP line, the filename min.app.src has a space in it,
and it looks (in the cat lines) like it's broken down into src/min and
.app.src (ie ./.app.src). I can't imagine why that's happening, but
that's what's causing the problem I should think.
> 2) How can I structure directories and make files for a project
> that involves several applications?
I don't know if it's the "correct" way with erlang.mk but, as a refugee
from rebar, I have apps set out rebar-style and use old-school recursive
make. e.g.:
max/
erlang.mk
Makefile
apps/
app1/
Makefile
src/
app2/
Makefile
src/
Top level Makefile doesn't need to include erlang.mk, and has lines like:
all:
$(MAKE) -C apps/app1
$(MAKE) -C apps/app2
Lower level Makefiles include erlang.mk.
Best wishes
Ivan
On 06/03/2014 20:29, lloyd at writersglen.com wrote:
> Hello,
>
> To secure my understanding of erlang.mk, I've been trying to create the simplest possible example I can imagine. Which gives me this:
>
> min
> erlang.mk
> Makefile
> src
> min.app.src
> min.erl
>
> *** Where Makefile is:
>
> PROJECT = min
>
> include erlang.mk
>
> *** min.app.src is:
>
> {application, min,
> [{description,[]},
> {vsn,"0.1.0"},
> {registered,[]},
> {applications,[kernel,stdlib]},
> {env,[]},
> {modules,[]}]}.
>
> *** and min.erl is:
>
> -module(min).
>
> -export([hello/0]).
>
> hello() ->
> io:format("Hello min!~n~n").
>
> *** But when I call make, I get this:
>
> /min$ make
> ERLC min.erl
> APP min .app.src
> cat: src/min: No such file or directory
> cat: .app.src: No such file or directory
> sed: can't read .app: No such file or directory
> make: *** [app] Error 2
>
> *** Observations
>
> min.erl compiles just fine
> min.app.src breaks the compile
>
> *** Questions:
>
> 1) How can I correct this?
> 2) How can I structure directories and make files for a project that involves several applications?
>
> Many thanks,
>
> LRP
>
>
> *********************************************
> My books:
>
> THE GOSPEL OF ASHES
> http://thegospelofashes.com
>
> Strength is not enough. Do they have the courage
> and the cunning? Can they survive long enough to
> save the lives of millions?
>
> FREEIN' PANCHO
> http://freeinpancho.com
>
> A community of misfits help a troubled boy find his way
>
> AYA TAKEO
> http://ayatakeo.com
>
> Star-crossed love, war and power in an alternative
> universe
>
> Available through Amazon or by request from your
> favorite bookstore
>
>
> **********************************************
>
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>
--
============================================================
Ivan A. Uemlianin PhD
Llaisdy
Speech Technology Research and Development
ivan at llaisdy.com
www.llaisdy.com
llaisdy.wordpress.com
github.com/llaisdy
www.linkedin.com/in/ivanuemlianin
festina lente
============================================================
More information about the Extend
mailing list