woody_erlang/Makefile

68 lines
1.4 KiB
Makefile
Raw Normal View History

2016-04-14 07:40:33 +00:00
REBAR := $(shell which rebar3 2>/dev/null || which ./rebar3)
SUBMODULES = build_utils
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
2016-06-26 17:42:40 +00:00
UTILS_PATH := build_utils
# ToDo: remove unused TEMPLATES_PATH here, when the bug
# with handling of the varriable in build_utils is fixed
TEMPLATES_PATH := .
SERVICE_NAME := woody
2016-06-26 17:42:40 +00:00
BUILD_IMAGE_NAME := build-erlang
BUILD_IMAGE_TAG := c60896ef07d41e7ae2e5f9b6ce845a60ad79acc7
CALL_W_CONTAINER := all submodules compile xref lint test bench dialyze clean distclean \
check_format format
2016-06-26 17:42:40 +00:00
.PHONY: $(CALL_W_CONTAINER)
2016-06-26 17:42:40 +00:00
all: compile
2016-06-26 17:42:40 +00:00
-include $(UTILS_PATH)/make_lib/utils_container.mk
2016-04-14 07:40:33 +00:00
$(SUBTARGETS): %/.git: %
git submodule update --init $<
touch $@
2016-04-14 07:40:33 +00:00
submodules: $(SUBTARGETS)
2016-04-14 07:40:33 +00:00
compile: submodules
2016-06-26 17:42:40 +00:00
$(REBAR) compile
test: submodules
$(REBAR) eunit
2016-04-14 07:40:33 +00:00
$(REBAR) ct
xref: submodules
2016-04-14 07:40:33 +00:00
$(REBAR) xref
2016-06-26 17:42:40 +00:00
lint: compile
elvis rock
check_format:
$(REBAR) fmt -c
format:
$(REBAR) fmt -w
2016-04-14 07:40:33 +00:00
clean:
$(REBAR) clean
$(REBAR) as test clean
$(REBAR) as prod clean
2016-04-14 07:40:33 +00:00
distclean:
$(REBAR) clean -a
$(REBAR) as test clean -a
$(REBAR) as prod clean -a
2016-04-14 07:40:33 +00:00
rm -rfv _build _builds _cache _steps _temp
dialyze:
$(REBAR) as test dialyzer
2016-06-26 17:42:40 +00:00
bench:
$(REBAR) as test bench -m bench_woody_event_handler -n 1000
$(REBAR) as test bench -m bench_woody_formatter -n 10
erl -pa _build/test/lib/*/ebin _build/test/lib/woody/test -noshell \
-s benchmark_memory_pressure run \
-s erlang halt