2013-03-07 21:03:30 +00:00
|
|
|
TARGET= wterl
|
2011-12-18 20:54:46 +00:00
|
|
|
|
2013-03-07 21:03:30 +00:00
|
|
|
REBAR= ./rebar
|
|
|
|
#REBAR= /usr/bin/env rebar
|
|
|
|
ERL= /usr/bin/env erl
|
2013-04-18 21:07:27 +00:00
|
|
|
ERLEXEC= ${ERL_ROOTDIR}/lib/erlang/erts-5.9.1/bin/erlexec
|
2013-03-07 21:03:30 +00:00
|
|
|
DIALYZER= /usr/bin/env dialyzer
|
2013-04-21 15:10:06 +00:00
|
|
|
ARCHIVETAG?= $(shell git describe --always --long --tags)
|
|
|
|
ARCHIVE?= $(shell basename $(CURDIR))-$(ARCHIVETAG)
|
|
|
|
WT_ARCHIVETAG?= $(shell cd c_src/wiredtiger-basho; git describe --always --long --tags)
|
2013-03-07 21:03:30 +00:00
|
|
|
|
|
|
|
.PHONY: plt analyze all deps compile get-deps clean
|
|
|
|
|
|
|
|
all: compile
|
|
|
|
|
2013-04-21 15:10:06 +00:00
|
|
|
archive:
|
|
|
|
@rm -f $(ARCHIVE).tar.gz
|
|
|
|
git archive --format=tar --prefix=$(ARCHIVE)/ $(ARCHIVETAG) | gzip >$(ARCHIVE).tar.gz
|
|
|
|
|
2013-03-07 21:03:30 +00:00
|
|
|
deps: get-deps
|
|
|
|
|
|
|
|
get-deps:
|
2013-04-16 15:47:04 +00:00
|
|
|
c_src/build_deps.sh get-deps
|
2013-03-07 21:03:30 +00:00
|
|
|
@$(REBAR) get-deps
|
|
|
|
|
|
|
|
update-deps:
|
2013-04-16 15:47:04 +00:00
|
|
|
c_src/build_deps.sh update-deps
|
2013-03-07 21:03:30 +00:00
|
|
|
@$(REBAR) update-deps
|
|
|
|
|
2013-04-16 21:20:57 +00:00
|
|
|
c_src/wterl.o: c_src/async_nif.h
|
|
|
|
touch c_src/wterl.c
|
2013-03-07 21:03:30 +00:00
|
|
|
|
|
|
|
ebin/app_helper.beam:
|
|
|
|
@echo You need to:
|
|
|
|
@echo cp ../riak/deps/riak_core/ebin/app_helper.beam ebin
|
|
|
|
@/bin/false
|
|
|
|
|
|
|
|
compile: c_src/wterl.o ebin/app_helper.beam
|
|
|
|
@$(REBAR) compile
|
2011-12-18 20:54:46 +00:00
|
|
|
|
|
|
|
clean:
|
2013-04-21 15:10:06 +00:00
|
|
|
@rm -f $(ARCHIVE).tar.gz
|
2013-03-07 21:03:30 +00:00
|
|
|
@$(REBAR) clean
|
|
|
|
|
2013-04-21 15:10:06 +00:00
|
|
|
xref:
|
|
|
|
@$(REBAR) xref skip_deps=true
|
|
|
|
|
2013-03-07 21:03:30 +00:00
|
|
|
test: eunit
|
|
|
|
|
2013-04-21 15:10:06 +00:00
|
|
|
eunit: compile-for-eunit
|
2013-03-07 21:03:30 +00:00
|
|
|
@$(REBAR) eunit skip_deps=true
|
|
|
|
|
2013-04-21 15:10:06 +00:00
|
|
|
eqc: compile-for-eqc
|
|
|
|
@$(REBAR) eqc skip_deps=true
|
|
|
|
|
|
|
|
proper: compile-for-proper
|
|
|
|
@echo "rebar does not implement a 'proper' command" && false
|
|
|
|
|
|
|
|
triq: compile-for-triq
|
|
|
|
@$(REBAR) triq skip_deps=true
|
|
|
|
|
|
|
|
compile-for-eunit:
|
|
|
|
@$(REBAR) compile eunit compile_only=true
|
|
|
|
|
|
|
|
compile-for-eqc:
|
|
|
|
@$(REBAR) -D QC -D QC_EQC compile eqc compile_only=true
|
|
|
|
|
|
|
|
compile-for-eqcmini:
|
|
|
|
@$(REBAR) -D QC -D QC_EQCMINI compile eqc compile_only=true
|
|
|
|
|
|
|
|
compile-for-proper:
|
|
|
|
@$(REBAR) -D QC -D QC_PROPER compile eqc compile_only=true
|
|
|
|
|
|
|
|
compile-for-triq:
|
|
|
|
@$(REBAR) -D QC -D QC_TRIQ compile triq compile_only=true
|
2013-03-07 21:03:30 +00:00
|
|
|
|
|
|
|
plt: compile
|
2013-04-17 17:19:06 +00:00
|
|
|
@$(DIALYZER) --build_plt --output_plt .$(TARGET).plt -pa deps/lager/ebin --apps kernel stdlib
|
2013-03-07 21:03:30 +00:00
|
|
|
|
|
|
|
analyze: compile
|
2013-04-21 15:10:06 +00:00
|
|
|
@$(DIALYZER) --plt .$(TARGET).plt -pa deps/lager/ebin ebin
|
2013-03-07 21:03:30 +00:00
|
|
|
|
|
|
|
repl:
|
2013-04-21 15:10:06 +00:00
|
|
|
@$(ERL) -pa ebin -pz deps/lager/ebin
|
2013-04-18 21:07:27 +00:00
|
|
|
|
2013-03-07 21:03:30 +00:00
|
|
|
eunit-repl:
|
2013-06-10 18:31:59 +00:00
|
|
|
@$(ERL) erl -pa .eunit -pz deps/lager/ebin
|
2013-04-18 21:07:27 +00:00
|
|
|
|
2013-06-10 18:31:59 +00:00
|
|
|
ERL_TOP= /home/gburd/repos/otp_R15B01
|
2013-04-18 21:07:27 +00:00
|
|
|
CERL= ${ERL_TOP}/bin/cerl
|
|
|
|
VALGRIND_MISC_FLAGS= "--verbose --leak-check=full --show-reachable=yes --trace-children=yes --track-origins=yes --suppressions=${ERL_TOP}/erts/emulator/valgrind/suppress.standard --show-possibly-lost=no --malloc-fill=AB --free-fill=CD"
|
|
|
|
|
|
|
|
helgrind:
|
|
|
|
valgrind --verbose --tool=helgrind \
|
|
|
|
--leak-check=full
|
|
|
|
--show-reachable=yes \
|
|
|
|
--trace-children=yes \
|
|
|
|
--track-origins=yes \
|
|
|
|
--suppressions=${ERL_TOP}/erts/emulator/valgrind/suppress.standard \
|
|
|
|
--show-possibly-lost=no \
|
|
|
|
--malloc-fill=AB \
|
|
|
|
--free-fill=CD ${ERLEXEC} -pz deps/lager/ebin -pa ebin -pa .eunit
|
|
|
|
|
|
|
|
valgrind:
|
|
|
|
${CERL} -valgrind ${VALGRIND_FLAGS} --log-file=${ROOTDIR}/valgrind_log-beam.smp.%p -- -pz deps/lager/ebin -pa ebin -pa .eunit -exec 'eunit:test(wterl).'
|