Skip to content

Commit 5655c71

Browse files
committed
Try using rebar3
1 parent 64bc94e commit 5655c71

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ priv
77
*.la
88
*~
99
*.swp
10+
11+
.idea
12+
_build
13+
*.d
14+
*.lock
15+
.DS_Store

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
REBAR?=rebar
1+
REBAR3?=rebar3
22

33

44
.PHONY: all
@@ -9,7 +9,7 @@ all: build
99
.PHONY: build
1010
# target: build - Builds the project
1111
build:
12-
$(REBAR) compile
12+
$(REBAR3) compile
1313

1414

1515
.PHONY: check
@@ -20,7 +20,7 @@ check: build eunit
2020
.PHONY: clean
2121
# target: clean - Removes build artifacts
2222
clean:
23-
$(REBAR) clean
23+
$(REBAR3) clean
2424

2525

2626
.PHONY: distclean
@@ -32,7 +32,7 @@ distclean: clean
3232
.PHONY: eunit
3333
# target: eunit - Runs eunit test suite
3434
eunit:
35-
$(REBAR) eunit
35+
$(REBAR3) eunit
3636

3737

3838
.PHONY: help

rebar.config

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
{require_otp_vsn, "R14|R15|R16|17|18|19|20|21|22|23|24|25"}.
22

33
{erl_opts, [debug_info, warn_unused_vars, warn_shadow_vars, warn_unused_import]}.
4-
{port_sources, ["c_src/*.cc",
5-
"c_src/snappy/*.cc"]}.
4+
{port_sources, [
5+
"c_src/*.cc",
6+
"c_src/snappy/*.cc"
7+
]}.
68
{port_env, [
79
{"CXXFLAGS", "$CXXFLAGS -DNDEBUG"},
8-
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin)",
9-
"LDFLAGS", "$LDFLAGS -lstdc++"}
10+
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin)", "LDFLAGS", "$LDFLAGS -lstdc++"}
1011
]}.
1112
{so_name, "snappy_nif.so"}.
1213
{eunit_opts, [verbose]}.
14+
15+
{plugins, [{pc, "~> 1.0"}]}.
16+
{artifacts, [
17+
"priv/snappy_nif.so"
18+
]}.
19+
{provider_hooks, [
20+
{post, [
21+
{compile, {pc, compile}},
22+
{clean, {pc, clean}}
23+
]}
24+
]}.

0 commit comments

Comments
 (0)