2015-10-15 15:27:10 +00:00
|
|
|
REPO ?= machi
|
|
|
|
PKG_REVISION ?= $(shell git describe --tags)
|
|
|
|
PKG_BUILD = 1
|
|
|
|
BASE_DIR = $(shell pwd)
|
|
|
|
ERLANG_BIN = $(shell dirname $(shell which erl))
|
|
|
|
REBAR := $(shell which rebar)
|
|
|
|
ifeq ($(REBAR),)
|
|
|
|
REBAR = $(BASE_DIR)/rebar
|
2015-03-31 07:46:03 +00:00
|
|
|
endif
|
2015-10-15 15:27:10 +00:00
|
|
|
OVERLAY_VARS ?=
|
2015-03-31 07:46:03 +00:00
|
|
|
|
2015-04-08 05:24:07 +00:00
|
|
|
.PHONY: rel deps package pkgclean edoc
|
2015-03-31 07:46:03 +00:00
|
|
|
|
|
|
|
all: deps compile
|
|
|
|
|
|
|
|
compile:
|
2015-10-15 15:27:10 +00:00
|
|
|
$(REBAR) compile
|
|
|
|
|
2015-10-16 06:56:47 +00:00
|
|
|
## Make reltool happy by creating a fake entry in the deps dir for
|
|
|
|
## machi, because reltool really wants to have a path with
|
|
|
|
## "machi/ebin" at the end, but we also don't want infinite recursion
|
|
|
|
## if we just symlink "deps/machi" -> ".."
|
|
|
|
|
2015-10-15 15:27:10 +00:00
|
|
|
generate:
|
2015-10-16 06:56:47 +00:00
|
|
|
rm -rf deps/machi
|
|
|
|
mkdir deps/machi
|
|
|
|
ln -s ../../ebin deps/machi
|
|
|
|
ln -s ../../src deps/machi
|
2015-10-15 15:27:10 +00:00
|
|
|
$(REBAR) generate $(OVERLAY_VARS) 2>&1 | grep -v 'command does not apply to directory'
|
2015-03-31 07:46:03 +00:00
|
|
|
|
|
|
|
deps:
|
2015-10-15 15:27:10 +00:00
|
|
|
$(REBAR) get-deps
|
2015-03-31 07:46:03 +00:00
|
|
|
|
|
|
|
clean:
|
2015-10-15 15:27:10 +00:00
|
|
|
$(REBAR) -r clean
|
2015-03-31 07:46:03 +00:00
|
|
|
|
|
|
|
test: deps compile eunit
|
|
|
|
|
|
|
|
eunit:
|
2015-10-15 15:27:10 +00:00
|
|
|
$(REBAR) -v skip_deps=true eunit
|
2015-03-31 07:46:03 +00:00
|
|
|
|
2015-04-08 05:24:07 +00:00
|
|
|
edoc: edoc-clean
|
2015-10-15 15:27:10 +00:00
|
|
|
$(REBAR) skip_deps=true doc
|
2015-04-08 05:24:07 +00:00
|
|
|
|
|
|
|
edoc-clean:
|
|
|
|
rm -f edoc/*.png edoc/*.html edoc/*.css edoc/edoc-info
|
|
|
|
|
2015-03-31 07:46:03 +00:00
|
|
|
pulse: compile
|
2015-10-08 05:19:44 +00:00
|
|
|
@echo Sorry, PULSE test needs maintenance. -SLF
|
2015-10-15 15:27:10 +00:00
|
|
|
#env USE_PULSE=1 $(REBAR) skip_deps=true clean compile
|
|
|
|
#env USE_PULSE=1 $(REBAR) skip_deps=true -D PULSE eunit -v
|
2015-03-31 07:46:03 +00:00
|
|
|
|
|
|
|
APPS = kernel stdlib sasl erts ssl compiler eunit crypto
|
|
|
|
PLT = $(HOME)/.machi_dialyzer_plt
|
|
|
|
|
|
|
|
build_plt: deps compile
|
|
|
|
dialyzer --build_plt --output_plt $(PLT) --apps $(APPS) deps/*/ebin
|
|
|
|
|
2015-10-21 07:09:56 +00:00
|
|
|
DIALYZER_DEP_APPS = ebin/machi_pb.beam \
|
|
|
|
deps/cluster_info/ebin \
|
|
|
|
deps/protobuffs/ebin \
|
|
|
|
deps/riak_dt/ebin
|
2015-10-21 07:47:00 +00:00
|
|
|
### DIALYZER_FLAGS = -Wno_return -Wrace_conditions -Wunderspecs
|
|
|
|
DIALYZER_FLAGS = -Wno_return -Wrace_conditions
|
2015-06-19 06:19:59 +00:00
|
|
|
|
2015-03-31 07:46:03 +00:00
|
|
|
dialyzer: deps compile
|
2015-06-19 07:04:34 +00:00
|
|
|
dialyzer $(DIALYZER_FLAGS) --plt $(PLT) ebin $(DIALYZER_DEP_APPS) | \
|
2015-10-21 07:09:56 +00:00
|
|
|
tee ./.dialyzer-last-run.txt | \
|
2015-06-19 06:19:59 +00:00
|
|
|
egrep -v -f ./filter-dialyzer-dep-warnings
|
2015-03-31 07:46:03 +00:00
|
|
|
|
2015-04-02 03:38:12 +00:00
|
|
|
dialyzer-test: deps compile
|
2015-06-02 10:07:13 +00:00
|
|
|
echo Force rebar to recompile .eunit dir w/o running tests > /dev/null
|
|
|
|
rebar skip_deps=true eunit suite=lamport_clock
|
2015-06-19 07:04:34 +00:00
|
|
|
dialyzer $(DIALYZER_FLAGS) --plt $(PLT) .eunit $(DIALYZER_DEP_APPS) | \
|
2015-06-19 06:19:59 +00:00
|
|
|
egrep -v -f ./filter-dialyzer-dep-warnings
|
2015-04-02 03:38:12 +00:00
|
|
|
|
2015-03-31 07:46:03 +00:00
|
|
|
clean_plt:
|
|
|
|
rm $(PLT)
|
2015-10-15 15:27:10 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
## Release targets
|
|
|
|
##
|
|
|
|
rel: deps compile generate
|
|
|
|
|
|
|
|
relclean:
|
|
|
|
rm -rf rel/$(REPO)
|
|
|
|
|
|
|
|
stage : rel
|
|
|
|
$(foreach dep,$(wildcard deps/*), rm -rf rel/$(REPO)/lib/$(shell basename $(dep))* && ln -sf $(abspath $(dep)) rel/$(REPO)/lib;)
|