xref: /6.0.3/geocouch/Makefile (revision 307f6779)
1ERL=erl
2VERSION=$(shell git describe)
3GEOCOUCH_PLT ?= ../geocouch.plt
4
5COMPILER_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, filename:absname("${COUCH_SRC}")}] ++ Options]), halt(0).')
6COMPILER_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, filename:absname("${COUCH_SRC}")},{d, makecheck}] ++ Options]), halt(0).')
7
8
9couchbase couchbase-check: REBAR_CONFIG := rebar_couchbase.config
10couchdb couchdb-check: REBAR_CONFIG := rebar_couchdb.config
11
12
13all:
14	@echo "Try \"make couchbase\" or \"make couchdb\"instead."
15
16check:
17	@echo "Try \"make couchbase-check\" \"make couchdb-check\"instead."
18
19.PHONY: couchbase
20couchbase: compile
21couchbase-check: do-check runtests-couchbase clean-again
22
23.PHONY: couchdb
24couchdb: compile
25couchdb-check: do-check clean-again
26
27compile:
28	ERL_COMPILER_OPTIONS='$(COMPILER_OPTIONS)' ./rebar -C $(REBAR_CONFIG) compile
29
30compileforcheck:
31	ERL_COMPILER_OPTIONS='$(COMPILER_OPTIONS_MAKE_CHECK)' ./rebar -C $(REBAR_CONFIG) compile
32
33runtests:
34	ERL_LIBS=. ERL_FLAGS="-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}/../mochiweb -pa ${COUCH_SRC}/../lhttpc -pa ${COUCH_SRC}/../erlang-oauth -pa ${COUCH_SRC}/../ejson -pa ${COUCH_SRC}/../mapreduce" prove ./vtree/test/*.t
35
36do-check: clean compileforcheck dialyzer runtests
37
38runtests-couchbase:
39	PATH=${PATH}:../couchstore ERL_LIBS=. ERL_FLAGS="-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}/../mochiweb -pa ${COUCH_SRC}/../lhttpc -pa ${COUCH_SRC}/../erlang-oauth -pa ${COUCH_SRC}/../ejson -pa ${COUCH_SRC}/../mapreduce -pa ${COUCH_SRC}/../couch_set_view/test" prove gc-couchbase/test/*.t
40
41clean clean-again:
42	./rebar -C rebar_couchbase.config clean -r
43	./rebar -C rebar_couchdb.config clean -r
44	rm -f *.tar.gz
45
46
47$(GEOCOUCH_PLT):
48	dialyzer --output_plt ../geocouch.plt --build_plt --apps kernel stdlib
49
50dialyzer: $(GEOCOUCH_PLT)
51	dialyzer --verbose --plt $(GEOCOUCH_PLT) -r vtree
52
53
54geocouch-$(VERSION).tar.gz:
55	git archive --prefix=geocouch-$(VERSION)/ --format tar HEAD | gzip -9vc > $@
56
57dist: geocouch-$(VERSION).tar.gz
58