aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-08-21 17:34:00 +0200
committerGuido Günther <agx@sigxcpu.org>2016-11-07 19:49:55 +0100
commit3b5f2a40a4d57934825896ba31a1d929ebf02603 (patch)
treed075f730ee69d82f3fa2a0f9c914ff2753330554 /Makefile
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..31bb8fe
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+REBAR3_URL=https://s3.amazonaws.com/rebar3/rebar3
+
+# If there is a rebar in the current directory, use it
+ifeq ($(wildcard rebar3),rebar3)
+REBAR3 = $(CURDIR)/rebar3
+endif
+
+# Fallback to rebar on PATH
+REBAR3 ?= $(shell test -e `which rebar3` 2>/dev/null && which rebar3 || echo "./rebar3")
+
+# And finally, prep to download rebar if all else fails
+ifeq ($(REBAR3),)
+REBAR3 = $(CURDIR)/rebar3
+endif
+
+all: $(REBAR3)
+ @$(REBAR3) do clean, compile, eunit, dialyzer
+
+rel: all
+ @$(REBAR3) release
+
+shell:
+ @$(REBAR3) as dev do compile, shell
+
+$(REBAR3):
+ curl -Lo rebar3 $(REBAR3_URL) || wget $(REBAR3_URL)
+ chmod a+x rebar3