Skip to content

Commit

Permalink
Build Erlang if it is not present on the host
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii Rashkovskii committed Feb 13, 2012
1 parent 519268e commit 0ad4fc6
Show file tree
Hide file tree
Showing 3 changed files with 755 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
.kerl
erlang
deps
log
apps/htoad/ebin
Expand Down
28 changes: 22 additions & 6 deletions Makefile
@@ -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

0 comments on commit 0ad4fc6

Please sign in to comment.