xref: /2.1.1/geocouch/Makefile (revision 1ca33742)
1ERL=erl
2VERSION=$(shell git describe)
3# Output ERL_COMPILER_OPTIONS env variable
4COMPILER_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}"}, {i, "${COUCH_SRC}/.."}] ++ Options]), halt(0).')
5COMPILER_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}"},{i, "${COUCH_SRC}/.."},{d, makecheck}] ++ Options]), halt(0).')
6
7all: compile
8
9compile:
10	ERL_COMPILER_OPTIONS='$(COMPILER_OPTIONS)' ./rebar compile
11
12compileforcheck:
13	ERL_COMPILER_OPTIONS='$(COMPILER_OPTIONS_MAKE_CHECK)' ./rebar compile
14
15buildandtest: all test
16
17runtests:
18	ERL_FLAGS="-pa ebin -pa ${COUCH_SRC} -pa ${COUCH_SRC}/../etap -pa ${COUCH_SRC}/../snappy -pa ${COUCH_SRC}/../../test/etap -pa ${COUCH_SRC}/../couch_set_view/ebin -pa ${COUCH_SRC}/../couch_index_merger/ebin -pa ${COUCH_SRC}/../mochiweb -pa ${COUCH_SRC}/../lhttpc -pa ${COUCH_SRC}/../erlang-oauth -pa ${COUCH_SRC}/../ejson -pa ${COUCH_SRC}/../mapreduce" prove ./test/*.t
19
20check: clean compileforcheck runtests
21	./rebar clean
22
23clean:
24	./rebar clean
25	rm -f *.tar.gz
26
27geocouch-$(VERSION).tar.gz:
28	git archive --prefix=geocouch-$(VERSION)/ --format tar HEAD | gzip -9vc > $@
29
30dist: geocouch-$(VERSION).tar.gz
31