-
Notifications
You must be signed in to change notification settings - Fork 62
/
Makefile
30 lines (21 loc) · 1.2 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
ERL=erl
VERSION=$(shell git describe)
# Output ERL_COMPILER_OPTIONS env variable
COMPILER_OPTIONS=$(shell $(ERL) -noinput +B -eval 'Options = case os:getenv("ERL_COMPILER_OPTIONS") of false -> []; Else -> {ok,Tokens,_} = erl_scan:string(Else ++ "."),{ok,Term} = erl_parse:parse_term(Tokens), Term end, io:format("~p~n", [[{i, "${COUCH_SRC}"}] ++ Options]), halt(0).')
COMPILER_OPTIONS_MAKE_CHECK=$(shell $(ERL) -noinput +B -eval 'Options = case os:getenv("ERL_COMPILER_OPTIONS") of false -> []; Else -> {ok,Tokens,_} = erl_scan:string(Else ++ "."),{ok,Term} = erl_parse:parse_term(Tokens), Term end, io:format("~p~n", [[{i, "${COUCH_SRC}"},{d, makecheck}] ++ Options]), halt(0).')
all: compile
compile:
ERL_COMPILER_OPTIONS='$(COMPILER_OPTIONS)' ./rebar compile
compileforcheck:
ERL_COMPILER_OPTIONS='$(COMPILER_OPTIONS_MAKE_CHECK)' ./rebar compile
buildandtest: all test
runtests:
ERL_FLAGS="-pa ebin -pa ${COUCH_SRC} -pa ${COUCH_SRC}/../etap -pa ${COUCH_SRC}/../snappy" prove ./test/*.t
check: clean compileforcheck runtests
./rebar clean
clean:
./rebar clean
rm -f *.tar.gz
geocouch-$(VERSION).tar.gz:
git archive --prefix=geocouch-$(VERSION)/ --format tar HEAD | gzip -9vc > $@
dist: geocouch-$(VERSION).tar.gz