Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/kas/unfubar'
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Falcon committed Oct 9, 2012
2 parents 1464108 + 5c4a687 commit 33ade26
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Makefile
@@ -1,11 +1,11 @@
all: compile

compile:
@ ./rebar compile
@rebar compile

tests:
@ ./rebar eunit
@rebar eunit

clean:
@ ./rebar clean
@rebar clean

6 changes: 6 additions & 0 deletions c_src/Makefile
@@ -0,0 +1,6 @@
compile:
env
$(CC) $(CFLAGS) $(ERL_CFLAGS) $(EXE_LDFLAGS) bcrypt_port.c bcrypt.o blowfish.o -o ../priv/bcrypt

clean:
@rm -f ../priv/bcrypt
Binary file removed rebar
Binary file not shown.
22 changes: 12 additions & 10 deletions rebar.config
@@ -1,14 +1,16 @@
%% -*- mode: erlang;erlang-indent-level: 2;indent-tabs-mode: nil -*-
{erl_opts, [debug_info]}.
%% {erl_opts, [debug_info]}.

{so_specs,
[{"priv/bcrypt_nif.so",
["c_src/blowfish.o", "c_src/bcrypt.o", "c_src/bcrypt_nif.o", "c_src/async_queue.o"]}]}.
%% {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"},
{"DRV_CFLAGS","-Ic_src -Wall -fPIC $ERL_CFLAGS"}]}.

{port_specs, [{"priv/bcrypt_nif.so", ["c_src/*.c"]}]}.

{post_hooks,
[{clean, "rm -f priv/bcrypt"},
{compile,
"$CC $CFLAGS $ERL $ERL_CFLAGS "
"c_src/bcrypt_port.c c_src/bcrypt.o c_src/blowfish.o "
"$LDFLAGS $ERL_LDFLAGS -lpthread "
"-o priv/bcrypt"}]}.
[{clean, "make -C c_src clean"},
{compile, "make -C c_src"}]}.

0 comments on commit 33ade26

Please sign in to comment.