-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMakefile
86 lines (65 loc) · 1.73 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.PHONY: default fast all get-deps compile dialyzer tests clean mrproper
ERL_INCLUDE = $(PWD):$(ERL_LIBS)
ifneq (,$(findstring Windows,$(OS)))
SEP := $(strip \)
else
SEP := $(strip /)
endif
BEAMS = ebin$(SEP)nifty_clangparse.beam \
ebin$(SEP)nifty.beam \
ebin$(SEP)nifty_filters.beam \
ebin$(SEP)nifty_rebar.beam \
ebin$(SEP)nifty_tags.beam \
ebin$(SEP)nifty_types.beam \
ebin$(SEP)nifty_utils.beam
REBAR := .$(SEP)rebar3
# nifty_root
ifndef NIFTY_ROOT_CONFIG
NIFTY_ROOT_CONFIG := NIFTY_ROOT=$(PWD)
else
NIFTY_ROOT_CONFIG :=
endif
# LLVM config
ifdef NIFTY_LLVM_VERSION
LLVM_CONFIG := NIFTY_LLVM_CONFIG=llvm-config-$(NIFTY_LLVM_VERSION)
NIFTY_LLVM_CONFIG := llvm-config-$(NIFTY_LLVM_VERSION)
CLANG := clang-$(NIFTY_LLVM_VERSION)
else
LLVM_CONFIG := NIFTY_LLVM_CONFIG=llvm-config
NIFTY_LLVM_CONFIG := llvm-config
CLANG := clang
endif
NIFTY_CPATH := `$(NIFTY_LLVM_CONFIG) --libdir`/clang/`$(NIFTY_LLVM_CONFIG) --version`/include/:$(CPATH)
CONFIG := $(NIFTY_ROOT_CONFIG) $(LLVM_CONFIG)
DIALYZER_APPS = erts kernel stdlib compiler crypto syntax_tools tools
DIALYZER_FLAGS = -Wunmatched_returns -Wunderspecs
default: fast
fast: compile
all: default tests dialyze doc
get-deps: rebar3
$(REBAR) get-deps
travis/fix_exports.sh
compile: get-deps rebar3
$(CONFIG) $(REBAR) compile
dialyze: rebar3
$(REBAR) dialyzer
tests: compile rebar3
CC=$(CLANG) \
CPATH=$(NIFTY_CPATH) \
$(CONFIG) \
ERL_LIBS=$(ERL_INCLUDE) \
$(REBAR) eunit
doc: rebar3
$(REBAR) edoc
clean: rebar3
$(REBAR) clean
mrproper: clean
$(RM) rebar3 rebar.lock
$(RM) -r _build/ cache/
$(RM) -rf nt_* dereference_regression/
$(RM) -r doc
shell: rebar3
$(REBAR) shell
rebar3:
wget https://github.com/erlang/rebar3/releases/download/3.13.2/rebar3
chmod +x rebar3