[erlang-questions] Re: Using the -M dependencies generator of erlc

Matthew Sackman matthew@REDACTED
Sun Apr 3 11:59:18 CEST 2011


On Sun, Apr 03, 2011 at 12:48:51PM +0300, Stavros Aronis wrote:
> I've been trying to make Dialyzer's makefile use the new functionality
> added in R14B02 to erlc: "Dependency generation for Makefiles has been
> added to the compiler and erlc. See the manual pages for compile and
> erlc."

(Apologies for potentially hijacking this thread.)

As the man page says, this is only for tracking header dependencies,
which, IME, is at best only part of the story. Tracking behaviours and
parse_transformers are just as, if not more, important.

Eg, file state_t.erl:
-module(state_t, [InnerMonad]).
-compile({parse_transform, erlando}).

-behaviour(monad).

> erlc -pa ebin -M src/state_t.erl 
state_t.beam: src/state_t.erl

I don't think so! Our generate_deps script correctly spits out:

ebin/state_t.beam: src/state_t.erl ebin/monad.beam ebin/erlando.beam

You may like to have a look at 
http://hg.rabbitmq.com/erlando/file/default/Makefile and
http://hg.rabbitmq.com/erlando/file/default/generate_deps

(and yes, generate_deps also copes with headers, and you get just one
file of additional dependencies which you can then -include into your
Makefile).

Matthew



More information about the erlang-questions mailing list