aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2013-09-29 09:17:38 -0700
committerTristan Sloughter <[email protected]>2013-09-29 09:17:38 -0700
commit0ebd6efef57735a5915171cad2dd39c9c409772f (patch)
tree8c219d7624bf3c899bdf889fc78aa3cf8b6bf53c
parentc2bbc32be1cefafca6fd12867293070a9790fd76 (diff)
parent81b0d55be6ee3f57b36a013db2336f1fd29a5aee (diff)
downloadrelx-0ebd6efef57735a5915171cad2dd39c9c409772f.tar.gz
relx-0ebd6efef57735a5915171cad2dd39c9c409772f.tar.bz2
relx-0ebd6efef57735a5915171cad2dd39c9c409772f.zip
Merge pull request #58 from jwilberding/make
Add autodownloading of rebar to makefile when it does not exist on syste...
-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