-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
53 lines (40 loc) · 1.23 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
OTP_DIR = ${ERL_TOP}
ERLC = $(OTP_DIR)/bin/erlc
ERL = $(OTP_DIR)/bin/erl
# ERL_COMPILE_FLAGS = +native '+{hipe, [o3]}'
ERL_COMPILE_FLAGS = +debug_info
EBIN_DIR = ebin
EBIN_DIRS = ebin ebin/* ${EEP_EBIN_DIR}
I_DIR1 =
I_DIR2 = ./include
INCLUDES = $(wildcard $(I_DIR2)/*.hrl)
I_DIRS = -I $(I_DIR1) -I $(I_DIR2)
ERL_FILES = $(wildcard *.erl)
BEAM_FILES = $(subst .erl,.beam,$(ERL_FILES))
NNAME ?= main
NAME_OPT ?= -sname $(NNAME)
HALT = -s erlang halt
## Create needed folders (if not exist):
$(shell [ -d "$(EBIN_DIR)/" ] || mkdir $(EBIN_DIR)/)
.PHONY: all clean
all: $(BEAM_FILES)
@(cd src && make EBIN_DIR=../$(EBIN_DIR) ERLC=$(ERLC) ERL_COMPILE_FLAGS="$(ERL_COMPILE_FLAGS)" \
I_DIR1="../$(I_DIR1)" I_DIR2="../$(I_DIR2)" $@)
dialyzer: all
@echo ""
@echo " --- --- --- --- DIALYZER --- --- --- --- "
dialyzer --src -r src
%.beam: %.erl $(INCLUDES)
$(ERLC) $(ERL_COMPILE_FLAGS) $(I_DIRS) -o $(EBIN_DIR) $<
open_erl:
$(ERL) $(NAME_OPT) -pa $(EBIN_DIRS)
open_erl_noshell:
$(ERL) $(NAME_OPT) -pa $(EBIN_DIRS) -noshell
exec:
$(ERL) $(NAME_OPT) -pa $(EBIN_DIRS) -noshell -run util exec $(args) $(HALT)
prepare_dialyzer:
dialyzer --build_plt --apps erts stdlib kernel
docker:
./experiments/docker/build_flumina.sh
clean:
rm -f $(EBIN_DIR)/*