-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
55 lines (44 loc) · 1.48 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
LIBDIR = `erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell`
VERSION = 0.0.1
CC = erlc
ERL = erl
EBIN = ebin
CFLAGS = -I include -pa $(EBIN)
COMPILE = $(CC) $(CFLAGS) -o $(EBIN)
EBIN_DIRS = $(wildcard deps/*/ebin) -pa $(EBIN)
WEB_DIR = web/
WONDERLAND_DIR = $(WEB_DIR)/wonderland
APP = alice
TEST_DIR = test
TEST_EBIN_DIR = $(TEST_DIR)/ebin
all: mochi ebin compile
all_boot: all boot
wonderland_boot: wonderland all_boot
start: all start_all
rstakeout: wonderland compile
wonderland:
[ -f $(WONDERLAND_DIR)/index.html ] || (mkdir -p $(WEB_DIR) && cd $(WEB_DIR) && git clone git://github.com/auser/wonderland.git)
cd $(WONDERLAND_DIR) && git pull origin master
mochi:
@(cd deps/mochiweb;$(MAKE))
compile:
@$(ERL) -pa $(EBIN_DIRS) -noinput +B -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'
edoc:
@echo Generating $(APP) documentation from srcs
@$(ERL) -noinput -eval 'edoc:application($(APP), "./", [{doc, "doc/"}, {files, "src/"}])' -s erlang halt
boot:
(cd ebin; $(ERL) -pa $(EBIN_DIRS) -noshell -run make_boot write_scripts alice)
test: $(TEST_EBIN_DIR) compile
$(ERL) -noshell -pa $(EBIN) \
-pa deps/*/ebin \
-pa $(TEST_EBIN_DIR) \
-s test_suite test \
-s init stop
ebin:
@(mkdir ebin)
$(TEST_EBIN_DIR):
@mkdir $(TEST_EBIN_DIR)
clean:
rm -rf ebin/*.beam ebin/erl_crash.dump erl_crash.dump ebin/*.boot ebin/*.rel ebin/*.script
clean_mochiweb:
rm -rf deps/mochiweb/ebin/*.beam