-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://dev.brendonh.org/svn/veracity/trunk@2 9d18217e-6996-4b5f-b398-a6959e6ab315
- Loading branch information
Showing
5 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
PKG_NAME = veracity | ||
PKG_PREFIX = veracity | ||
|
||
SRC_DIR = src | ||
EBIN_DIR = ebin | ||
INCLUDE_DIR = include | ||
TESTS_DIR = tests | ||
|
||
SOURCES = $(wildcard $(SRC_DIR)/*.erl) | ||
TESTS = $(wildcard $(TESTS_DIR)/*.erl) | ||
INCLUDES = $(wildcard $(INCLUDE_DIR)/*.hrl) | ||
TARGETS = $(patsubst $(SRC_DIR)/%.erl, $(EBIN_DIR)/%.beam,$(SOURCES)) | ||
|
||
ERLC_INCLUDES = -I $(INCLUDE_DIR) | ||
ERLC_EBINS = $(EBIN_DIR) | ||
|
||
ERLC = erlc | ||
ERLC_OPTS = $(ERLC_INCLUDES) -o $(EBIN_DIR) -Wall -v +debug_info | ||
|
||
ERLC_ASN_OPTS = -bber_bin +optimize +compact_bit_string -Wall -v +debug_info | ||
ERLC_ASN = $(ERLC) $(ERLC_ASN_OPTS) | ||
|
||
REL_VSN=1 | ||
RELEASE_NAME=$(PKG_NAME)-$(REL_VSN) | ||
|
||
ERL_CMD=erl \ | ||
-boot start_sasl \ | ||
-config $(PKG_NAME) \ | ||
+W w \ | ||
-pa $(ERLC_EBINS) | ||
|
||
all: $(TARGETS) | ||
|
||
run_prereqs: all | ||
|
||
$(RELEASE_NAME).boot: $(RELEASE_NAME).rel | ||
env ERL_LIBS=.. erl -s systools make_script $(RELEASE_NAME) local -s init stop | ||
|
||
run: run_prereqs | ||
$(ERL_CMD) -sname $(PKG_NAME) -s $(PKG_PREFIX)_app | ||
|
||
daemon: run_prereqs | ||
$(ERL_CMD) -detached -sname $(PKG_NAME) -s $(PKG_PREFIX)_app >> $(PKG_NAME).log 2>&1 | ||
|
||
boot: run_prereqs $(RELEASE_NAME).boot | ||
erl -pa ebin -boot $(RELEASE_NAME) -config $(PKG_NAME) | ||
|
||
release: $(RELEASE_NAME).rel | ||
env ERL_LIBS=.. erl -s systools make_script $(RELEASE_NAME) -s init stop | ||
|
||
stop: | ||
erl_call -a '$(PKG_NAME)_app stop_and_halt []' -sname $(PKG_NAME) | ||
|
||
clean: cleanlog | ||
rm -f $(TARGETS) | ||
rm -f $(EBIN_DIR)/*.beam | ||
rm -f $(RELEASE_NAME).boot $(RELEASE_NAME).script | ||
|
||
cleanlog: | ||
rm -f $(PKG_NAME).log auth.log report.log sasl_err.log erl_crash.dump | ||
|
||
$(EBIN_DIR)/%.beam: $(SRC_DIR)/%.erl $(INCLUDES) | ||
$(ERLC) $(ERLC_OPTS) $< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{application, veracity, | ||
[{description, "Veracity"}, | ||
{id, "Veracity"}, | ||
{vsn, "0.0.1"}, | ||
{modules, []}, | ||
{registered, []}, | ||
{applications, [kernel, stdlib]}, | ||
{mod, {veracity_app, []}}, | ||
{env, []} | ||
]}. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
%%%------------------------------------------------------------------- | ||
%%% File : veracity_app.erl | ||
%%% Author : Brendon Hogger <brendonh@lightblue> | ||
%%% Description : IRC! | ||
%%% | ||
%%% Created : 25 Dec 2008 by Brendon Hogger <brendonh@lightblue> | ||
%%%------------------------------------------------------------------- | ||
-module(veracity_app). | ||
|
||
-behaviour(application). | ||
|
||
%% Application callbacks | ||
-export([start/2, stop/1]). | ||
|
||
%% API | ||
-export([start/0]). | ||
|
||
|
||
%%==================================================================== | ||
%% Application callbacks | ||
%%==================================================================== | ||
start(_Type, StartArgs) -> | ||
veracity_sup:start_link(StartArgs). | ||
|
||
start() -> | ||
application:start(veracity). | ||
|
||
stop(_State) -> | ||
ok. | ||
|
||
|
||
%%==================================================================== | ||
%% Internal functions | ||
%%==================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
%%%------------------------------------------------------------------- | ||
%%% File : veracity_sup.erl | ||
%%% Author : Brendon Hogger <brendonh@lightblue> | ||
%%% Description : | ||
%%% | ||
%%% Created : 25 Dec 2008 by Brendon Hogger <brendonh@lightblue> | ||
%%%------------------------------------------------------------------- | ||
-module(veracity_sup). | ||
|
||
-behaviour(supervisor). | ||
|
||
%% API | ||
-export([start_link/1]). | ||
|
||
%% Supervisor callbacks | ||
-export([init/1]). | ||
|
||
-define(SERVER, ?MODULE). | ||
|
||
%%==================================================================== | ||
%% API functions | ||
%%==================================================================== | ||
start_link(Args) -> | ||
supervisor:start_link({local, ?SERVER}, ?MODULE, Args). | ||
|
||
|
||
%%==================================================================== | ||
%% Supervisor callbacks | ||
%%==================================================================== | ||
init(_Args) -> | ||
{ok,{{one_for_one,0,1}, []}}. | ||
|
||
|
||
%%==================================================================== | ||
%% Internal functions | ||
%%==================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ | ||
{sasl, [ | ||
{sasl_error_logger, {file, "sasl_err.log"}} | ||
]} | ||
]. |