Permalink
Browse files

Build Erlang if it is not present on the host

  • Loading branch information...
1 parent 519268e commit 0ad4fc66994b1c4d4e1c11042da20c65b30a4063 Yurii Rashkovskii committed Feb 13, 2012
Showing with 755 additions and 6 deletions.
  1. +2 −0 .gitignore
  2. +22 −6 Makefile
  3. +731 −0 kerl
View
@@ -1,3 +1,5 @@
+.kerl
+erlang
deps
log
apps/htoad/ebin
View
@@ -1,11 +1,27 @@
+HERE=$(shell pwd)
+KERL_CONFIG_OPTS=""
+
+ifeq ($(shell which erl),)
+ ERL=erlang/bin/erl
+ REBAR=". $(HERE)/erlang/activate && ./rebar"
+else
+ ERL=$(shell which erl)
+ REBAR="./rebar"
+endif
+
all: release
-release: compile
+release: $(ERL) compile
@rm -rf rel/htoad
- @./rebar generate
+ @$(REBAR) generate
+
+compile: $(ERL) deps
+ @$(REBAR) compile
+
+deps: $(ERL)
+ @$(REBAR) get-deps
-compile: deps
- @./rebar compile
+$(ERL):
+ @KERL_CONFIGURE_OPTIONS=$(KERL_CONFIG_OPTS) KERL_INSTALL_AGNERIZED_REBAR=n HOME=$(HERE) ./kerl build R15B r15b
+ @KERL_CONFIGURE_OPTIONS=$(KERL_CONFIG_OPTS) KERL_INSTALL_AGNERIZED_REBAR=n HOME=$(HERE) ./kerl install r15b erlang
-deps:
- @./rebar get-deps
Oops, something went wrong.

0 comments on commit 0ad4fc6

Please sign in to comment.