summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rwxr-xr-xmake.erl18
2 files changed, 19 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a905c78..1eb9b52 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ build all:
(cd c_src && make all)
mkdir -p priv
cp c_src/fsynchelper priv/
- erl -pa ../lager/ebin -make
+ ./make.erl
clean:
(cd c_src && make clean)
-rm priv/fsynchelper
diff --git a/make.erl b/make.erl
new file mode 100755
index 0000000..4ebdf74
--- /dev/null
+++ b/make.erl
@@ -0,0 +1,18 @@
+#!/usr/bin/env escript
+%% -*- erlang -*-
+
+main(_) ->
+ LagerPath = "../lager/ebin",
+ case code:add_path(LagerPath) of
+ true ->
+ ok;
+ {error, bad_directory} ->
+ io:format("Could not add path ~p~n", [LagerPath]),
+ halt(1)
+ end,
+ case make:all() of
+ up_to_date ->
+ ok;
+ error ->
+ halt(1)
+ end.