forked from basho/ebloom
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from cloudian/rebar3
Rebar3 and other goodies
- Loading branch information
Showing
5 changed files
with
86 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
.PHONY: compile test | ||
|
||
all: | ||
./rebar compile eunit | ||
all: compile test | ||
|
||
compile: | ||
@./rebar compile | ||
|
||
clean: | ||
./rebar clean | ||
./rebar clean | ||
|
||
include tools.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{application, ebloom, | ||
[ | ||
{description, ""}, | ||
{vsn, "1.1.2"}, | ||
{vsn, "2.0.0"}, | ||
{modules, [ | ||
ebloom | ||
]}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
%% port compiler plugin for rebar3 | ||
{plugins, [pc]}. | ||
|
||
{provider_hooks, | ||
[ | ||
{pre, | ||
[ | ||
{compile, {pc, compile}}, | ||
{clean, {pc, clean}} | ||
] | ||
} | ||
] | ||
}. | ||
|
||
{port_specs, [{"priv/ebloom_nifs.so", ["c_src/*.cpp"]}]}. | ||
{port_env, [ | ||
%% Make sure to link -lstdc++ | ||
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin)", | ||
"LDFLAGS", "$LDFLAGS -lstdc++"} | ||
]}. | ||
|
||
{erl_opts, [debug_info, warnings_as_errors]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
test: compile | ||
./rebar eunit skip_deps=true | ||
|
||
docs: | ||
./rebar doc skip_deps=true | ||
|
||
PLT ?= $(HOME)/.riak_combo_dialyzer_plt | ||
LOCAL_PLT = .local_dialyzer_plt | ||
DIALYZER_FLAGS ?= -Wunmatched_returns | ||
|
||
${PLT}: compile | ||
ifneq (,$(wildcard $(PLT))) | ||
dialyzer --check_plt --plt $(PLT) --apps $(DIALYZER_APPS) && \ | ||
dialyzer --add_to_plt --plt $(PLT) --output_plt $(PLT) --apps $(DIALYZER_APPS) ; test $$? -ne 1 | ||
else | ||
dialyzer --build_plt --output_plt $(PLT) --apps $(DIALYZER_APPS); test $$? -ne 1 | ||
endif | ||
|
||
${LOCAL_PLT}: compile | ||
ifneq (,$(wildcard deps/*)) | ||
ifneq (,$(wildcard $(LOCAL_PLT))) | ||
dialyzer --check_plt --plt $(LOCAL_PLT) deps/*/ebin && \ | ||
dialyzer --add_to_plt --plt $(LOCAL_PLT) --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1 | ||
else | ||
dialyzer --build_plt --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1 | ||
endif | ||
endif | ||
|
||
dialyzer: ${PLT} ${LOCAL_PLT} | ||
@echo "==> $(shell basename $(shell pwd)) (dialyzer)" | ||
@if [ -f $(LOCAL_PLT) ]; then \ | ||
dialyzer $(DIALYZER_FLAGS) --plts $(PLT) $(LOCAL_PLT) -c ebin; \ | ||
else \ | ||
dialyzer $(DIALYZER_FLAGS) --plts $(PLT) -c ebin; \ | ||
fi | ||
|
||
cleanplt: | ||
@echo | ||
@echo "Are you sure? It takes several minutes to re-build." | ||
@echo Deleting $(PLT) and $(LOCAL_PLT) in 5 seconds. | ||
@echo | ||
sleep 5 | ||
rm $(PLT) | ||
rm $(LOCAL_PLT) | ||
|