-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
66 lines (47 loc) · 1.37 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
56
57
58
59
60
61
62
63
64
65
66
X64=$(shell file -L `which epmd` | grep x86_64 | wc -l | xargs echo)
X64L=$(shell file -L `which epmd` | grep x86-64 | wc -l | xargs echo)
OSX=$(shell uname | grep Darwin | wc -l | xargs echo)
LINUX=$(shell uname | grep Linux | wc -l | xargs echo)
V8ENV=GYPFLAGS="-f make"
ifeq ($(X64),1)
V8FLAGS=arch=x64
else
V8FLAGS=
endif
ifeq ($(X64L),1)
V8FLAGS=arch=x64
V8ENV=CCFLAGS=-fPIC
endif
ifeq ($(LINUX),1)
ZMQ_FLAGS=--with-pic
else
ZMQ_FLAGS=
endif
all: compile
sh:
@erl -pa ebin/ deps/*/ebin/ -s reloader -eval "d:err()"
deps/v8/.git/config:
@git submodule init
@git submodule update
deps/zeromq2/.git/HEAD:
@git submodule init
@git submodule update
deps/v8/libv8.a: deps/v8/.git/config
cd deps/v8 && $(V8ENV) scons $(V8FLAGS)
deps/zeromq2/src/.libs/libzmq.a: deps/zeromq2/.git/HEAD
@cd deps/zeromq2 && ./autogen.sh && ./configure $(ZMQ_FLAGS) && make
dependencies: deps/v8/libv8.a deps/zeromq2/src/.libs/libzmq.a
@./rebar get-deps
test: compile
@./rebar eunit skip_deps=true
dbg-test: compile
@USE_GDB=true ./rebar eunit skip_deps=true
compile: dependencies fast
fast:
@EXTRA_CFLAGS= ./rebar compile
debug: dependencies
@EXTRA_CFLAGS="-g3 -O0 -DERLV8_DEBUG" ./rebar compile
clean:
-rm c_src/*.o
analyze:
clang --analyze -Xanalyzer "-Ideps/v8/include/" -Xanalyzer "-I/usr/local//Cellar/erlang/R15B/lib/erlang/usr/include" -Xanalyzer "-Ideps/zeromq2/include/" c_src/*.cc