Permalink
Browse files

Rebarize

  • Loading branch information...
1 parent 0507a43 commit 9b8920c6b0b5ac2c016df51d98e20e6ea763166d @msantos committed Sep 12, 2010
Showing with 25 additions and 32 deletions.
  1. +6 −32 Makefile
  2. +15 −0 ebin/crypt.app
  3. BIN rebar
  4. +4 −0 rebar.config
View
@@ -1,37 +1,11 @@
-ERL=erl
-APP=crypt
+REBAR=$(shell which rebar || echo ./rebar)
-CC=gcc
+all: compile
-#Mac OS X: use "-m64" for a 64-bit erlang
-ARCH=-m32
-
-# By default, use the system crypt(3), which is DES only
-FLAGS=$(ARCH) -O3 -fPIC -bundle -flat_namespace -undefined suppress -fno-common
-
-# Linux
-#FLAGS=-fPIC -shared -lcrypt
-
-ERL_ROOT=/usr/local/lib/erlang
-CFLAGS=-g -Wall
-
-
-all: dir erl nif
-
-dir:
- -@mkdir -p priv ebin
-
-erl:
- @$(ERL) -noinput +B \
- -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'
-
-nif:
- (cd c_src && \
- $(CC) -g -Wall $(FLAGS) -o ../priv/$(APP).so \
- $(APP).c -I $(ERL_ROOT)/usr/include/ )
-
-clean:
- @rm -fv ebin/*.beam priv/$(APP).so c_src/*.a c_src/*.o
+compile:
+ @$(REBAR) compile
+clean:
+ @$(REBAR) clean
View
@@ -0,0 +1,15 @@
+{application, crypt,
+ [
+ {description, "crypt(3) interface"},
+ {vsn, "0.02"},
+ {modules, [
+ crypt
+ ]},
+ {registered, []},
+ {applications, [
+ kernel,
+ stdlib
+ ]},
+ {env, []}
+ ]}.
+
View
BIN rebar
Binary file not shown.
View
@@ -0,0 +1,4 @@
+{so_name, "crypt.so"}.
+{port_envs, [
+ {"LDFLAGS", "$LDFLAGS -lcrypt"}
+ ]}.

0 comments on commit 9b8920c

Please sign in to comment.