-
Notifications
You must be signed in to change notification settings - Fork 54
/
Makefile
50 lines (36 loc) · 1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.PHONY: all get-deps compile clean test-unit test-ct check distclean
REBAR := $(shell which ./rebar || which rebar)
PROJECTNAME=mcd
PROJECTVERSION=1.1.0
INSTALLDIR=$(LIBDIR)/$(PROJECTNAME)-$(PROJECTVERSION)/ebin
LIBDIR=$(shell erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell)
all: get-deps compile
compile:
$(REBAR) compile
get-deps:
$(REBAR) get-deps
test-unit: all
$(REBAR) eunit skip_deps=true
test-ct: all
memcached -d
$(REBAR) ct skip_deps=true
check: test-unit test-ct
clean:
$(REBAR) clean
rm -rf ./ebin
rm -rf ./logs
rm -f ./erl_crash.dump
rm -rf ./.eunit
rm -f ./test/*.beam
distclean: clean
rm -rf ./deps
install-lib:
mkdir -p $(INSTALLDIR)
for f in ebin/*.beam; do install $$f $(INSTALLDIR); done
# Get rebar if it doesn't exist
REBAR_URL=https://cloud.github.com/downloads/basho/rebar/rebar
./rebar:
erl -noinput -noshell -s inets -s ssl \
-eval 'httpc:request(get, {"${REBAR_URL}", []}, [], [{stream, "${REBAR}"}])' \
-s init stop
chmod +x ${REBAR}