Skip to content

Commit

Permalink
move app code to apps/
Browse files Browse the repository at this point in the history
add stage, stagedevrel,docs, test, and dialyzer Makefile targets
fix "make rel" target
update .gitignore
  • Loading branch information
argv0 authored and jnewland committed Apr 15, 2011
1 parent 9f71037 commit 729915b
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 16 deletions.
8 changes: 7 additions & 1 deletion riak_core.gitignore
@@ -1,3 +1,9 @@
*.beam
.eunit
deps/*
deps/*
apps/{{appid}}/ebin
*~
dev/*
doc/*
rel/{{nodeid}}

2 changes: 2 additions & 0 deletions riak_core.rebar.config
@@ -1,3 +1,5 @@
{sub_dirs, ["rel", "apps/{{appid}}"]}.
{cover_enabled, true.}
{erl_opts, [debug_info, fail_on_warning]}.
{deps, [{riak_core, "0.14..*",
{git, "git://github.com/basho/riak_core", "master"}}
Expand Down
61 changes: 59 additions & 2 deletions riak_core_multinode.Makefile
@@ -1,4 +1,4 @@
.PHONY: deps rel
.PHONY: deps rel stagedevrel

all: deps compile

Expand All @@ -14,6 +14,9 @@ clean:
distclean: clean devclean relclean
./rebar delete-deps

test:
./rebar skip_deps=true eunit

rel: all
./rebar generate

Expand All @@ -22,9 +25,63 @@ relclean:

devrel: dev1 dev2 dev3

###
### Docs
###
docs:
./rebar skip_deps=true doc

##
## Developer targets
##

stage : rel
$(foreach dep,$(wildcard deps/* wildcard apps/*), rm -rf rel/{{nodeid}}/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) rel/{{nodeid}}/lib;)


stagedevrel: dev1 dev2 dev3
$(foreach dev,$^,\
$(foreach dep,$(wildcard deps/* wildcard apps/*), rm -rf dev/$(dev)/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) dev/$(dev)/lib;))

devrel: dev1 dev2 dev3


devclean:
rm -rf dev

dev1 dev2 dev3:
mkdir -p dev
(cd rel && ../rebar generate target_dir=../dev/$@ overlay_vars=vars/$@.config)
(cd rel && ../rebar generate target_dir=../dev/$@ overlay_vars=vars/$@.config)


##
## Dialyzer
##
APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
xmerl webtool snmp public_key mnesia eunit syntax_tools compiler
COMBO_PLT = $(HOME)/.{{appid}}_combo_dialyzer_plt

check_plt: deps compile
dialyzer --check_plt --plt $(COMBO_PLT) --apps $(APPS) \
deps/*/ebin apps/*/ebin

build_plt: deps compile
dialyzer --build_plt --output_plt $(COMBO_PLT) --apps $(APPS) \
deps/*/ebin apps/*/ebin

dialyzer: deps compile
@echo
@echo Use "'make check_plt'" to check PLT prior to using this target.
@echo Use "'make build_plt'" to build PLT prior to using this target.
@echo
@sleep 1
dialyzer -Wno_return --plt $(COMBO_PLT) deps/*/ebin apps/*/ebin


cleanplt:
@echo
@echo "Are you sure? It takes about 1/2 hour to re-build."
@echo Deleting $(COMBO_PLT) in 5 seconds.
@echo
sleep 5
rm $(COMBO_PLT)
6 changes: 3 additions & 3 deletions riak_core_multinode.rebar.config
@@ -1,7 +1,7 @@
{sub_dirs, ["rel", "apps/{{appid}}"]}.
{cover_enabled, true}.
{erl_opts, [debug_info, fail_on_warning]}.

{sub_dirs, ["rel"]}.

{edoc_opts, [{dir, "../../doc"}]}.
{deps, [{riak_core, "0.14..*",
{git, "git://github.com/basho/riak_core", "master"}}
]}.
2 changes: 1 addition & 1 deletion riak_core_multinode.reltool.config
@@ -1,5 +1,5 @@
{sys, [
{lib_dirs, ["../../", "../deps/"]},
{lib_dirs, ["../apps/", "../deps/"]},
{rel, "{{nodeid}}", "1",
[
kernel,
Expand Down
16 changes: 8 additions & 8 deletions riak_core_multinode.template
Expand Up @@ -12,20 +12,20 @@
{template, "riak_core_multinode.vm.args", "rel/files/vm.args"}.

%% copy from riak_core
{template, "riak_core.app.src", "src/{{appid}}.app.src"}.
{template, "riak_core_app.erl", "src/{{appid}}_app.erl"}.
{template, "riak_core.erl", "src/{{appid}}.erl"}.
{template, "riak_core.hrl", "src/{{appid}}.hrl"}.
{template, "riak_core_sup.erl", "src/{{appid}}_sup.erl"}.
{template, "riak_core_vnode.erl", "src/{{appid}}_vnode.erl"}.
{template, "riak_core.app.src", "apps/{{appid}}/src/{{appid}}.app.src"}.
{template, "riak_core_app.erl", "apps/{{appid}}/src/{{appid}}_app.erl"}.
{template, "riak_core.erl", "apps/{{appid}}/src/{{appid}}.erl"}.
{template, "riak_core.hrl", "apps/{{appid}}/src/{{appid}}.hrl"}.
{template, "riak_core_sup.erl", "apps/{{appid}}/src/{{appid}}_sup.erl"}.
{template, "riak_core_vnode.erl", "apps/{{appid}}/src/{{appid}}_vnode.erl"}.
{template, "riak_core.gitignore", ".gitignore"}.

%% rest of multinode stuff
{file, "riak_core_multinode.rebar.config", "rebar.config"}.
{template, "riak_core_multinode.rebar.config", "rebar.config"}.
{template, "riak_core_multinode.Makefile", "Makefile"}.
{template, "riak_core_multinode.admin-runner", "rel/files/{{nodeid}}-admin"}.
{chmod, 8#744, "rel/files/{{nodeid}}-admin"}.
{template, "riak_core_multinode.console", "src/{{appid}}_console.erl"}.
{template, "riak_core_multinode.console", "apps/{{appid}}/src/{{appid}}_console.erl"}.
{template, "riak_core_multinode.vars.config", "rel/vars.config"}.
{template, "riak_core_multinode.dev1.config", "rel/vars/dev1.config"}.
{template, "riak_core_multinode.dev2.config", "rel/vars/dev2.config"}.
Expand Down
2 changes: 1 addition & 1 deletion riak_core_multinode.vm.args
@@ -1,6 +1,6 @@

## Name of the node
-name \{\{node\}\}
-name {{node}}

## Cookie for distributed erlang
-setcookie {{nodeid}}
Expand Down

0 comments on commit 729915b

Please sign in to comment.