forked from erlangpack/bcrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrebar.config
39 lines (35 loc) · 1.05 KB
/
rebar.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%% -*- mode: erlang;erlang-indent-level: 2;indent-tabs-mode: nil -*-
%% {erl_opts, [debug_info]}.
%% {so_specs,
%% [{"priv/bcrypt_nif.so",
%% ["c_src/*.c"]}]}.
{port_env, [
{"DRV_LDFLAGS","-shared $ERL_LDFLAGS -lpthread"},
{"darwin", "DRV_LDFLAGS", "-bundle -flat_namespace -undefined suppress $ERL_LDFLAGS -lpthread"},
{"solaris", "ERL_LDFLAGS", "-lxnet -lssp -lnsl $ERL_LDFLAGS"},
{"DRV_CFLAGS","-Ic_src -Wall -fPIC $ERL_CFLAGS"},
{"CFLAGS", "$CFLAGS -O2"},
{"LDFLAGS", "$LDFLAGS -lpthread"}
]}.
{port_specs, [
{"priv/bcrypt_nif.so", ["c_src/*.c"]},
{"priv/bcrypt", [
"c_src/bcrypt_port.c",
"c_src/bcrypt.c",
"c_src/blowfish.c"
]}
]}.
%% These post_hooks are for rebar2. rebar.config.script removes them if
%% rebar3 is detected
{post_hooks,
[{clean, "make -C c_src clean"},
{compile, "make -C c_src"}]}.
%% plugins and provider_hooks are for rebar3. rebar.config.script removes them
%% if rebar2 is detected
{plugins, [pc]}.
{provider_hooks, [
{pre, [
{compile, {pc, compile}},
{clean, {pc, clean}}
]}
]}.