jesse/Makefile

110 lines
1.9 KiB
Makefile
Raw Normal View History

# See LICENSE for licensing information.
2015-12-05 23:31:05 +00:00
REBAR ?= $(shell command -v rebar >/dev/null 2>&1 && echo "rebar" || echo "$(CURDIR)/rebar")
2015-12-05 23:31:05 +00:00
DEPS_PLT := $(CURDIR)/.deps_plt
2015-12-05 23:31:05 +00:00
ERLANG_DIALYZER_APPS := erts \
kernel \
stdlib
2015-12-05 23:31:05 +00:00
DIALYZER := dialyzer
2015-12-05 23:31:05 +00:00
# Travis CI is slow at building dialyzer PLT
ifeq ($(TRAVIS), true)
2015-12-17 00:34:01 +00:00
OTP_VSN := $(shell erl -noshell -eval 'io:format("~p", [erlang:system_info(otp_release)]), erlang:halt(0).' | perl -lne 'print for /^(?:"R)?(\d+).*/g')
2015-12-05 23:31:05 +00:00
SLOW_DIALYZER := $(shell expr $(OTP_VSN) \<= 14 )
2015-12-05 23:31:05 +00:00
ifeq ($(SLOW_DIALYZER), 1)
DIALYZER := : not running dialyzer on TRAVIS with R14
endif
endif
2015-12-05 23:31:05 +00:00
SRCS := $(wildcard src/* include/* rebar.config)
.PHONY: all
all: deps ebin/jesse.app bin/jesse
2015-12-05 23:31:05 +00:00
# Clean
.PHONY: clean
clean:
2015-12-05 23:31:05 +00:00
$(REBAR) clean
$(RM) -r .rebar
$(RM) -r bin
$(RM) doc/*.html
$(RM) doc/edoc-info
$(RM) doc/erlang.png
$(RM) doc/stylesheet.css
$(RM) -r ebin
$(RM) -r logs
.PHONY: distclean
distclean:
$(RM) $(DEPS_PLT)
$(RM) -r deps
$(MAKE) clean
# Deps
.PHONY: get-deps
get-deps:
$(REBAR) get-deps
.PHONY: update-deps
update-deps:
$(REBAR) update-deps
2015-12-05 23:31:05 +00:00
.PHONY: delete-deps
delete-deps:
$(REBAR) delete-deps
2015-12-05 23:31:05 +00:00
.PHONY: deps
deps: get-deps
# Docs
.PHONY: docs
docs:
$(REBAR) doc skip_deps=true
# Compile
ebin/jesse.app: compile
bin/jesse: ebin/jesse.app
$(REBAR) escriptize
bin/jesse --help
2015-12-05 23:31:05 +00:00
.PHONY: compile
compile: $(SRCS)
$(REBAR) compile
# Tests.
2015-12-05 23:31:05 +00:00
.rebar/DEV_MODE:
mkdir -p .rebar
touch .rebar/DEV_MODE
2015-12-05 23:31:05 +00:00
.PHONY: submodules
submodules:
2015-12-05 23:31:05 +00:00
git submodule update --init --recursive
2015-12-05 23:31:05 +00:00
.PHONY: test
test: .rebar/DEV_MODE deps submodules eunit ct dialyzer
2015-12-05 23:31:05 +00:00
.PHONY: eunit
2013-02-05 11:22:48 +00:00
eunit:
2015-12-05 23:31:05 +00:00
$(REBAR) eunit skip_deps=true
2015-12-05 23:31:05 +00:00
.PHONY: ct
2013-02-05 11:22:48 +00:00
ct:
$(REBAR) ct skip_deps=true suites="jesse_tests_draft3,jesse_tests_draft4"
2015-12-05 23:31:05 +00:00
$(DEPS_PLT):
$(DIALYZER) --build_plt --apps $(ERLANG_DIALYZER_APPS) -r deps --output_plt $(DEPS_PLT)
2015-12-05 23:31:05 +00:00
.PHONY: dialyzer
dialyzer: $(DEPS_PLT)
2015-12-14 21:03:37 +00:00
$(DIALYZER) --plt $(DEPS_PLT) --src src -Wno_return