Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
New build system for mem3
  • Loading branch information
davisp committed Jan 17, 2014
1 parent cf85661 commit 1f97a2b74e7e9c790c1ca93cd0ab396f56202ddc
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 10 deletions.
@@ -0,0 +1,60 @@
## Licensed under the Apache License, Version 2.0 (the "License"); you may not
## use this file except in compliance with the License. You may obtain a copy
## of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
## License for the specific language governing permissions and limitations under
## the License.

mem3ebindir = $(localerlanglibdir)/mem3/ebin

mem3ebin_DATA = $(compiled_files)

source_files = \
src/mem3.app.src \
src/mem3.erl \
src/mem3_app.erl \
src/mem3_httpd.erl \
src/mem3_nodes.erl \
src/mem3_rep.erl \
src/mem3_shards.erl \
src/mem3_sup.erl \
src/mem3_sync.erl \
src/mem3_sync_event.erl \
src/mem3_sync_nodes.erl \
src/mem3_sync_security.erl \
src/mem3_util.erl

compiled_files = \
ebin/mem3.app \
ebin/mem3.beam \
ebin/mem3_app.beam \
ebin/mem3_httpd.beam \
ebin/mem3_shards.beam \
ebin/mem3_sup.beam \
ebin/mem3_sync.beam \
ebin/mem3_sync_event.beam \
ebin/mem3_sync_nodes.beam \
ebin/mem3_sync_security.beam \
ebin/mem3_util.beam

# Conflicts in couch_db.hrl prevent us from building these
# until after we merge the couch application
# ebin/mem3_nodes.beam
# ebin/mem3_rep.beam


EXTRA_DIST = $(source_files)
CLEANFILES = $(compiled_files)

ebin/%.app: src/%.app.src
@mkdir -p ebin/
sed -e "s|%version%|@version@|g" < $< > $@

ebin/%.beam: src/%.erl
@mkdir -p ebin/
$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) $<
@@ -1,6 +1,20 @@
{application, mem3, [
{description, "CouchDB Cluster Membership"},
{vsn, git},
{vsn, "%version%"},
{modules, [
mem3,
mem3_app,
mem3_httpd,
mem3_nodes,
mem3_rep,
mem3_shards,
mem3_sup,
mem3_sync,
mem3_sync_event,
mem3_sync_nodes,
mem3_sync_security,
mem3_util
]},
{mod, {mem3_app, []}},
{registered, [
mem3_events,
@@ -10,5 +24,15 @@
mem3_sync_nodes,
mem3_sup
]},
{applications, [kernel, stdlib, config, sasl, crypto, mochiweb, couch, rexi, twig]}
{applications, [
kernel,
stdlib,
config,
sasl,
crypto,
mochiweb,
couch,
rexi,
twig
]}
]}.
@@ -22,7 +22,7 @@
-export([quorum/1, group_by_proximity/1]).
-export([live_shards/2]).

-include("mem3.hrl").
-include_lib("mem3/include/mem3.hrl").
-include_lib("couch/include/couch_db.hrl").

start() ->
@@ -17,7 +17,7 @@
-export([handle_membership_req/1]).

%% includes
-include("mem3.hrl").
-include_lib("mem3/include/mem3.hrl").
-include_lib("couch/include/couch_db.hrl").


@@ -19,7 +19,7 @@

-export([start_link/0, get_nodelist/0, get_node_info/2]).

-include("mem3.hrl").
-include_lib("mem3/include/mem3.hrl").
-include_lib("couch/include/couch_db.hrl").

-record(state, {changes_pid, update_seq}).
@@ -2,7 +2,7 @@

-export([go/2, go/3, changes_enumerator/3, make_local_id/2]).

-include("mem3.hrl").
-include_lib("mem3/include/mem3.hrl").
-include_lib("couch/include/couch_db.hrl").

-define(CTX, #user_ctx{roles = [<<"_admin">>]}).
@@ -30,7 +30,7 @@
changes_pid
}).

-include("mem3.hrl").
-include_lib("mem3/include/mem3.hrl").
-include_lib("couch/include/couch_db.hrl").

-define(DBS, mem3_dbs).
@@ -22,7 +22,7 @@

-import(queue, [in/2, out/1, to_list/1, join/2, from_list/1, is_empty/1]).

-include("mem3.hrl").
-include_lib("mem3/include/mem3.hrl").
-include_lib("couch/include/couch_db.hrl").

-record(state, {
@@ -17,7 +17,7 @@
-export([maybe_sync/2, maybe_sync_int/2]).
-export([go/0, go/1]).

-include("mem3.hrl").
-include_lib("mem3/include/mem3.hrl").


maybe_sync(#shard{}=Src, #shard{}=Dst) ->
@@ -25,7 +25,7 @@

-define(RINGTOP, 2 bsl 31). % CRC32 space

-include("mem3.hrl").
-include_lib("mem3/include/mem3.hrl").
-include_lib("couch/include/couch_db.hrl").

hash(Item) when is_binary(Item) ->

0 comments on commit 1f97a2b

Please sign in to comment.