diff --git a/Makefile b/Makefile index 329b3aa..617b2dd 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,20 @@ PROJECT = esqlite -REBAR = ./rebar DIALYZER = dialyzer +REBAR := $(shell which rebar 2>/dev/null || echo ./rebar) +REBAR_URL := https://github.com/downloads/basho/rebar/rebar + all: compile -rebar: - wget https://github.com/downloads/basho/rebar/rebar -O $(REBAR) - chmod u+x $(REBAR) +#rebar: +# wget https://github.com/downloads/basho/rebar/rebar -O $(REBAR) +# chmod u+x $(REBAR) + +./rebar: + erl -noshell -s inets start -s ssl start \ + -eval '{ok, saved_to_file} = httpc:request(get, {"$(REBAR_URL)", []}, [], [{stream, "./rebar"}])' \ + -s inets stop -s init stop + chmod +x ./rebar compile: rebar $(REBAR) compile diff --git a/rebar.config b/rebar.config index ec14cc5..b082a72 100644 --- a/rebar.config +++ b/rebar.config @@ -1,3 +1,3 @@ -{require_otp_vsn, "R14"}. +{require_otp_vsn, "R14|R15|R16"}. {port_env, [{"CFLAGS", "$CFLAGS -DSQLITE_THREADSAFE=1 -DSQLITE_USE_URI -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS"}]}. {port_specs, [{"priv/esqlite3_nif.so", ["c_src/*.c"]}]}.