Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
# Author: Manolis Papadakis
# Description: Instructions for make

REBAR_BIN = $(shell which rebar)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this to

+REBAR_BIN ?= $(shell which rebar || echo ./rebar)

And three lines below are not necessary anymore. Moreover, we can specify the rebar binary with the environment variable.

ifeq ($(REBAR_BIN),)
REBAR_BIN = ./rebar
endif

.PHONY: default all compile dialyzer check_escripts tests doc clean distclean rebuild retest

default: get-deps compile
Expand All @@ -30,10 +35,10 @@ include/compile_flags.hrl:
./write_compile_flags $@

get-deps:
./rebar get-deps
$(REBAR_BIN) get-deps

compile:
./rebar compile
$(REBAR_BIN) compile

dialyzer: compile
dialyzer -Wunmatched_returns ebin
Expand All @@ -42,7 +47,7 @@ check_escripts:
./check_escripts.sh make_doc write_compile_flags

tests: compile
./rebar eunit
$(REBAR_BIN) eunit

doc:
./make_doc
Expand All @@ -52,11 +57,11 @@ clean:

distclean: clean
rm -f include/compile_flags.hrl
./rebar clean
$(REBAR_BIN) clean

rebuild: distclean include/compile_flags.hrl
./rebar compile
$(REBAR_BIN) compile

retest: compile
rm -rf .eunit
./rebar eunit
$(REBAR_BIN) eunit