Browse Source

Use R16-compatible rebar3 on R16

Сергей Прохоров 7 years ago
parent
commit
47949c9893
1 changed files with 15 additions and 4 deletions
  1. 15 4
      Makefile

+ 15 - 4
Makefile

@@ -1,12 +1,23 @@
-REBAR = rebar3
+REBAR = ./rebar3
 ERL_VSN = $(shell erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().'  -noshell)
 
 all: compile
 
-compile: src/epgsql_errcodes.erl
+$(REBAR):
+	@case "$(ERL_VSN)" in\
+		"R16"*)\
+			wget https://github.com/erlang/rebar3/releases/download/3.5.2/rebar3 \
+			;;\
+		*)\
+			wget https://s3.amazonaws.com/rebar3/rebar3 \
+			;;\
+	esac
+	chmod +x rebar3
+
+compile: src/epgsql_errcodes.erl $(REBAR)
 	@$(REBAR) compile
 
-clean:
+clean: $(REBAR)
 	@$(REBAR) clean
 
 src/epgsql_errcodes.erl:
@@ -18,7 +29,7 @@ test: compile
 dialyzer: compile
 	@$(REBAR) dialyzer
 
-elvis:
+elvis: $(REBAR)
 	@case "$(ERL_VSN)" in\
 		"R16"*)\
 			echo "Elvis is disabled on erl 16"\