Search code examples
erlanglager

Including lager in an erlang.mk project


I'm trying to add lager to a simple erlang.mk project. I understand lager uses parse transforms, so you have to set compile flags accordingly; so following advice from here:

Lager calls failing during Common Test test runs

my Makefile looks as follows:

PROJECT = hello_erlang_mk
DEPS = cowboy lager

# this must be first
include erlang.mk

# Compile flags
ERLC_COMPILE_OPTS= +'{parse_transform, lager_transform}'

# Append these settings
ERLC_OPTS += $(ERLC_COMPILE_OPTS)
TEST_ERLC_OPTS += $(ERLC_COMPILE_OPTS)

The release builds fine but somehow lager never seems to be included:

Eshell V5.10.4  (abort with ^G)
(hello_erlang_mk@127.0.0.1)1> lager:info("~s is ~s!", [lager, cool]).
** exception error: undefined function lager:info/2

Anyone have any pointers on how to get lager working within an erlang.mk project ?

[I'm using Erlang R16B03, Ubuntu 14.04]

Thanks.


Solution

  • Forgive me. Noob error. application:start(lager). Sorry.