Skip to content
This repository
branch: master
Andreas Stenius
executable file 63 lines (46 sloc) 1.453 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
ERL=erl
ERLC=erlc
REBAR=./rebar $(REBAR_ARGS)

all: compile tests

compile: check-slex get-deps
@$(REBAR) compile

check-slex: src/erlydtl_scanner.erl
src/erlydtl_scanner.erl: src/erlydtl_scanner.slex
@echo Notice: $@ is outdated by $<, consider running "'make slex'".

get-deps:
@$(REBAR) get-deps

update-deps:
@$(REBAR) update-deps

.PHONY: tests
tests: src/erlydtl_parser.erl
@$(REBAR) eunit

check: tests dialyze

DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions -Wunmatched_returns
dialyze:
@dialyzer -nn $(DIALYZER_OPTS) ebin || [ $$? -eq 2 ];

## In case you are missing a plt file for dialyzer,
## you can run/adapt this command
PLT_APPS ?=
plt:
@dialyzer -n -nn --build_plt --apps \
erts kernel stdlib sasl compiler \
crypto syntax_tools runtime_tools \
tools webtool hipe inets eunit

clean:
@echo "Clean merl..." ; $(MAKE) -C deps/merl clean
@$(REBAR) -C rebar-slex.config clean
rm -fv erl_crash.dump

# rebuild any .slex files as well.. not included by default to avoid
# the slex dependency, which is only needed in case the .slex file has
# been modified locally.
slex: REBAR_DEPS ?= get-deps update-deps
slex: slex-compile

slex-skip-deps: REBAR_DEPS:=
slex-skip-deps: slex-compile

slex-compile:
@$(REBAR) -C rebar-slex.config $(REBAR_DEPS) compile

shell:
@$(ERL) -pz ebin deps/*/ebin


# this file must exist for rebar eunit to work
# but is only built when running rebar compile
src/erlydtl_parser.erl: compile
Something went wrong with that request. Please try again.