aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Wilberding <[email protected]>2013-09-29 12:07:37 -0400
committerJordan Wilberding <[email protected]>2013-09-29 12:07:37 -0400
commit81b0d55be6ee3f57b36a013db2336f1fd29a5aee (patch)
tree8c219d7624bf3c899bdf889fc78aa3cf8b6bf53c
parentc2bbc32be1cefafca6fd12867293070a9790fd76 (diff)
downloadrelx-81b0d55be6ee3f57b36a013db2336f1fd29a5aee.tar.gz
relx-81b0d55be6ee3f57b36a013db2336f1fd29a5aee.tar.bz2
relx-81b0d55be6ee3f57b36a013db2336f1fd29a5aee.zip
Add autodownloading of rebar to makefile when it does not exist on system
-rw-r--r--Makefile17
1 files changed, 12 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index b8a2657..516c2e3 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ endif
REBAR=$(shell which rebar)
ifeq ($(REBAR),)
-$(error "Rebar not available on this system")
+REBAR=$(CURDIR)/rebar
endif
# =============================================================================
@@ -62,15 +62,22 @@ all: deps compile escript
# Rules to build the system
# =============================================================================
-deps:
+REBAR_URL=https://github.com/rebar/rebar/wiki/rebar
+$(REBAR):
+ curl -Lo rebar $(REBAR_URL) || wget $(REBAR_URL)
+ chmod a+x rebar
+
+get-rebar: $(REBAR)
+
+deps: $(REBAR)
$(REBAR) get-deps
$(REBAR) compile
-update-deps:
+update-deps: $(REBAR)
$(REBAR) update-deps
$(REBAR) compile
-compile:
+compile: $(REBAR)
$(REBAR) skip_deps=true compile
escript: deps
@@ -122,7 +129,7 @@ clean-common-test-data:
# data. Without this rebar eunit gets very confused
- rm -rf $(CURDIR)/test/*_SUITE_data
-clean: clean-common-test-data
+clean: clean-common-test-data $(REBAR)
- rm -rf $(CURDIR)/test/*.beam
- rm -rf $(CURDIR)/logs
- rm -rf $(CURDIR)/ebin